apiuikit 1.7.0 → 1.8.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.
@@ -1,76 +1,76 @@
1
- "use strict";var Hu=Object.defineProperty;var Wu=(e,t,r)=>t in e?Hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var be=(e,t,r)=>Wu(e,typeof t!="symbol"?t+"":t,r);const o=require("react/jsx-runtime"),x=require("react"),an=require("react-dom"),uo=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],fo=(e,t)=>{const r=t.length>0?t:uo,n=(e%r.length+r.length)%r.length;return r[n]},un={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:uo},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},po=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Gu=e=>typeof e=="object"&&e!==null;function Ku(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function za(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(const n of t.slice(2).split("/")){if(!Gu(r))return;const s=Ku(n);if(s===void 0||(r=r[s],r===void 0))return}return r}function Pn(e){const t=new Map;return r=>{if(t.has(r))return t.get(r);const n=za(e,r);return t.set(r,n),n}}const vs=e=>typeof e=="object"&&e!==null,Vu=e=>e.replace(/^#\//,"").split("/").pop()??e,ho=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),po(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(n=>ho(n,t))),Ua=(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),po(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Ua(s,t,r))}finally{t.delete(e)}},Ju=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Pi=e=>e.length?`#/${e.map(Ju).join("/")}`:"#";function Dn(e){if(!Ua(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,Pi(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(po(i)){const l=za(e,i.$ref),c=vs(l)||Array.isArray(l);if(c&&!r.has(l)){const u=s(l,a);return vs(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=Vu(i.$ref)),u}if(l!==void 0&&!c)return l}if(vs(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,Pi(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 Ur extends x.Component{constructor(){super(...arguments);be(this,"state",{error:null});be(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 Hr=x.createContext(null),jt=()=>{const e=x.useContext(Hr);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Ha=()=>{const e=jt();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Wa=()=>{const e=jt();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},Be=jt;var Tr=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Tr||{});const Yu="Contact",Xu="Email",Di="License",Bi="External Documentation",Zu="Tags",Qu="Implicit",qu=`The Implicit flow is a simplified OAuth flow previously recommended
1
+ "use strict";var Gu=Object.defineProperty;var Ku=(e,t,r)=>t in e?Gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var be=(e,t,r)=>Ku(e,typeof t!="symbol"?t+"":t,r);const o=require("react/jsx-runtime"),x=require("react"),an=require("react-dom"),po=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],ho=(e,t)=>{const r=t.length>0?t:po,n=(e%r.length+r.length)%r.length;return r[n]},un={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:po},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0},sidePanel:{containment:"viewport"}},mo=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Vu=e=>typeof e=="object"&&e!==null;function Ju(e){try{return decodeURIComponent(e).replace(/~1/g,"/").replace(/~0/g,"~")}catch{return}}function Ha(e,t){if(t==="#")return e;if(!t.startsWith("#/"))return;let r=e;for(const n of t.slice(2).split("/")){if(!Vu(r))return;const s=Ju(n);if(s===void 0||(r=r[s],r===void 0))return}return r}function Bn(e){const t=new Map;return r=>{if(t.has(r))return t.get(r);const n=Ha(e,r);return t.set(r,n),n}}const js=e=>typeof e=="object"&&e!==null,Yu=e=>e.replace(/^#\//,"").split("/").pop()??e,go=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),mo(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(n=>go(n,t))),Wa=(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),mo(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>Wa(s,t,r))}finally{t.delete(e)}},Xu=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),Bi=e=>e.length?`#/${e.map(Xu).join("/")}`:"#";function dn(e){if(!Wa(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,Bi(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(mo(i)){const l=Ha(e,i.$ref),c=js(l)||Array.isArray(l);if(c&&!r.has(l)){const u=s(l,a);return js(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=Yu(i.$ref)),u}if(l!==void 0&&!c)return l}if(js(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,Bi(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 Br extends x.Component{constructor(){super(...arguments);be(this,"state",{error:null});be(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 fn=x.createContext(null),jt=()=>{const e=x.useContext(fn);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Ga=()=>{const e=jt();if(e.specType!=="asyncapi")throw new Error(`useAsyncAPIDocumentContext expected an AsyncAPI document provider, but received provider type "${e.specType}"`);return e},Ka=()=>{const e=jt();if(e.specType!=="openapi")throw new Error(`useOpenAPIDocumentContext expected an OpenAPI document provider, but received provider type "${e.specType}"`);return e},Be=jt;var Sr=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Sr||{});const Zu="Contact",Qu="Email",Fi="License",zi="External Documentation",qu="Tags",ed="Implicit",td=`The Implicit flow is a simplified OAuth flow previously recommended
2
2
  for native apps and JavaScript apps where the access token is returned
3
- immediately without an extra authorization code exchange step.`,ed="Client Credentials",td="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",nd="Password",rd="The Password grant type is a legacy way to exchange a user's credentials for an access token.",sd="Authorization Code",od="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Ga="Connecting to a server",id="",_r=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ad=[50,100,200,300,500,600,700],ld={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"}},cd=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],ud={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",[Tr.SEND]:"bg-green-100 text-green-800",[Tr.RECEIVE]:"bg-blue-100 text-blue-800"};function Ka(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 js(e,t,r){if(e)for(const n of ad){const s=e[n];s&&(r[`--color-${t}-${n}`]=Ka(s))}}const dd=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],fd={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 pd(e){const t={},r=e.light?"light":e.dark?"dark":null,n=r==="dark"?e.dark:r==="light"?e.light:void 0;if(r==="dark")for(const[s,i]of Object.entries(fd))t[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of dd){const a=n[s];a&&(t[i]=Ka(a))}return e.colors&&(js(e.colors.primary,"primary",t),js(e.colors.secondary,"secondary",t),js(e.colors.neutral,"neutral",t)),t}const hd=e=>e.endsWith(".tab"),Fi=new WeakMap;let md=0;const gd=e=>{const t=Fi.get(e);if(t)return t;const r=`plugin-${md++}`;return Fi.set(e,r),r};function Va(e){const t=new Map;for(const r of e){const n=gd(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),hd(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}const xd=[];function Ja(e,t,r=un,n=xd){var T,v,b,C,B,_,H,Z;const[s,i]=x.useState(null),[a,l]=x.useState(null),c=x.useMemo(()=>Pn(t),[t]),u=((T=r.expand)==null?void 0:T.schemas)===!0,d=(b=(v=r.theme)==null?void 0:v.depthColors)!=null&&b.length?r.theme.depthColors:uo,f=((C=r.show)==null?void 0:C.extensions)!==!1,p=((B=r.show)==null?void 0:B.codeSamples)!==!1,h=r.topOffset,g=typeof h=="number"&&Number.isFinite(h)?Math.max(0,h):0,w=((_=r.sidePanel)==null?void 0:_.containment)??"viewport",y=(H=r.sidePanel)==null?void 0:H.topOffset,E=typeof y=="number"&&Number.isFinite(y)?Math.max(0,y):g,N=(Z=r.markdown)==null?void 0:Z.url,j=x.useMemo(()=>{if(typeof N=="function")return N;if(typeof N=="string")return()=>N},[N]),I=x.useMemo(()=>Va(n),[n]),W=x.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:a,topOffset:g,sidePanelContainment:w,sidePanelTopOffset:E,defaultSchemaExpanded:u,depthColors:d,showExtensions:f,showCodeSamples:p,markdownUrl:j,plugins:n,pluginSlotRegistry:I,config:r}),[e,t,c,s,a,g,w,E,u,d,f,p,j,n,I,r]),G=r.theme?pd(r.theme):{};return{contextValue:W,themeVars:G,setPortalHost:i,setRootElement:l}}function mo({document:e,config:t=un,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Ja("asyncapi",e,t,r);return o.jsx(Hr.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"asyncapi-portal-root"}),s]})})}const Ya="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function Ot({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?"":Ya}`,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 zt(...e){return e.filter(Boolean).join(" ")}function dn({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 wr=(e,t)=>`${e?`${e}-`:""}tab-${t}`,kr=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function Vt({tabs:e,current:t,onChange:r=()=>{},ariaLabel:n="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:l}){var w;const c=x.useId(),u=x.useRef([]),d=t??(a?"":((w=e[0])==null?void 0:w.id)??""),f=e.some(y=>!!y.icon),p=t?e.findIndex(y=>y.id===t):-1,h=p>=0?p:0,g=(y,E)=>{var I;if(e.length===0)return;const N=W=>(W+e.length)%e.length;let j=E;if(y.key==="ArrowRight"&&(y.preventDefault(),j=N(E+1)),y.key==="ArrowLeft"&&(y.preventDefault(),j=N(E-1)),y.key==="Home"&&(y.preventDefault(),j=0),y.key==="End"&&(y.preventDefault(),j=e.length-1),j!==E){const W=e[j];r(W.id),(I=u.current[j])==null||I.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:zt("@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:y=>r(y.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(y=>o.jsx("option",{value:y.id,children:y.name},y.id))]}),o.jsx(dn,{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:zt("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((y,E)=>{const N=y.id===t;return o.jsx("button",{ref:j=>{u.current[E]=j},id:wr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":kr(i,y.id),onClick:()=>r(y.id),onKeyDown:j=>g(j,E),className:zt("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",N?"bg-surface text-foreground shadow-sm":"text-foreground-muted hover:text-foreground-secondary"),children:y.name},y.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((y,E)=>{const N=y.id===t,j=y.icon;return o.jsx("button",{ref:I=>{u.current[E]=I},id:wr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":kr(i,y.id),onClick:()=>r(y.id),onKeyDown:I=>g(I,E),className:zt("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",N?"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:[j?o.jsx(j,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:y.name})]})},y.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":n,children:e.map((y,E)=>{const N=y.id===t;return o.jsxs("button",{ref:j=>{u.current[E]=j},id:wr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":kr(i,y.id),onClick:()=>r(y.id),onKeyDown:j=>g(j,E),className:zt(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",E===0?"rounded-l-lg":"",E===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:y.name}),o.jsx("span",{"aria-hidden":"true",className:zt(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},y.id)})})})]}):null}function bd({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:kr(r,s.id),role:"tabpanel","aria-labelledby":wr(r,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:n(s,i)},s.id)})})}function Xa(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function go(e){let t=e;for(;t&&t!==document.body;){if(Xa(t))return t;t=t.parentElement}return document.documentElement}function yd(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Xa(r))return r;if(r===t)break;r=r.parentElement}return null}function Za(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 Qa({tabs:e,current:t,onChange:r}){const{rootElement:n,topOffset:s=0}=jt();if(!e.length)return null;const i=typeof document<"u"&&go(n)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(Vt,{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(Ot,{content:a,stickySideContent:!1})})}function wd(e,t){const[r,n]=x.useState("docked"),s=x.useRef(t);return s.current=t,x.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]),x.useEffect(()=>{t&&n(i=>i==="hidden"?"pinned":i)},[t]),r}function xo(e,t){const[r,n]=x.useState(null);return x.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 cr=16,zi=10,kd=10,vd=40,jd=8;function qa({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=jt(),i=wd(n,r),a=i!=="docked",l=xo(n,a),c=typeof window>"u"?0:window.innerWidth,u=l?Math.max(l.left,0):0,d=l?Math.min(l.right,c):c,f=s+zi-kd+vd+jd,p={left:a?u+cr:cr,right:a?Math.max(c-d,0)+cr:cr,transform:`translateY(${i==="hidden"?`-${f}px`:"0px"})`,...a?{position:"fixed",top:s+zi,pointerEvents:i==="hidden"?"none":void 0}:{}};return o.jsx("header",{className:"document-topbar",style:p,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Ya}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function el(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(x.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 Ed(e){return e.map(t=>`\`${t}\``).join(", ")}function Bs(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 Sd(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 Ui=360;function Ad(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 ${_r[t++%_r.length]}`,children:`{${r.value}}`},n))}function $t({address:e,parameters:t,className:r="text-xs",truncate:n=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=Be(),[l,c]=x.useState(null),[u,d]=x.useState({top:0,left:0,placement:"top"}),[f,p]=x.useState(!1),[h,g]=x.useState(null),w=x.useRef(null),y=x.useId(),E=Sd(e);let N=0;x.useEffect(()=>{if(!n)return;const b=w.current;if(!b)return;const C=()=>p(b.scrollWidth>b.clientWidth);C();const B=new ResizeObserver(C);return B.observe(b),()=>B.disconnect()},[n,e]);const j=(b,C)=>{d(Bs(C)),c(b)},I=()=>c(null),W=b=>g(Bs(b,{align:"end",width:Ui})),G=()=>g(null),T=E.map((b,C)=>{if(b.type==="text")return o.jsx("span",{children:b.value},C);const B=t==null?void 0:t[b.value],_=_r[N++%_r.length],H=l===C,Z=!!B&&(B.description||B.type||B.default||B.enum&&B.enum.length>0||B.examples&&B.examples.length>0),se=`channel-address-tooltip-${C}`,S=Z&&H?se:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:A=>Z&&j(C,A.currentTarget),onMouseLeave:I,children:[o.jsx("span",{className:`font-semibold ${_} ${Z?"cursor-help underline decoration-dotted":""}`,role:Z?"button":void 0,tabIndex:Z?0:void 0,"aria-expanded":Z?H:void 0,"aria-describedby":S,onFocus:A=>Z&&j(C,A.currentTarget),onBlur:I,onKeyDown:A=>{Z&&((A.key==="Enter"||A.key===" ")&&(A.preventDefault(),j(C,A.currentTarget)),A.key==="Escape"&&(A.preventDefault(),I(),A.currentTarget.blur()))},children:`{${b.value}}`}),Z&&H&&a&&an.createPortal(o.jsxs("div",{id:se,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:[B.description&&o.jsx("div",{children:B.description}),B.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:B.type})}),B.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:B.default})]}),B.enum&&B.enum.length>0&&o.jsx("div",{className:"mt-1",children:el(B.enum)}),B.examples&&B.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",B.examples.join(", ")]})]}),a)]},C)}),v=i?"px-2 py-1 ":"";return n?o.jsxs("code",{className:`${v}rounded text-foreground-secondary flex items-center min-w-0 ${r}`,children:[o.jsx("span",{ref:w,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?y: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:b=>W(b.currentTarget),onMouseLeave:G,onFocus:b=>W(b.currentTarget),onBlur:G,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),W(b.currentTarget)),b.key==="Escape"&&(b.preventDefault(),G(),b.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&an.createPortal(o.jsx("div",{id:y,role:"tooltip",style:{top:h.top,left:h.left,width:Ui},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:Ad(E)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${r}`,children:T})}const Nd={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function It({method:e,size:t="sm",className:r=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${Nd[t]} ${ud[e]} ${r}`,children:e}):null}const Hi=6,Td=12,_d=8,Cd=.7;function $d(e,t){if(e===0)return 1/0;const r=e*Cd-_d*2,n=t*Hi+Math.max(0,t-1)*Td;return Math.max(1,Math.floor((r-n)/Hi))}function Id(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 Wi=20;function Od({sections:e,activeSection:t,onTabChange:r,onItemSelect:n,selectedItem:s}){const[i,a]=x.useState(!1),[l,c]=x.useState(!1),u=i||l,{rootElement:d,portalHost:f,topOffset:p=0}=Be(),h=x.useRef(null),g=x.useRef(null),w=x.useMemo(()=>e.filter(P=>P.items.length>0),[e]),y=x.useMemo(()=>w.filter(P=>P.isTab===!1||P.id===t),[w,t]),E=x.useMemo(()=>w.filter(P=>P.showInPopover!==!1),[w]),[N,j]=x.useState(null),I=x.useRef(null),W=x.useRef(null),G=x.useCallback((P,X)=>{j({section:P,key:X}),I.current={section:P,key:X},W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{I.current=null},600)},[]);x.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]),x.useEffect(()=>{const X=e.filter(K=>K.items.length>0).flatMap(K=>K.items.map(pe=>({section:K.id,key:K.itemKey(pe),id:K.targetId(pe)}))).map(K=>({...K,el:document.getElementById(K.id)})).filter(K=>!!K.el);if(X.length===0)return;const O=new Map(X.map(K=>[K.el,K])),ee=new Map,le=new IntersectionObserver(K=>{for(const xe of K)xe.isIntersecting?ee.set(xe.target,xe.boundingClientRect.top):ee.delete(xe.target);if(ee.size===0)return;let pe=null,we=-1/0;for(const[xe,He]of ee)He>we&&(pe=xe,we=He);const fe=pe&&O.get(pe);if(!fe)return;const Me=I.current;if(Me){if(fe.section!==Me.section||fe.key!==Me.key)return;I.current=null}j({section:fe.section,key:fe.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return X.forEach(K=>le.observe(K.el)),()=>le.disconnect()},[e]);const T=(N==null?void 0:N.section)??t,v=N??s,b=xo(d,!0),C=typeof window>"u"?0:window.innerWidth,B=typeof window>"u"?0:window.innerHeight,_=!!b&&b.bottom>p&&b.top<B,H=Math.max(0,B-p),Z=p+H/2,se=!!b&&b.width<1024,S={opacity:_?1:0,pointerEvents:_?"auto":"none",transition:"opacity 0.2s ease"},A={position:"fixed",top:Z,left:((b==null?void 0:b.left)??0)+Wi,transform:"translateY(-50%)",zIndex:51,...S},F=Math.min((b==null?void 0:b.right)??0,C)-60,J={position:"fixed",bottom:16,left:F,zIndex:51,...S},ae=se?{position:"fixed",bottom:68,right:C-(F+44),zIndex:52}:{position:"fixed",top:Z,left:((b==null?void 0:b.left)??0)+Wi,transform:"translateY(-50%)",maxHeight:`calc(100vh - ${p+32}px)`,zIndex:52};x.useEffect(()=>{if(!i)return;const P=O=>{O.key==="Escape"&&a(!1)},X=O=>{var le,K;const ee=O.target;(le=h.current)!=null&&le.contains(ee)||(K=g.current)!=null&&K.contains(ee)||a(!1)};return document.addEventListener("keydown",P),document.addEventListener("mousedown",X),()=>{document.removeEventListener("keydown",P),document.removeEventListener("mousedown",X)}},[i]);const te=x.useCallback((P,X)=>{P.isTab!==!1&&r(P.id),X&&setTimeout(()=>{var O;(O=document.getElementById(X))==null||O.scrollIntoView({behavior:"smooth",block:"start"})},50)},[r]),Te=x.useMemo(()=>E.map(P=>{const X=T===P.id,O=(v==null?void 0:v.section)===P.id,ee=P.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{te(P),G(P.id,""),se&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${X?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(ee,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${X?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${X?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:P.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 ${X?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:P.items.length})]}),P.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:P.items.map(le=>{const K=P.itemKey(le),pe=O&&(v==null?void 0:v.key)===K;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{te(P,P.targetId(le)),n(P.id,K),G(P.id,K),se&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${pe?"bg-primary-50 font-medium text-primary-500":X?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:P.renderItem(le,{isSelected:pe,isSectionActive:X})})},K)})})]},P.id)}),[E,T,v,se,te,n,G]),q=$d(H,y.length),ve=x.useMemo(()=>{const P=Id(y.map(X=>X.items.length),q);return y.map((X,O)=>{const ee=T===X.id,le=X.items.length,K=P[O];let pe=-1;if((v==null?void 0:v.section)===X.id){const we=X.items.findIndex(fe=>X.itemKey(fe)===v.key);we>=0&&(pe=Math.min(K-1,Math.floor(we*K/le)))}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 ${ee?"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:K},(we,fe)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${fe===pe?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},fe))})]},X.id)})},[y,T,v,q]);return o.jsxs(o.Fragment,{children:[!se&&o.jsx("button",{ref:h,onClick:()=>a(P=>!P),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:A,children:ve}),se&&o.jsx("button",{ref:h,onClick:()=>a(P=>!P),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:J,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&&an.createPortal(o.jsx("div",{ref:g,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 ${se?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:ae,children:Te}),f)]})}function tl({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Od,{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 bo({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 Rd(e){return o.jsxs(bo,{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 yo({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 nl(e){return{id:"info",label:"Info",icon:Rd,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function rl(e){return{id:"schemas",label:"Schemas",icon:yo,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function sl({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 Wr({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 ol({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 ur={};function Md({operations:e=ur,messages:t=ur,schemas:r=ur,servers:n=ur,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const f=x.useMemo(()=>{const p=h=>{var w;return d!=null&&d.useChannelAddressAsIdentifier?((w=e[h])==null?void 0:w.channel)??null:null};return[nl(s),{id:"servers",label:"Servers",icon:sl,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:Wr,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var w;const g=p(h);return g!=null&&g.address?o.jsx($t,{address:g.address,parameters:g.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(It,{method:(w=e[h])==null?void 0:w.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:ol,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},rl(r)]},[e,t,r,n,s,d]);return o.jsx(tl,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Gr=["get","put","post","delete","options","head","patch","trace"],Ld=(e,t)=>`${e} ${t}`;function Gi(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 Cn(e){return Object.keys(e).sort().flatMap(t=>{const r=e[t];return r?Gr.filter(n=>r[n]).map(n=>({key:Ld(n,t),method:n,path:t})):[]})}function wo({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 Ki={},Pd={},Dd=[];function Bd({paths:e=Ki,webhooks:t=Ki,schemas:r=Pd,servers:n=Dd,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=x.useMemo(()=>Cn(e),[e]),f=x.useMemo(()=>Cn(t),[t]),p=x.useMemo(()=>{const h=n.map((g,w)=>({key:`server-${w}`,url:g}));return[nl(s),{id:"servers",label:"Servers",icon:sl,isTab:!1,items:h,itemKey:g=>g.key,targetId:g=>g.key,renderItem:g=>o.jsx("span",{className:"truncate",children:g.url})},{id:"endpoints",label:"Endpoints",icon:Wr,items:d,itemKey:g=>g.key,targetId:g=>`endpoint-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(It,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx($t,{address:g.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:wo,items:f,itemKey:g=>g.key,targetId:g=>`webhook-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(It,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g.path})]})},rl(r)]},[d,f,r,n,s]);return o.jsx(tl,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Fd=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 il({query:e,onQueryChange:t,results:r,onSelectResult:n,onOpenChange:s}){const i=x.useRef(null),a=x.useRef(null),[l,c]=x.useState(!1),[u,d]=x.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:h,rootElement:g,topOffset:w=0}=Be(),y=()=>{c(!1),d(-1)};x.useEffect(()=>(s==null||s(l),()=>s==null?void 0:s(!1)),[l,s]);const E=x.useRef(!1),N=x.useRef(!1);x.useEffect(()=>{if(!g)return;const v=()=>{E.current=!0},b=()=>{E.current=!1};return g.addEventListener("mouseenter",v),g.addEventListener("mouseleave",b),()=>{g.removeEventListener("mouseenter",v),g.removeEventListener("mouseleave",b)}},[g]),x.useEffect(()=>{if(!g)return;const v=b=>{N.current=g.contains(b.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[g]),x.useEffect(()=>{if(!g)return;const v=b=>{!(b.metaKey||b.ctrlKey)||b.key.toLowerCase()!=="k"||!(g.contains(document.activeElement)||E.current||N.current)||(b.preventDefault(),c(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[g]),x.useEffect(()=>{if(!l)return;const v=requestAnimationFrame(()=>{var b;return(b=a.current)==null?void 0:b.focus()});return()=>cancelAnimationFrame(v)},[l]),x.useEffect(()=>{if(!(!l||!h))return Za(go(h))},[l,h]),x.useEffect(()=>{if(!l)return;const v=b=>{b.key==="Escape"&&y()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l]),x.useEffect(()=>{if(!l)return;const v=b=>{i.current&&!i.current.contains(b.target)&&y()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]),x.useEffect(()=>{u>=r.length&&d(r.length-1)},[u,r.length]),x.useEffect(()=>{var v;u<0||(v=document.getElementById(p(u)))==null||v.scrollIntoView({block:"nearest"})},[u]);const j=l&&e.trim().length>0,I=v=>{y(),n(v)},W=v=>{if(v.key==="Escape"){v.preventDefault(),y();return}if(j){if(v.key==="ArrowDown"){v.preventDefault(),d(b=>r.length===0?-1:Math.min(b+1,r.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(b=>r.length===0?-1:Math.max(b-1,0));return}if(v.key==="Home"){v.preventDefault(),r.length>0&&d(0);return}if(v.key==="End"){v.preventDefault(),r.length>0&&d(r.length-1);return}if((v.key==="Enter"||v.key===" ")&&u>=0&&r[u]){v.preventDefault(),I(r[u]);return}}},G=j?`${r.length} result${r.length===1?"":"s"} found`:"",T=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(Fd,{})}),l&&h&&an.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:w},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:v=>t(v.target.value),onKeyDown:W,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":j,"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:G}),j&&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((v,b)=>o.jsx("li",{children:o.jsxs("button",{id:p(b),type:"button",role:"option","aria-selected":u===b,onClick:()=>I(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(u===b?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:v.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:v.location}),v.subtitle&&o.jsxs("span",{children:["• ",v.subtitle]})]})]})},v.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:T?"⌘ 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 al({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 ll({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 Kr({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 zd=["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 cl(e){return`${["> ## Agent Instructions",...zd.map(r=>`> ${r}`)].join(`
3
+ immediately without an extra authorization code exchange step.`,nd="Client Credentials",rd="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",sd="Password",od="The Password grant type is a legacy way to exchange a user's credentials for an access token.",id="Authorization Code",ad="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Va="Connecting to a server",ld="",Ar=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],cd=[50,100,200,300,500,600,700],ud={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"}},dd=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],fd={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",[Sr.SEND]:"bg-green-100 text-green-800",[Sr.RECEIVE]:"bg-blue-100 text-blue-800"};function Ja(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 Es(e,t,r){if(e)for(const n of cd){const s=e[n];s&&(r[`--color-${t}-${n}`]=Ja(s))}}const pd=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],hd={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 md(e){const t={},r=e.light?"light":e.dark?"dark":null,n=r==="dark"?e.dark:r==="light"?e.light:void 0;if(r==="dark")for(const[s,i]of Object.entries(hd))t[`--color-neutral-${s}`]=i;if(n)for(const[s,i]of pd){const a=n[s];a&&(t[i]=Ja(a))}return e.colors&&(Es(e.colors.primary,"primary",t),Es(e.colors.secondary,"secondary",t),Es(e.colors.neutral,"neutral",t)),t}const gd=e=>e.endsWith(".tab"),Ui=new WeakMap;let xd=0;const bd=e=>{const t=Ui.get(e);if(t)return t;const r=`plugin-${xd++}`;return Ui.set(e,r),r};function Ya(e){const t=new Map;for(const r of e){const n=bd(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),gd(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}const yd=[];function Xa(e,t,r=un,n=yd){var T,v,b,C,B,_,H,Z;const[s,i]=x.useState(null),[a,l]=x.useState(null),c=x.useMemo(()=>Bn(t),[t]),u=((T=r.expand)==null?void 0:T.schemas)===!0,d=(b=(v=r.theme)==null?void 0:v.depthColors)!=null&&b.length?r.theme.depthColors:po,f=((C=r.show)==null?void 0:C.extensions)!==!1,p=((B=r.show)==null?void 0:B.codeSamples)!==!1,h=r.topOffset,g=typeof h=="number"&&Number.isFinite(h)?Math.max(0,h):0,w=((_=r.sidePanel)==null?void 0:_.containment)??"viewport",y=(H=r.sidePanel)==null?void 0:H.topOffset,E=typeof y=="number"&&Number.isFinite(y)?Math.max(0,y):g,N=(Z=r.markdown)==null?void 0:Z.url,j=x.useMemo(()=>{if(typeof N=="function")return N;if(typeof N=="string")return()=>N},[N]),I=x.useMemo(()=>Ya(n),[n]),W=x.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:a,topOffset:g,sidePanelContainment:w,sidePanelTopOffset:E,defaultSchemaExpanded:u,depthColors:d,showExtensions:f,showCodeSamples:p,markdownUrl:j,plugins:n,pluginSlotRegistry:I,config:r}),[e,t,c,s,a,g,w,E,u,d,f,p,j,n,I,r]),G=r.theme?md(r.theme):{};return{contextValue:W,themeVars:G,setPortalHost:i,setRootElement:l}}function Fr({document:e,config:t=un,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Xa("asyncapi",e,t,r);return o.jsx(fn.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"asyncapi-portal-root"}),s]})})}const Za="@lg:mx-auto @lg:max-w-[calc(70ch+28rem)]";function Ot({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?"":Za}`,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 zt(...e){return e.filter(Boolean).join(" ")}function pn({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 xr=(e,t)=>`${e?`${e}-`:""}tab-${t}`,br=(e,t)=>`${e?`${e}-`:""}panel-${t}`;function Vt({tabs:e,current:t,onChange:r=()=>{},ariaLabel:n="Tabs",selectLabel:s="Select a tab",idPrefix:i,placeholder:a,variant:l}){var w;const c=x.useId(),u=x.useRef([]),d=t??(a?"":((w=e[0])==null?void 0:w.id)??""),f=e.some(y=>!!y.icon),p=t?e.findIndex(y=>y.id===t):-1,h=p>=0?p:0,g=(y,E)=>{var I;if(e.length===0)return;const N=W=>(W+e.length)%e.length;let j=E;if(y.key==="ArrowRight"&&(y.preventDefault(),j=N(E+1)),y.key==="ArrowLeft"&&(y.preventDefault(),j=N(E-1)),y.key==="Home"&&(y.preventDefault(),j=0),y.key==="End"&&(y.preventDefault(),j=e.length-1),j!==E){const W=e[j];r(W.id),(I=u.current[j])==null||I.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:zt("@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:y=>r(y.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(y=>o.jsx("option",{value:y.id,children:y.name},y.id))]}),o.jsx(pn,{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:zt("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((y,E)=>{const N=y.id===t;return o.jsx("button",{ref:j=>{u.current[E]=j},id:xr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":br(i,y.id),onClick:()=>r(y.id),onKeyDown:j=>g(j,E),className:zt("h-full flex-1 cursor-pointer rounded-md text-sm font-medium transition-colors",N?"bg-surface text-foreground shadow-sm":"text-foreground-muted hover:text-foreground-secondary"),children:y.name},y.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((y,E)=>{const N=y.id===t,j=y.icon;return o.jsx("button",{ref:I=>{u.current[E]=I},id:xr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":br(i,y.id),onClick:()=>r(y.id),onKeyDown:I=>g(I,E),className:zt("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",N?"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:[j?o.jsx(j,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:y.name})]})},y.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":n,children:e.map((y,E)=>{const N=y.id===t;return o.jsxs("button",{ref:j=>{u.current[E]=j},id:xr(i,y.id),type:"button",role:"tab",tabIndex:E===h?0:-1,"aria-selected":N,"aria-controls":br(i,y.id),onClick:()=>r(y.id),onKeyDown:j=>g(j,E),className:zt(N?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",E===0?"rounded-l-lg":"",E===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:y.name}),o.jsx("span",{"aria-hidden":"true",className:zt(N?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},y.id)})})})]}):null}function wd({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:br(r,s.id),role:"tabpanel","aria-labelledby":xr(r,s.id),hidden:!i,className:i?"flex flex-col gap-6":void 0,children:n(s,i)},s.id)})})}function Qa(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function xo(e){let t=e;for(;t&&t!==document.body;){if(Qa(t))return t;t=t.parentElement}return document.documentElement}function kd(e,t){if(!e||!t||!t.contains(e))return null;let r=e;for(;r;){if(Qa(r))return r;if(r===t)break;r=r.parentElement}return null}function qa(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 el({tabs:e,current:t,onChange:r}){const{rootElement:n,topOffset:s=0}=jt();if(!e.length)return null;const i=typeof document<"u"&&xo(n)===document.documentElement?s:0,a=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(Vt,{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(Ot,{content:a,stickySideContent:!1})})}function vd(e,t){const[r,n]=x.useState("docked"),s=x.useRef(t);return s.current=t,x.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]),x.useEffect(()=>{t&&n(i=>i==="hidden"?"pinned":i)},[t]),r}function bo(e,t){const[r,n]=x.useState(null);return x.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 ir=16,Hi=10,jd=10,Ed=40,Sd=8;function tl({logo:e,children:t,forceVisible:r=!1}){const{rootElement:n,topOffset:s=0}=jt(),i=vd(n,r),a=i!=="docked",l=bo(n,a),c=typeof window>"u"?0:window.innerWidth,u=l?Math.max(l.left,0):0,d=l?Math.min(l.right,c):c,f=s+Hi-jd+Ed+Sd,p={left:a?u+ir:ir,right:a?Math.max(c-d,0)+ir:ir,transform:`translateY(${i==="hidden"?`-${f}px`:"0px"})`,...a?{position:"fixed",top:s+Hi,pointerEvents:i==="hidden"?"none":void 0}:{}};return o.jsx("header",{className:"document-topbar",style:p,"aria-label":"Document toolbar",children:o.jsxs("div",{className:`document-topbar-inner w-full ${Za}`,children:[o.jsx("div",{className:"document-logo",children:e}),o.jsx("div",{className:"document-topbar-controls",children:t})]})})}function nl(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(x.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 Ad(e){return e.map(t=>`\`${t}\``).join(", ")}function zs(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 Nd(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 Wi=360;function Td(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 ${Ar[t++%Ar.length]}`,children:`{${r.value}}`},n))}function $t({address:e,parameters:t,className:r="text-xs",truncate:n=!1,peek:s=!1,padded:i=!0}){const{portalHost:a}=Be(),[l,c]=x.useState(null),[u,d]=x.useState({top:0,left:0,placement:"top"}),[f,p]=x.useState(!1),[h,g]=x.useState(null),w=x.useRef(null),y=x.useId(),E=Nd(e);let N=0;x.useEffect(()=>{if(!n)return;const b=w.current;if(!b)return;const C=()=>p(b.scrollWidth>b.clientWidth);C();const B=new ResizeObserver(C);return B.observe(b),()=>B.disconnect()},[n,e]);const j=(b,C)=>{d(zs(C)),c(b)},I=()=>c(null),W=b=>g(zs(b,{align:"end",width:Wi})),G=()=>g(null),T=E.map((b,C)=>{if(b.type==="text")return o.jsx("span",{children:b.value},C);const B=t==null?void 0:t[b.value],_=Ar[N++%Ar.length],H=l===C,Z=!!B&&(B.description||B.type||B.default||B.enum&&B.enum.length>0||B.examples&&B.examples.length>0),se=`channel-address-tooltip-${C}`,S=Z&&H?se:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:A=>Z&&j(C,A.currentTarget),onMouseLeave:I,children:[o.jsx("span",{className:`font-semibold ${_} ${Z?"cursor-help underline decoration-dotted":""}`,role:Z?"button":void 0,tabIndex:Z?0:void 0,"aria-expanded":Z?H:void 0,"aria-describedby":S,onFocus:A=>Z&&j(C,A.currentTarget),onBlur:I,onKeyDown:A=>{Z&&((A.key==="Enter"||A.key===" ")&&(A.preventDefault(),j(C,A.currentTarget)),A.key==="Escape"&&(A.preventDefault(),I(),A.currentTarget.blur()))},children:`{${b.value}}`}),Z&&H&&a&&an.createPortal(o.jsxs("div",{id:se,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:[B.description&&o.jsx("div",{children:B.description}),B.type&&o.jsx("div",{className:"mt-1",children:o.jsx("code",{children:B.type})}),B.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:B.default})]}),B.enum&&B.enum.length>0&&o.jsx("div",{className:"mt-1",children:nl(B.enum)}),B.examples&&B.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",B.examples.join(", ")]})]}),a)]},C)}),v=i?"px-2 py-1 ":"";return n?o.jsxs("code",{className:`${v}rounded text-foreground-secondary flex items-center min-w-0 ${r}`,children:[o.jsx("span",{ref:w,className:"overflow-hidden whitespace-nowrap min-w-0",children:T}),f&&(s?o.jsx("span",{role:"button",tabIndex:0,"aria-label":"Show full address","aria-expanded":!!h,"aria-describedby":h?y: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:b=>W(b.currentTarget),onMouseLeave:G,onFocus:b=>W(b.currentTarget),onBlur:G,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),b.stopPropagation(),W(b.currentTarget)),b.key==="Escape"&&(b.preventDefault(),G(),b.currentTarget.blur())},children:"…"}):o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"…"})),s&&f&&h&&a&&an.createPortal(o.jsx("div",{id:y,role:"tooltip",style:{top:h.top,left:h.left,width:Wi},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:Td(E)})}),a)]}):o.jsx("code",{className:`${v}rounded text-foreground-secondary break-all ${r}`,children:T})}const _d={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function It({method:e,size:t="sm",className:r=""}){return e?o.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${_d[t]} ${fd[e]} ${r}`,children:e}):null}const Gi=6,Cd=12,$d=8,Id=.7;function Od(e,t){if(e===0)return 1/0;const r=e*Id-$d*2,n=t*Gi+Math.max(0,t-1)*Cd;return Math.max(1,Math.floor((r-n)/Gi))}function Rd(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 Ki=20;function Md({sections:e,activeSection:t,onTabChange:r,onItemSelect:n,selectedItem:s}){const[i,a]=x.useState(!1),[l,c]=x.useState(!1),u=i||l,{rootElement:d,portalHost:f,topOffset:p=0}=Be(),h=x.useRef(null),g=x.useRef(null),w=x.useMemo(()=>e.filter(P=>P.items.length>0),[e]),y=x.useMemo(()=>w.filter(P=>P.isTab===!1||P.id===t),[w,t]),E=x.useMemo(()=>w.filter(P=>P.showInPopover!==!1),[w]),[N,j]=x.useState(null),I=x.useRef(null),W=x.useRef(null),G=x.useCallback((P,X)=>{j({section:P,key:X}),I.current={section:P,key:X},W.current&&clearTimeout(W.current),W.current=setTimeout(()=>{I.current=null},600)},[]);x.useEffect(()=>()=>{W.current&&clearTimeout(W.current)},[]),x.useEffect(()=>{const X=e.filter(K=>K.items.length>0).flatMap(K=>K.items.map(pe=>({section:K.id,key:K.itemKey(pe),id:K.targetId(pe)}))).map(K=>({...K,el:document.getElementById(K.id)})).filter(K=>!!K.el);if(X.length===0)return;const O=new Map(X.map(K=>[K.el,K])),ee=new Map,le=new IntersectionObserver(K=>{for(const xe of K)xe.isIntersecting?ee.set(xe.target,xe.boundingClientRect.top):ee.delete(xe.target);if(ee.size===0)return;let pe=null,we=-1/0;for(const[xe,He]of ee)He>we&&(pe=xe,we=He);const fe=pe&&O.get(pe);if(!fe)return;const Me=I.current;if(Me){if(fe.section!==Me.section||fe.key!==Me.key)return;I.current=null}j({section:fe.section,key:fe.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return X.forEach(K=>le.observe(K.el)),()=>le.disconnect()},[e]);const T=(N==null?void 0:N.section)??t,v=N??s,b=bo(d,!0),C=typeof window>"u"?0:window.innerWidth,B=typeof window>"u"?0:window.innerHeight,_=!!b&&b.bottom>p&&b.top<B,H=Math.max(0,B-p),Z=p+H/2,se=!!b&&b.width<1024,S={opacity:_?1:0,pointerEvents:_?"auto":"none",transition:"opacity 0.2s ease"},A={position:"fixed",top:Z,left:((b==null?void 0:b.left)??0)+Ki,transform:"translateY(-50%)",zIndex:51,...S},F=Math.min((b==null?void 0:b.right)??0,C)-60,J={position:"fixed",bottom:16,left:F,zIndex:51,...S},ae=se?{position:"fixed",bottom:68,right:C-(F+44),zIndex:52}:{position:"fixed",top:Z,left:((b==null?void 0:b.left)??0)+Ki,transform:"translateY(-50%)",maxHeight:`calc(100vh - ${p+32}px)`,zIndex:52};x.useEffect(()=>{if(!i)return;const P=O=>{O.key==="Escape"&&a(!1)},X=O=>{var le,K;const ee=O.target;(le=h.current)!=null&&le.contains(ee)||(K=g.current)!=null&&K.contains(ee)||a(!1)};return document.addEventListener("keydown",P),document.addEventListener("mousedown",X),()=>{document.removeEventListener("keydown",P),document.removeEventListener("mousedown",X)}},[i]);const te=x.useCallback((P,X)=>{P.isTab!==!1&&r(P.id),X&&setTimeout(()=>{var O;(O=document.getElementById(X))==null||O.scrollIntoView({behavior:"smooth",block:"start"})},50)},[r]),Te=x.useMemo(()=>E.map(P=>{const X=T===P.id,O=(v==null?void 0:v.section)===P.id,ee=P.icon;return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>{te(P),G(P.id,""),se&&a(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${X?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(ee,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${X?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${X?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:P.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 ${X?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:P.items.length})]}),P.items.length>0&&o.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:P.items.map(le=>{const K=P.itemKey(le),pe=O&&(v==null?void 0:v.key)===K;return o.jsx("li",{children:o.jsx("button",{onClick:()=>{te(P,P.targetId(le)),n(P.id,K),G(P.id,K),se&&a(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${pe?"bg-primary-50 font-medium text-primary-500":X?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:P.renderItem(le,{isSelected:pe,isSectionActive:X})})},K)})})]},P.id)}),[E,T,v,se,te,n,G]),q=Od(H,y.length),ve=x.useMemo(()=>{const P=Rd(y.map(X=>X.items.length),q);return y.map((X,O)=>{const ee=T===X.id,le=X.items.length,K=P[O];let pe=-1;if((v==null?void 0:v.section)===X.id){const we=X.items.findIndex(fe=>X.itemKey(fe)===v.key);we>=0&&(pe=Math.min(K-1,Math.floor(we*K/le)))}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 ${ee?"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:K},(we,fe)=>o.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${fe===pe?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},fe))})]},X.id)})},[y,T,v,q]);return o.jsxs(o.Fragment,{children:[!se&&o.jsx("button",{ref:h,onClick:()=>a(P=>!P),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:A,children:ve}),se&&o.jsx("button",{ref:h,onClick:()=>a(P=>!P),title:i?"Close navigation":"Open navigation","aria-label":i?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:J,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&&an.createPortal(o.jsx("div",{ref:g,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 ${se?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:ae,children:Te}),f)]})}function rl({sections:e,activeTab:t,onTabChange:r,onItemSelect:n,onSelectServer:s,selectedItem:i}){return o.jsx(Md,{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 yo({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 Ld(e){return o.jsxs(yo,{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 wo({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 sl(e){return{id:"info",label:"Info",icon:Ld,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>o.jsx("span",{className:"truncate",children:"Overview"})}}function ol(e){return{id:"schemas",label:"Schemas",icon:wo,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>o.jsx("span",{className:"truncate",children:t})}}function il({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 zr({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 al({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 ar={};function Pd({operations:e=ar,messages:t=ar,schemas:r=ar,servers:n=ar,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const f=x.useMemo(()=>{const p=h=>{var w;return d!=null&&d.useChannelAddressAsIdentifier?((w=e[h])==null?void 0:w.channel)??null:null};return[sl(s),{id:"servers",label:"Servers",icon:il,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:zr,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var w;const g=p(h);return g!=null&&g.address?o.jsx($t,{address:g.address,parameters:g.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):o.jsxs(o.Fragment,{children:[o.jsx(It,{method:(w=e[h])==null?void 0:w.action,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:al,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>o.jsx("span",{className:"truncate",children:h})},ol(r)]},[e,t,r,n,s,d]);return o.jsx(rl,{sections:f,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Ur=["get","put","post","delete","options","head","patch","trace"],Dd=(e,t)=>`${e} ${t}`;function Vi(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 In(e){return Object.keys(e).sort().flatMap(t=>{const r=e[t];return r?Ur.filter(n=>r[n]).map(n=>({key:Dd(n,t),method:n,path:t})):[]})}function ko({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 Ji={},Bd={},Fd=[];function zd({paths:e=Ji,webhooks:t=Ji,schemas:r=Bd,servers:n=Fd,hasInfo:s=!0,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u}){const d=x.useMemo(()=>In(e),[e]),f=x.useMemo(()=>In(t),[t]),p=x.useMemo(()=>{const h=n.map((g,w)=>({key:`server-${w}`,url:g}));return[sl(s),{id:"servers",label:"Servers",icon:il,isTab:!1,items:h,itemKey:g=>g.key,targetId:g=>g.key,renderItem:g=>o.jsx("span",{className:"truncate",children:g.url})},{id:"endpoints",label:"Endpoints",icon:zr,items:d,itemKey:g=>g.key,targetId:g=>`endpoint-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(It,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx($t,{address:g.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:ko,items:f,itemKey:g=>g.key,targetId:g=>`webhook-${g.key}`,renderItem:g=>o.jsxs(o.Fragment,{children:[o.jsx(It,{method:g.method,size:"xs",className:"shrink-0"}),o.jsx("span",{className:"truncate",children:g.path})]})},ol(r)]},[d,f,r,n,s]);return o.jsx(rl,{sections:p,activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u})}const Ud=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 ll({query:e,onQueryChange:t,results:r,onSelectResult:n,onOpenChange:s}){const i=x.useRef(null),a=x.useRef(null),[l,c]=x.useState(!1),[u,d]=x.useState(-1),f="asyncapi-search-results",p=v=>`asyncapi-search-result-${v}`,{portalHost:h,rootElement:g,topOffset:w=0}=Be(),y=()=>{c(!1),d(-1)};x.useEffect(()=>(s==null||s(l),()=>s==null?void 0:s(!1)),[l,s]);const E=x.useRef(!1),N=x.useRef(!1);x.useEffect(()=>{if(!g)return;const v=()=>{E.current=!0},b=()=>{E.current=!1};return g.addEventListener("mouseenter",v),g.addEventListener("mouseleave",b),()=>{g.removeEventListener("mouseenter",v),g.removeEventListener("mouseleave",b)}},[g]),x.useEffect(()=>{if(!g)return;const v=b=>{N.current=g.contains(b.target)};return document.addEventListener("mousedown",v,!0),()=>document.removeEventListener("mousedown",v,!0)},[g]),x.useEffect(()=>{if(!g)return;const v=b=>{!(b.metaKey||b.ctrlKey)||b.key.toLowerCase()!=="k"||!(g.contains(document.activeElement)||E.current||N.current)||(b.preventDefault(),c(!0))};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[g]),x.useEffect(()=>{if(!l)return;const v=requestAnimationFrame(()=>{var b;return(b=a.current)==null?void 0:b.focus()});return()=>cancelAnimationFrame(v)},[l]),x.useEffect(()=>{if(!(!l||!h))return qa(xo(h))},[l,h]),x.useEffect(()=>{if(!l)return;const v=b=>{b.key==="Escape"&&y()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[l]),x.useEffect(()=>{if(!l)return;const v=b=>{i.current&&!i.current.contains(b.target)&&y()};return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[l]),x.useEffect(()=>{u>=r.length&&d(r.length-1)},[u,r.length]),x.useEffect(()=>{var v;u<0||(v=document.getElementById(p(u)))==null||v.scrollIntoView({block:"nearest"})},[u]);const j=l&&e.trim().length>0,I=v=>{y(),n(v)},W=v=>{if(v.key==="Escape"){v.preventDefault(),y();return}if(j){if(v.key==="ArrowDown"){v.preventDefault(),d(b=>r.length===0?-1:Math.min(b+1,r.length-1));return}if(v.key==="ArrowUp"){v.preventDefault(),d(b=>r.length===0?-1:Math.max(b-1,0));return}if(v.key==="Home"){v.preventDefault(),r.length>0&&d(0);return}if(v.key==="End"){v.preventDefault(),r.length>0&&d(r.length-1);return}if((v.key==="Enter"||v.key===" ")&&u>=0&&r[u]){v.preventDefault(),I(r[u]);return}}},G=j?`${r.length} result${r.length===1?"":"s"} found`:"",T=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(Ud,{})}),l&&h&&an.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",style:{top:w},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:v=>t(v.target.value),onKeyDown:W,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":j,"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:G}),j&&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((v,b)=>o.jsx("li",{children:o.jsxs("button",{id:p(b),type:"button",role:"option","aria-selected":u===b,onClick:()=>I(v),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(u===b?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:v.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:v.location}),v.subtitle&&o.jsxs("span",{children:["• ",v.subtitle]})]})]})},v.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:T?"⌘ 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 cl({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 ul({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 Hr({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 Hd=["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 dl(e){return`${["> ## Agent Instructions",...Hd.map(r=>`> ${r}`)].join(`
4
4
  `)}
5
5
 
6
- ${e.trimStart()}`}function ul({serialize:e,onOpenChange:t}){const[r,n]=x.useState(!1),[s,i]=x.useState(!1),a=x.useRef(null),l=x.useRef(void 0),{deref:c}=Be(),u=()=>cl(e(c));x.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),x.useEffect(()=>(t==null||t(r),()=>t==null?void 0:t(!1)),[r,t]),x.useEffect(()=>{if(!r)return;const p=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),x.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"}),g=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:g}),window.open(g,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(g),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(ll,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(al,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(dn,{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(Kr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const yt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),vr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(r=>vr(r,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([r,n])=>[r,vr(n,t)]).join(" "):yt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([r,n])=>[r,vr(n,t)]).join(" ")):"",Ve=e=>vr(e).trim().replace(/\s+/g," "),Ud=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Hd=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Wd=e=>{if(!yt(e))return e;const t={};for(const[r,n]of Object.entries(e))Hd.has(r)||(t[r]=n);return t},dl=(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=yt(l)?l.description:void 0,g=c.length?`${n}.${c.join(".")}`:n;e.push({id:`schema-${r}-${c.join("-")||"root"}`,targetId:d?Ud(r,d):s,type:"schema",tab:"schemas",key:r,name:g,path:f,location:p,subtitle:h,text:Ve([Wd(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!yt(l)||f.has(l))return;if(f.add(l),yt(l.properties))for(const[h,g]of Object.entries(l.properties))a(g,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null,f);const p=l.items;yt(p)?a(p,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,f):Array.isArray(p)&&p.forEach((h,g)=>{a(h,[...c,`items[${g}]`],[...u,`items[${g}]`],null,f)});for(const h of["allOf","oneOf","anyOf"]){const g=l[h];Array.isArray(g)&&g.forEach((w,y)=>{a(w,[...c,`${h}[${y}]`],[...u,`${h}[${y}]`],d&&h!=="allOf"?[...d,`${h}[${y}]`]:null,f)})}yt(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function Gd(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:Ve([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:Ve([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:Ve(u)});const d=a.bindings,f=yt(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:Ve(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:Ve([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:Ve(c)});const u=i.bindings;if(yt(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:Ve(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:Ve([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:Ve(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:Ve(i.headers)})}if((n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))dl(t,i,s,s);return t}function Rt(e){return Array.isArray?Array.isArray(e):pl(e)==="[object Array]"}function Kd(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 Fs(e){return e==null?"":Kd(e)}function De(e){return typeof e=="string"}function jr(e){return typeof e=="number"}function Vd(e){return e===!0||e===!1||Jd(e)&&pl(e)=="[object Boolean]"}function fl(e){return typeof e=="object"}function Jd(e){return fl(e)&&e!==null}function Qe(e){return e!=null}function dr(e){return!e.trim().length}function pl(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Yd="Incorrect 'index' type",zs="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Xd=e=>`Invalid value for key ${e}`,Zd=e=>`Pattern length exceeds max of ${e}.`,Qd=e=>`Missing ${e} property in key`,qd=e=>`Property 'weight' in key '${e}' must be a positive integer`,ef="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.",Vi=Object.prototype.hasOwnProperty;var tf=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=hl(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 hl(e){let t=null,r=null,n=null,s=1,i=null;if(De(e)||Rt(e))n=e,t=Ji(e),r=Er(e);else{if(!Vi.call(e,"name"))throw new Error(Qd("name"));const a=e.name;if(n=a,Vi.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(qd(Er(a)));t=Ji(a),r=Er(a),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function Ji(e){return Rt(e)?e:e.split(".")}function Er(e){return Rt(e)?e.join("."):e}function nf(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Qe(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Qe(u))return;if(l===a.length-1&&(De(u)||jr(u)||Vd(u)||typeof u=="bigint"))r.push(c!==void 0?{v:Fs(u),i:c}:Fs(u));else if(Rt(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,De(t)?t.split("."):t,0),n?r:r[0]}const rf={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},sf={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},of={location:0,threshold:.6,distance:100},af={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:nf,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},re=Object.freeze({...sf,...rf,...of,...af});function lf(e){return e>=9&&e<=13||e===32||e===160}function cf(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++)lf(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 ko=class{constructor({getFn:e=re.getFn,fieldNormWeight:t=re.fieldNormWeight}={}){this.norm=cf(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(De(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(zs);if(De(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(zs);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!Qe(e)||dr(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(Qe(a)){if(Rt(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Qe(d)){if(De(d)){if(!dr(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Qe(d.v)){const f=De(d.v)?d.v:Fs(d.v);if(!dr(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}r.$[n]=l}else if(De(a)&&!dr(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 ml(e,t,{getFn:r=re.getFn,fieldNormWeight:n=re.fieldNormWeight}={}){const s=new ko({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(hl)),s.setSources(t),s.create(),s}function uf(e,{getFn:t=re.getFn,fieldNormWeight:r=re.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new ko({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function df(e=[],t=re.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 ff(e,t,r,{location:n=re.location,distance:s=re.distance,threshold:i=re.threshold,findAllMatches:a=re.findAllMatches,minMatchCharLength:l=re.minMatchCharLength,includeMatches:c=re.includeMatches,ignoreLocation:u=re.ignoreLocation}={}){if(t.length>32)throw new Error(Zd(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=i,g=p;const w=(b,C)=>{const B=b/d;if(u)return B;const _=Math.abs(p-C);return s?B+_/s:_?1:B},y=l>1||c,E=y?Array(f):[];let N;for(;(N=e.indexOf(t,g))>-1;){const b=w(0,N);if(h=Math.min(b,h),g=N+d,y){let C=0;for(;C<d;)E[N+C]=1,C+=1}}g=-1;let j=[],I=1,W=0,G=d+f;const T=1<<d-1;for(let b=0;b<d;b+=1){let C=0,B=G;for(;C<B;)w(b,p+B)<=h?C=B:G=B,B=Math.floor((G-C)/2+C);G=B;let _=Math.max(1,p-B+1);const H=a?f:Math.min(p+B,f)+d,Z=Array(H+2);Z[H+1]=(1<<b)-1;for(let se=H;se>=_;se-=1){const S=se-1,A=r[e[S]];if(Z[se]=(Z[se+1]<<1|1)&A,b&&(Z[se]|=(j[se+1]|j[se])<<1|1|j[se+1]),Z[se]&T&&(I=w(b,S),I<=h)){if(h=I,g=S,W=b,g<=p)break;_=Math.max(1,2*p-g)}}if(w(b+1,p)>h)break;j=Z}if(y&&g>=0){const b=Math.min(f-1,g+d-1+W);for(let C=g;C<=b;C+=1)r[e[C]]&&(E[C]=1)}const v={isMatch:g>=0,score:Math.max(.001,I)};if(y){const b=df(E,l);b.length?c&&(v.indices=b):v.isMatch=!1}return v}function pf(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 vo(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 gl={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},hf=new RegExp("["+Object.keys(gl).join("")+"]","g"),$n=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(hf,t=>gl[t]):e=>e;var jo=class{constructor(e,{location:t=re.location,threshold:r=re.threshold,distance:n=re.distance,includeMatches:s=re.includeMatches,findAllMatches:i=re.findAllMatches,minMatchCharLength:a=re.minMatchCharLength,isCaseSensitive:l=re.isCaseSensitive,ignoreDiacritics:c=re.ignoreDiacritics,ignoreLocation:u=re.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?$n(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:pf(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,g=f-h;for(;p<g;)d(this.pattern.substr(p,32),p),p+=32;if(h){const w=f-32;d(this.pattern.substr(w),w)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?$n(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return n&&(g.indices=[[0,e.length-1]]),g}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:g,alphabet:w,startIndex:y})=>{const{isMatch:E,score:N,indices:j}=ff(e,g,w,{location:s+y,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:n,ignoreLocation:u});E&&(p=!0),f+=N,E&&j&&d.push(...j)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&n&&(h.indices=vo(d)),h}};const mf=new Set(["fuzzy","include"]);function gf(e){return e.startsWith("inverse")}const Us=[{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 jo(e,{location:t.location??re.location,threshold:t.threshold??re.threshold,distance:t.distance??re.distance,includeMatches:t.includeMatches??re.includeMatches,findAllMatches:t.findAllMatches??re.findAllMatches,minMatchCharLength:t.minMatchCharLength??re.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??re.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??re.ignoreDiacritics,ignoreLocation:t.ignoreLocation??re.ignoreLocation});return{type:"fuzzy",search(n){return r.searchIn(n)}}}}],Yi=Us.length,xf="\0",bf="|";function yf(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 Xi(e,t){const r=e.match(t);return r?r[1]:null}function wf(e,t={}){return e.replace(/\\\|/g,xf).split(bf).map(r=>{const n=yf(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<Yi;){const d=Us[u],f=Xi(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Yi;){const d=Us[u],f=Xi(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var kf=class{constructor(e,{isCaseSensitive:t=re.isCaseSensitive,ignoreDiacritics:r=re.ignoreDiacritics,includeMatches:n=re.includeMatches,minMatchCharLength:s=re.minMatchCharLength,ignoreLocation:i=re.ignoreLocation,findAllMatches:a=re.findAllMatches,location:l=re.location,threshold:c=re.threshold,distance:u=re.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?$n(e):e,this.pattern=e,this.query=wf(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?$n(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 g=f[p],{isMatch:w,indices:y,score:E}=g.search(e);if(w)i+=1,l+=E,gf(g.type)&&(c=!0),r&&(mf.has(g.type)?a.push(...y):a.push(y));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=vo(a)),p}}return{isMatch:!1,score:1}}};const Hs=[];function Eo(...e){Hs.push(...e)}function Cr(e,t){for(let r=0,n=Hs.length;r<n;r+=1){const s=Hs[r];if(s.condition(e,t))return new s(e,t)}return new jo(e,t)}const $r={AND:"$and",OR:"$or"},Ws={PATH:"$path",PATTERN:"$val"},Gs=e=>!!(e[$r.AND]||e[$r.OR]),vf=e=>!!e[Ws.PATH],jf=e=>!Rt(e)&&fl(e)&&!Gs(e),Zi=e=>({[$r.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function xl(e,t,{auto:r=!0}={}){const n=s=>{if(De(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=Cr(s,t)),c}const i=Object.keys(s),a=vf(s);if(!a&&i.length>1&&!Gs(s))return n(Zi(s));if(jf(s)){const c=a?s[Ws.PATH]:i[0],u=a?s[Ws.PATTERN]:s[c];if(!De(u))throw new Error(Xd(c));const d={keyId:Er(c),pattern:u};return r&&(d.searcher=Cr(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];Rt(u)&&u.forEach(d=>{l.children.push(n(d))})}),l};return Gs(e)||(e=Zi(e)),n(e)}function Ks(e,{ignoreFieldNorm:t=re.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 Ef(e,{ignoreFieldNorm:t=re.ignoreFieldNorm}){e.forEach(r=>{r.score=Ks(r.matches,{ignoreFieldNorm:t})})}var Sf=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 Af(e){const t=[];return e.matches.forEach(r=>{if(!Qe(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 Nf(e,t,{includeMatches:r=re.includeMatches,includeScore:n=re.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return r&&(a.matches=Af(s)),n&&(a.score=s.score),a})}const Tf=/[\p{L}\p{M}\p{N}_]+/gu,Qi=new WeakSet;function _f(e){Qi.has(e)||(Qi.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 Cf(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||_f(e),t=>t.match(e)||[]):t=>t.match(Tf)||[]}function Vs({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=Cf(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=$n(s)),n(s)}}}var $f=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Vs({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 jo(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=vo(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Es(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 bl(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Es(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)Es(e,u.v,s,n);else Es(e,c.v,s,n)}}function If(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)bl(n,s,t,r);return n}function Of(e,t,r,n){bl(e,t,r,n)}function Rf(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 qi(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of r)Rf(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 Mt=class{constructor(e,t,r){this.options={...re,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new tf(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=Cr(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 ko))throw new Error(Yd);if(this._myIndex=t||ml(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Vs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=If(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Qe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=Vs({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Of(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&&qi(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(zs);this._invertedIndex&&qi(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(De(e)&&!e.trim()){let p=this._docs.map((h,g)=>({item:h,refIndex:g}));return jr(r)&&r>-1&&(p=p.slice(0,r)),p}const c=i&&jr(r)&&r>0&&De(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Sf(r,d);De(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=De(e)?De(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Ef(f,{ignoreFieldNorm:l}),i&&f.sort(De(e)?d:u),jr(r)&&r>-1&&(f=f.slice(0,r));return Nf(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(!Qe(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=Ks(h.matches,{ignoreFieldNorm:r}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=xl(e,this.options),r=this._normalizedKeys(),n=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:g}=l;let w;return h===null?(w=[],r.forEach((y,E)=>{w.push(...this._findMatches({key:y,value:c[E],searcher:g}))})):w=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:g}),w&&w.length?[{idx:u,item:c,matches:w}]:[]}const{children:d,operator:f}=l,p=[];for(let h=0,g=d.length;h<g;h+=1){const w=d[h],y=n(w,c,u);if(y.length)p.push(...y);else if(f===$r.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Qe(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(!Qe(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,g)=>{const w=this._findMatches({key:h,value:c[g],searcher:n});w.length?(d.push(...w),w[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=Ks(h.matches,{ignoreFieldNorm:r}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:r}){if(!Qe(t))return[];const n=[];if(Rt(t))t.forEach(({v:s,i,n:a})=>{if(!Qe(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}};Mt.version="7.5.0";Mt.createIndex=ml;Mt.parseIndex=uf;Mt.config=re;Mt.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(ef);return Cr(e,{...re,...r}).searchIn(t)};Mt.parseQuery=xl;Eo(kf);Eo($f);Mt.use=function(...e){e.forEach(t=>Eo(t))};var Mf=Mt;function yl(e,t,r={}){const[n,s]=x.useState(""),[i,a]=x.useState(""),l=r.debounceMs??150;x.useEffect(()=>{const f=setTimeout(()=>a(n),l);return()=>clearTimeout(f)},[n,l]);const c=x.useMemo(()=>t(e),[e,t]),u=x.useMemo(()=>new Mf(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:r.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,r.threshold]),d=x.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 Lf(e,t={}){return yl(e,Gd,t)}const Js="search-match",wl=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Pf(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 Df(e,t){if(!wl())return;const r=Pf(e,t);if(!r.length){CSS.highlights.delete(Js);return}CSS.highlights.set(Js,new Highlight(...r))}function Ss(){wl()&&CSS.highlights.delete(Js)}function Bf(e,t){const r=x.useRef(null);x.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&&Df(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function kl({tabs:e,defaultTab:t,isTabKey:r,sections:n,searchQuery:s}){var B;const i=((B=e[0])==null?void 0:B.id)??t,[a,l]=x.useState(i),[c,u]=x.useState(null),d=_=>{l(_),u(_)},[f,p]=x.useState({}),h=e.some(_=>_.id===a)?a:i,g={};for(const _ of n)g[_.id]=_.visible?f[_.id]??null:null;const w=(_,H)=>p(Z=>({...Z,[_]:H})),[y,E]=x.useState(null),[N,j]=x.useState(null),[I,W]=x.useState(null),G=_=>{r(_.tab)?d(_.tab):_.tab==="servers"&&u("servers");const H={};for(const Z of n)H[Z.id]=Z.id===_.tab?_.key:null;p(H),E(_.focusSection??null),j(_.tab==="schemas"&&_.schemaFocusTokens?{tokens:_.schemaFocusTokens,id:_.targetId}:null),_.tab==="schemas"&&Ss(),W({targetId:_.targetId,query:s,highlight:_.tab!=="schemas"})},T=(_,H)=>{d(_),p(Z=>{const se={...Z};for(const S of n)S.id!=="servers"&&(se[S.id]=S.id===_?H:null);return se})},v=_=>{u("servers");const H={};for(const Z of n)H[Z.id]=Z.id==="servers"?_:null;p(H)},b=_=>{r(_)&&d(_)},C=(()=>{for(const _ of n){const H=g[_.id];if(H)return{tab:_.id,key:H}}return null})();return Bf(I,[h,y,N,...n.map(_=>g[_.id])]),x.useEffect(()=>{s.trim()||(W(null),Ss())},[s]),x.useEffect(()=>Ss,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:g,setSelectedKey:w,selectedNavItem:C,handleSearchSelect:G,handleNavItemSelect:T,handleNavServerSelect:v,handleContentTabChange:b,focusSection:y,schemaFocusTarget:N}}const ie=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),xt=e=>ie(e)?e:null,ea="^[\0-ÿ]*$",Ff=Math.pow(-2,31),zf=Math.pow(2,31)-1,Uf=Math.pow(-2,63),Hf=Math.pow(2,63)-1,Wf={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"},So=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function In(e){const t=So(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Ys(e,t,r){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const n=In(e);n!==void 0&&r[n]&&(t["x-parser-schema-id"]=n)}function ta(e,t,r){!(Array.isArray(e.type)&&e.type.includes("null"))&&!r&&(t.required=t.required||[],t.required.push(e.name))}function Gf(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 Kf(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 Xs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Zs(e,t,r){const{type:n,jsonSchema:s}=Gf(e,r);Kf(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 Ao(e,t,r){t!==void 0&&(e[t]=r)}function On(e,t){let r={};if(Array.isArray(e))return Jf(r,e,t);const n=So(e),s=typeof e=="string"?e:n.type;switch(r.type=Wf[s],s){case"int":{r.minimum=Ff,r.maximum=zf;break}case"long":{r.minimum=Uf,r.maximum=Hf;break}case"bytes":{r.pattern=ea;break}case"fixed":{r.pattern=ea,r.minLength=n.size,r.maxLength=n.size;break}case"map":{r.additionalProperties=On(n.values,t);break}case"array":{r.items=On(n.items,t);break}case"enum":{r.enum=n.symbols;break}case"float":case"double":{r.format=s;break}case"record":{const i=Vf(n,t,r);Ao(t,In(e),r),r.properties=Object.fromEntries(i.entries());break}default:{const i=t[In(e)]??(typeof s=="string"?t[s]:void 0);i&&(r=Xs(n)?{...i}:i);break}}return Ys(n,r,t),Zs(s,n,r),r}function Vf(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=Xs(s)?{...i}:i;ta(s,r,s.default!==void 0),Xs(s)&&(Ys(s,a,t),Zs(s.type,s,a)),n.set(s.name,a)}else{const a=On(s.type,t);ta(s,r,s.default!==void 0),Ys(s,a,t),Zs(s.type,s,a),n.set(s.name,a),Ao(t,In(s.type),a)}}return n}function Jf(e,t,r){const n=[];let s=null;for(const i of t){const a=On(i,r);(typeof i=="string"?i:So(i).type)==="null"?s=a:(n.push(a),Ao(r,In(i),a))}return s&&n.push(s),e.oneOf=n,e}function Qs(e){return On(e,{})}const na=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Yf=new Set(["record","enum","array","map","fixed"]),ra=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function No(e){const t=[];return rn(e,"schema",t,new Set),t}function rn(e,t,r,n){if(typeof e=="string"){!na.has(e)&&!ra.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)=>rn(i,`${t}[${a}]`,r,n));return}if(!ie(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)||ie(s)?rn(s,`${t}.type`,r,n):r.push(`${t}: missing "type"`);return}if(!na.has(s)&&!Yf.has(s)&&!ra.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(!ie(i)||typeof i.name!="string"){r.push(`${l}: field must have a string "name"`);return}rn(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"`):rn(e.items,`${t}.items`,r,n);break}case"map":{e.values===void 0?r.push(`${t}: map must have "values"`):rn(e.values,`${t}.values`,r,n);break}case"fixed":{typeof e.size!="number"&&r.push(`${t}: fixed must have a numeric "size"`);break}}}let Ir=null,As=null;const qs=new Set;function Xf(){return As||(As=Promise.resolve().then(()=>require("./protoToJsonSchema-DJXdCExT.cjs")).then(e=>{Ir=e.protoToJsonSchema,qs.forEach(t=>t())})),As}function Zf(){return Ir||Xf(),Ir}function Qf(e){return qs.add(e),()=>qs.delete(e)}function sa(){return Ir!==null}function To(){return x.useSyncExternalStore(Qf,sa,sa)}const qf="x-parser-original-payload",Or="x-lib-conversion-error",ep=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,tp=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Bn(e){return typeof e=="string"&&ep.test(e)}function Fn(e){return typeof e=="string"&&tp.test(e)}function vl(e){return ie(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function jl(e){var t,r;if(typeof e!="string")return null;if(Bn(e)){const n=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return n?`avro ${n}`:"avro"}if(Fn(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 El(e){return Bn(e)?"Avro":Fn(e)?"Protobuf":null}function np(e,t){return t?!1:!e||Bn(e)||Fn(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const rp=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],sp=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function op(e){return typeof e=="string"||Array.isArray(e)?!0:ie(e)?typeof e.type=="string"&&sp.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!rp.some(t=>t in e):!1}function Rn(e,t){let r=e;if(t&&ie(r)&&typeof r.$ref=="string"){const a=t(r.$ref);a!==void 0&&(r=a)}const n=ip(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=vl(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function ip(e){var a;if(!vl(e))return{schema:xt(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[qf],s=(a=xt(r))==null?void 0:a[Or];if(typeof s=="string")return{schema:xt(n)??{},schemaFormat:t,originalSchema:n,conversionError:s};if(n!==void 0)return{schema:xt(r)??{},schemaFormat:t,originalSchema:n};if(Bn(t)&&op(r)){const l=No(r);if(l.length>0)return{schema:xt(r)??{},schemaFormat:t,originalSchema:r,conversionError:l[0]};try{return{schema:Qs(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:xt(r)??{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Fn(t)&&typeof r=="string"){const l=Zf();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=xt(r);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:r}}const Ie=(e,t)=>`${"#".repeat(e)} ${t}`,z=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),vn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ap={objects:new Set,refs:new Set};function Sr(e,t,r=ap){if(e===null||typeof e!="object")return e;if(r.objects.has(e)||vn(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const i=vn(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:vn(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(i=>Sr(i,t,n));if(vn(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return vn(i)||Array.isArray(i)?Sr(i,t,n):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=Sr(a,t,n);return s}function Rr(e,t,r){if(!t)return"";const n=Sr(t,r);return`${Ie(4,`\`${z(e)}\``)}
6
+ ${e.trimStart()}`}function fl({serialize:e,onOpenChange:t}){const[r,n]=x.useState(!1),[s,i]=x.useState(!1),a=x.useRef(null),l=x.useRef(void 0),{deref:c}=Be(),u=()=>dl(e(c));x.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),x.useEffect(()=>(t==null||t(r),()=>t==null?void 0:t(!1)),[r,t]),x.useEffect(()=>{if(!r)return;const p=h=>{h.key==="Escape"&&n(!1)};return document.addEventListener("keydown",p),()=>document.removeEventListener("keydown",p)},[r]),x.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"}),g=URL.createObjectURL(h);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:p.length,blobUrl:g}),window.open(g,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(g),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(ul,{className:"w-4 h-4 shrink-0 text-green-600"}):o.jsx(cl,{className:"w-4 h-4 shrink-0"}),o.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),o.jsx(pn,{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(Hr,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]})]})}const yt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),yr=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(r=>yr(r,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([r,n])=>[r,yr(n,t)]).join(" "):yt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([r,n])=>[r,yr(n,t)]).join(" ")):"",Ve=e=>yr(e).trim().replace(/\s+/g," "),Wd=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Gd=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Kd=e=>{if(!yt(e))return e;const t={};for(const[r,n]of Object.entries(e))Gd.has(r)||(t[r]=n);return t},pl=(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=yt(l)?l.description:void 0,g=c.length?`${n}.${c.join(".")}`:n;e.push({id:`schema-${r}-${c.join("-")||"root"}`,targetId:d?Wd(r,d):s,type:"schema",tab:"schemas",key:r,name:g,path:f,location:p,subtitle:h,text:Ve([Kd(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[],f=new Set)=>{if(i(l,c,u,d),!yt(l)||f.has(l))return;if(f.add(l),yt(l.properties))for(const[h,g]of Object.entries(l.properties))a(g,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null,f);const p=l.items;yt(p)?a(p,[...c,"items"],[...u,"items"],d?[...d,"items"]:null,f):Array.isArray(p)&&p.forEach((h,g)=>{a(h,[...c,`items[${g}]`],[...u,`items[${g}]`],null,f)});for(const h of["allOf","oneOf","anyOf"]){const g=l[h];Array.isArray(g)&&g.forEach((w,y)=>{a(w,[...c,`${h}[${y}]`],[...u,`${h}[${y}]`],d&&h!=="allOf"?[...d,`${h}[${y}]`]:null,f)})}yt(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,f)};a(t)};function Vd(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:Ve([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:Ve([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:Ve(u)});const d=a.bindings,f=yt(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:Ve(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:Ve([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:Ve(c)});const u=i.bindings;if(yt(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:Ve(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:Ve([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:Ve(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:Ve(i.headers)})}if((n=e.components)!=null&&n.schemas)for(const[s,i]of Object.entries(e.components.schemas))pl(t,i,s,s);return t}function Rt(e){return Array.isArray?Array.isArray(e):ml(e)==="[object Array]"}function Jd(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 Us(e){return e==null?"":Jd(e)}function De(e){return typeof e=="string"}function wr(e){return typeof e=="number"}function Yd(e){return e===!0||e===!1||Xd(e)&&ml(e)=="[object Boolean]"}function hl(e){return typeof e=="object"}function Xd(e){return hl(e)&&e!==null}function Qe(e){return e!=null}function lr(e){return!e.trim().length}function ml(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Zd="Incorrect 'index' type",Hs="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Qd=e=>`Invalid value for key ${e}`,qd=e=>`Pattern length exceeds max of ${e}.`,ef=e=>`Missing ${e} property in key`,tf=e=>`Property 'weight' in key '${e}' must be a positive integer`,nf="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.",Yi=Object.prototype.hasOwnProperty;var rf=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(r=>{const n=gl(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 gl(e){let t=null,r=null,n=null,s=1,i=null;if(De(e)||Rt(e))n=e,t=Xi(e),r=kr(e);else{if(!Yi.call(e,"name"))throw new Error(ef("name"));const a=e.name;if(n=a,Yi.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(tf(kr(a)));t=Xi(a),r=kr(a),i=e.getFn??null}return{path:t,id:r,weight:s,src:n,getFn:i}}function Xi(e){return Rt(e)?e:e.split(".")}function kr(e){return Rt(e)?e.join("."):e}function sf(e,t){const r=[];let n=!1;const s=(i,a,l,c)=>{if(Qe(i))if(!a[l])r.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!Qe(u))return;if(l===a.length-1&&(De(u)||wr(u)||Yd(u)||typeof u=="bigint"))r.push(c!==void 0?{v:Us(u),i:c}:Us(u));else if(Rt(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,De(t)?t.split("."):t,0),n?r:r[0]}const of={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},af={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},lf={location:0,threshold:.6,distance:100},cf={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:sf,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},re=Object.freeze({...af,...of,...lf,...cf});function uf(e){return e>=9&&e<=13||e===32||e===160}function df(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++)uf(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 vo=class{constructor({getFn:e=re.getFn,fieldNormWeight:t=re.fieldNormWeight}={}){this.norm=df(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(De(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(Hs);if(De(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(Hs);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!Qe(e)||lr(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(Qe(a)){if(Rt(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(Qe(d)){if(De(d)){if(!lr(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(Qe(d.v)){const f=De(d.v)?d.v:Us(d.v);if(!lr(f)){const p={v:f,i:d.i,n:this.norm.get(f)};l.push(p)}}}}r.$[n]=l}else if(De(a)&&!lr(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 xl(e,t,{getFn:r=re.getFn,fieldNormWeight:n=re.fieldNormWeight}={}){const s=new vo({getFn:r,fieldNormWeight:n});return s.setKeys(e.map(gl)),s.setSources(t),s.create(),s}function ff(e,{getFn:t=re.getFn,fieldNormWeight:r=re.fieldNormWeight}={}){const{keys:n,records:s}=e,i=new vo({getFn:t,fieldNormWeight:r});return i.setKeys(n),i.setIndexRecords(s),i}function pf(e=[],t=re.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 hf(e,t,r,{location:n=re.location,distance:s=re.distance,threshold:i=re.threshold,findAllMatches:a=re.findAllMatches,minMatchCharLength:l=re.minMatchCharLength,includeMatches:c=re.includeMatches,ignoreLocation:u=re.ignoreLocation}={}){if(t.length>32)throw new Error(qd(32));const d=t.length,f=e.length,p=Math.max(0,Math.min(n,f));let h=i,g=p;const w=(b,C)=>{const B=b/d;if(u)return B;const _=Math.abs(p-C);return s?B+_/s:_?1:B},y=l>1||c,E=y?Array(f):[];let N;for(;(N=e.indexOf(t,g))>-1;){const b=w(0,N);if(h=Math.min(b,h),g=N+d,y){let C=0;for(;C<d;)E[N+C]=1,C+=1}}g=-1;let j=[],I=1,W=0,G=d+f;const T=1<<d-1;for(let b=0;b<d;b+=1){let C=0,B=G;for(;C<B;)w(b,p+B)<=h?C=B:G=B,B=Math.floor((G-C)/2+C);G=B;let _=Math.max(1,p-B+1);const H=a?f:Math.min(p+B,f)+d,Z=Array(H+2);Z[H+1]=(1<<b)-1;for(let se=H;se>=_;se-=1){const S=se-1,A=r[e[S]];if(Z[se]=(Z[se+1]<<1|1)&A,b&&(Z[se]|=(j[se+1]|j[se])<<1|1|j[se+1]),Z[se]&T&&(I=w(b,S),I<=h)){if(h=I,g=S,W=b,g<=p)break;_=Math.max(1,2*p-g)}}if(w(b+1,p)>h)break;j=Z}if(y&&g>=0){const b=Math.min(f-1,g+d-1+W);for(let C=g;C<=b;C+=1)r[e[C]]&&(E[C]=1)}const v={isMatch:g>=0,score:Math.max(.001,I)};if(y){const b=pf(E,l);b.length?c&&(v.indices=b):v.isMatch=!1}return v}function mf(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 jo(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 bl={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},gf=new RegExp("["+Object.keys(bl).join("")+"]","g"),On=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(gf,t=>bl[t]):e=>e;var Eo=class{constructor(e,{location:t=re.location,threshold:r=re.threshold,distance:n=re.distance,includeMatches:s=re.includeMatches,findAllMatches:i=re.findAllMatches,minMatchCharLength:a=re.minMatchCharLength,isCaseSensitive:l=re.isCaseSensitive,ignoreDiacritics:c=re.ignoreDiacritics,ignoreLocation:u=re.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?On(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(p,h)=>{this.chunks.push({pattern:p,alphabet:mf(p),startIndex:h})},f=this.pattern.length;if(f>32){let p=0;const h=f%32,g=f-h;for(;p<g;)d(this.pattern.substr(p,32),p),p+=32;if(h){const w=f-32;d(this.pattern.substr(w),w)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:r,includeMatches:n}=this.options;if(e=t?e:e.toLowerCase(),e=r?On(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const g={isMatch:!0,score:0};return n&&(g.indices=[[0,e.length-1]]),g}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:g,alphabet:w,startIndex:y})=>{const{isMatch:E,score:N,indices:j}=hf(e,g,w,{location:s+y,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:n,ignoreLocation:u});E&&(p=!0),f+=N,E&&j&&d.push(...j)});const h={isMatch:p,score:p?f/this.chunks.length:1};return p&&n&&(h.indices=jo(d)),h}};const xf=new Set(["fuzzy","include"]);function bf(e){return e.startsWith("inverse")}const Ws=[{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 Eo(e,{location:t.location??re.location,threshold:t.threshold??re.threshold,distance:t.distance??re.distance,includeMatches:t.includeMatches??re.includeMatches,findAllMatches:t.findAllMatches??re.findAllMatches,minMatchCharLength:t.minMatchCharLength??re.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??re.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??re.ignoreDiacritics,ignoreLocation:t.ignoreLocation??re.ignoreLocation});return{type:"fuzzy",search(n){return r.searchIn(n)}}}}],Zi=Ws.length,yf="\0",wf="|";function kf(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 Qi(e,t){const r=e.match(t);return r?r[1]:null}function vf(e,t={}){return e.replace(/\\\|/g,yf).split(wf).map(r=>{const n=kf(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<Zi;){const d=Ws[u],f=Qi(l,d.multiRegex);f&&(s.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Zi;){const d=Ws[u],f=Qi(l,d.singleRegex);if(f){s.push(d.create(f,t));break}}}return s})}var jf=class{constructor(e,{isCaseSensitive:t=re.isCaseSensitive,ignoreDiacritics:r=re.ignoreDiacritics,includeMatches:n=re.includeMatches,minMatchCharLength:s=re.minMatchCharLength,ignoreLocation:i=re.ignoreLocation,findAllMatches:a=re.findAllMatches,location:l=re.location,threshold:c=re.threshold,distance:u=re.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?On(e):e,this.pattern=e,this.query=vf(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?On(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 g=f[p],{isMatch:w,indices:y,score:E}=g.search(e);if(w)i+=1,l+=E,bf(g.type)&&(c=!0),r&&(xf.has(g.type)?a.push(...y):a.push(y));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=jo(a)),p}}return{isMatch:!1,score:1}}};const Gs=[];function So(...e){Gs.push(...e)}function Nr(e,t){for(let r=0,n=Gs.length;r<n;r+=1){const s=Gs[r];if(s.condition(e,t))return new s(e,t)}return new Eo(e,t)}const Tr={AND:"$and",OR:"$or"},Ks={PATH:"$path",PATTERN:"$val"},Vs=e=>!!(e[Tr.AND]||e[Tr.OR]),Ef=e=>!!e[Ks.PATH],Sf=e=>!Rt(e)&&hl(e)&&!Vs(e),qi=e=>({[Tr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function yl(e,t,{auto:r=!0}={}){const n=s=>{if(De(s)){const c={keyId:null,pattern:s};return r&&(c.searcher=Nr(s,t)),c}const i=Object.keys(s),a=Ef(s);if(!a&&i.length>1&&!Vs(s))return n(qi(s));if(Sf(s)){const c=a?s[Ks.PATH]:i[0],u=a?s[Ks.PATTERN]:s[c];if(!De(u))throw new Error(Qd(c));const d={keyId:kr(c),pattern:u};return r&&(d.searcher=Nr(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=s[c];Rt(u)&&u.forEach(d=>{l.children.push(n(d))})}),l};return Vs(e)||(e=qi(e)),n(e)}function Js(e,{ignoreFieldNorm:t=re.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 Af(e,{ignoreFieldNorm:t=re.ignoreFieldNorm}){e.forEach(r=>{r.score=Js(r.matches,{ignoreFieldNorm:t})})}var Nf=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 Tf(e){const t=[];return e.matches.forEach(r=>{if(!Qe(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 _f(e,t,{includeMatches:r=re.includeMatches,includeScore:n=re.includeScore}={}){return e.map(s=>{const{idx:i}=s,a={item:t[i],refIndex:i};return r&&(a.matches=Tf(s)),n&&(a.score=s.score),a})}const Cf=/[\p{L}\p{M}\p{N}_]+/gu,ea=new WeakSet;function $f(e){ea.has(e)||(ea.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 If(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||$f(e),t=>t.match(e)||[]):t=>t.match(Cf)||[]}function Ys({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:r}={}){const n=If(r);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=On(s)),n(s)}}}var Of=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Ys({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 Eo(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=jo(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function Ss(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 wl(e,t,r,n){const{i:s,v:i,$:a}=t;if(i!==void 0){Ss(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)Ss(e,u.v,s,n);else Ss(e,c.v,s,n)}}function Rf(e,t,r){const n={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)wl(n,s,t,r);return n}function Mf(e,t,r,n){wl(e,t,r,n)}function Lf(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 ta(e,t){if(t.length===0)return;const r=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of r)Lf(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 Mt=class{constructor(e,t,r){this.options={...re,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new rf(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=Nr(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 vo))throw new Error(Zd);if(this._myIndex=t||xl(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Ys({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Rf(this._myIndex.records,this._myIndex.keys.length,r)}this._invalidateSearcherCache()}add(e){if(!Qe(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const r=Ys({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Mf(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&&ta(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(Hs);this._invertedIndex&&ta(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(De(e)&&!e.trim()){let p=this._docs.map((h,g)=>({item:h,refIndex:g}));return wr(r)&&r>-1&&(p=p.slice(0,r)),p}const c=i&&wr(r)&&r>0&&De(e),u=a,d=(p,h)=>u(p,h)||p.idx-h.idx;let f;if(c){const p=new Nf(r,d);De(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:l}),f=p.extractSorted()}else f=De(e)?De(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Af(f,{ignoreFieldNorm:l}),i&&f.sort(De(e)?d:u),wr(r)&&r>-1&&(f=f.slice(0,r));return _f(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(!Qe(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=Js(h.matches,{ignoreFieldNorm:r}),t.insert(h)):a.push(h)}}}),a}_searchLogical(e){const t=yl(e,this.options),r=this._normalizedKeys(),n=(l,c,u)=>{if(!("children"in l)){const{keyId:h,searcher:g}=l;let w;return h===null?(w=[],r.forEach((y,E)=>{w.push(...this._findMatches({key:y,value:c[E],searcher:g}))})):w=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:g}),w&&w.length?[{idx:u,item:c,matches:w}]:[]}const{children:d,operator:f}=l,p=[];for(let h=0,g=d.length;h<g;h+=1){const w=d[h],y=n(w,c,u);if(y.length)p.push(...y);else if(f===Tr.AND)return[]}return p},s=this._myIndex.records,i=new Map,a=[];return s.forEach(({$:l,i:c})=>{if(Qe(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(!Qe(c))return;const d=[];let f=!1,p=!1;if(a.forEach((h,g)=>{const w=this._findMatches({key:h,value:c[g],searcher:n});w.length?(d.push(...w),w[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=Js(h.matches,{ignoreFieldNorm:r}),t.insert(h)):l.push(h)}}),l}_findMatches({key:e,value:t,searcher:r}){if(!Qe(t))return[];const n=[];if(Rt(t))t.forEach(({v:s,i,n:a})=>{if(!Qe(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}};Mt.version="7.5.0";Mt.createIndex=xl;Mt.parseIndex=ff;Mt.config=re;Mt.match=function(e,t,r){if(r&&r.useTokenSearch)throw new Error(nf);return Nr(e,{...re,...r}).searchIn(t)};Mt.parseQuery=yl;So(jf);So(Of);Mt.use=function(...e){e.forEach(t=>So(t))};var Pf=Mt;function kl(e,t,r={}){const[n,s]=x.useState(""),[i,a]=x.useState(""),l=r.debounceMs??150;x.useEffect(()=>{const f=setTimeout(()=>a(n),l);return()=>clearTimeout(f)},[n,l]);const c=x.useMemo(()=>t(e),[e,t]),u=x.useMemo(()=>new Pf(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:r.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,r.threshold]),d=x.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 Df(e,t={}){return kl(e,Vd,t)}const Xs="search-match",vl=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function Bf(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 Ff(e,t){if(!vl())return;const r=Bf(e,t);if(!r.length){CSS.highlights.delete(Xs);return}CSS.highlights.set(Xs,new Highlight(...r))}function As(){vl()&&CSS.highlights.delete(Xs)}function zf(e,t){const r=x.useRef(null);x.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&&Ff(d,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>l(0),50),()=>{a=!0}},[e,...t])}function jl({tabs:e,defaultTab:t,isTabKey:r,sections:n,searchQuery:s}){var B;const i=((B=e[0])==null?void 0:B.id)??t,[a,l]=x.useState(i),[c,u]=x.useState(null),d=_=>{l(_),u(_)},[f,p]=x.useState({}),h=e.some(_=>_.id===a)?a:i,g={};for(const _ of n)g[_.id]=_.visible?f[_.id]??null:null;const w=(_,H)=>p(Z=>({...Z,[_]:H})),[y,E]=x.useState(null),[N,j]=x.useState(null),[I,W]=x.useState(null),G=_=>{r(_.tab)?d(_.tab):_.tab==="servers"&&u("servers");const H={};for(const Z of n)H[Z.id]=Z.id===_.tab?_.key:null;p(H),E(_.focusSection??null),j(_.tab==="schemas"&&_.schemaFocusTokens?{tokens:_.schemaFocusTokens,id:_.targetId}:null),_.tab==="schemas"&&As(),W({targetId:_.targetId,query:s,highlight:_.tab!=="schemas"})},T=(_,H)=>{d(_),p(Z=>{const se={...Z};for(const S of n)S.id!=="servers"&&(se[S.id]=S.id===_?H:null);return se})},v=_=>{u("servers");const H={};for(const Z of n)H[Z.id]=Z.id==="servers"?_:null;p(H)},b=_=>{r(_)&&d(_)},C=(()=>{for(const _ of n){const H=g[_.id];if(H)return{tab:_.id,key:H}}return null})();return zf(I,[h,y,N,...n.map(_=>g[_.id])]),x.useEffect(()=>{s.trim()||(W(null),As())},[s]),x.useEffect(()=>As,[]),{effectiveTab:h,focusTab:d,navActiveSection:c??h,selected:g,setSelectedKey:w,selectedNavItem:C,handleSearchSelect:G,handleNavItemSelect:T,handleNavServerSelect:v,handleContentTabChange:b,focusSection:y,schemaFocusTarget:N}}const ie=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),xt=e=>ie(e)?e:null,na="^[\0-ÿ]*$",Uf=Math.pow(-2,31),Hf=Math.pow(2,31)-1,Wf=Math.pow(-2,63),Gf=Math.pow(2,63)-1,Kf={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"},Ao=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Rn(e){const t=Ao(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Zs(e,t,r){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const n=Rn(e);n!==void 0&&r[n]&&(t["x-parser-schema-id"]=n)}function ra(e,t,r){!(Array.isArray(e.type)&&e.type.includes("null"))&&!r&&(t.required=t.required||[],t.required.push(e.name))}function Vf(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 Jf(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 Qs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function qs(e,t,r){const{type:n,jsonSchema:s}=Vf(e,r);Jf(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 No(e,t,r){t!==void 0&&(e[t]=r)}function Mn(e,t){let r={};if(Array.isArray(e))return Xf(r,e,t);const n=Ao(e),s=typeof e=="string"?e:n.type;switch(r.type=Kf[s],s){case"int":{r.minimum=Uf,r.maximum=Hf;break}case"long":{r.minimum=Wf,r.maximum=Gf;break}case"bytes":{r.pattern=na;break}case"fixed":{r.pattern=na,r.minLength=n.size,r.maxLength=n.size;break}case"map":{r.additionalProperties=Mn(n.values,t);break}case"array":{r.items=Mn(n.items,t);break}case"enum":{r.enum=n.symbols;break}case"float":case"double":{r.format=s;break}case"record":{const i=Yf(n,t,r);No(t,Rn(e),r),r.properties=Object.fromEntries(i.entries());break}default:{const i=t[Rn(e)]??(typeof s=="string"?t[s]:void 0);i&&(r=Qs(n)?{...i}:i);break}}return Zs(n,r,t),qs(s,n,r),r}function Yf(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=Qs(s)?{...i}:i;ra(s,r,s.default!==void 0),Qs(s)&&(Zs(s,a,t),qs(s.type,s,a)),n.set(s.name,a)}else{const a=Mn(s.type,t);ra(s,r,s.default!==void 0),Zs(s,a,t),qs(s.type,s,a),n.set(s.name,a),No(t,Rn(s.type),a)}}return n}function Xf(e,t,r){const n=[];let s=null;for(const i of t){const a=Mn(i,r);(typeof i=="string"?i:Ao(i).type)==="null"?s=a:(n.push(a),No(r,Rn(i),a))}return s&&n.push(s),e.oneOf=n,e}function eo(e){return Mn(e,{})}const sa=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Zf=new Set(["record","enum","array","map","fixed"]),oa=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function To(e){const t=[];return rn(e,"schema",t,new Set),t}function rn(e,t,r,n){if(typeof e=="string"){!sa.has(e)&&!oa.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)=>rn(i,`${t}[${a}]`,r,n));return}if(!ie(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)||ie(s)?rn(s,`${t}.type`,r,n):r.push(`${t}: missing "type"`);return}if(!sa.has(s)&&!Zf.has(s)&&!oa.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(!ie(i)||typeof i.name!="string"){r.push(`${l}: field must have a string "name"`);return}rn(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"`):rn(e.items,`${t}.items`,r,n);break}case"map":{e.values===void 0?r.push(`${t}: map must have "values"`):rn(e.values,`${t}.values`,r,n);break}case"fixed":{typeof e.size!="number"&&r.push(`${t}: fixed must have a numeric "size"`);break}}}let _r=null,Ns=null;const to=new Set;function Qf(){return Ns||(Ns=Promise.resolve().then(()=>require("./protoToJsonSchema-DjrQ6cDd.cjs")).then(e=>{_r=e.protoToJsonSchema,to.forEach(t=>t())})),Ns}function qf(){return _r||Qf(),_r}function ep(e){return to.add(e),()=>to.delete(e)}function ia(){return _r!==null}function _o(){return x.useSyncExternalStore(ep,ia,ia)}const tp="x-parser-original-payload",Cr="x-lib-conversion-error",np=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,rp=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Fn(e){return typeof e=="string"&&np.test(e)}function zn(e){return typeof e=="string"&&rp.test(e)}function El(e){return ie(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Sl(e){var t,r;if(typeof e!="string")return null;if(Fn(e)){const n=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return n?`avro ${n}`:"avro"}if(zn(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 Al(e){return Fn(e)?"Avro":zn(e)?"Protobuf":null}function sp(e,t){return t?!1:!e||Fn(e)||zn(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const op=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],ip=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function ap(e){return typeof e=="string"||Array.isArray(e)?!0:ie(e)?typeof e.type=="string"&&ip.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!op.some(t=>t in e):!1}function Ln(e,t){let r=e;if(t&&ie(r)&&typeof r.$ref=="string"){const a=t(r.$ref);a!==void 0&&(r=a)}const n=lp(r),s=n.schema.description;if(typeof s=="string")return{...n,description:s};const i=El(r)?r.description:void 0;return typeof i=="string"?{...n,description:i}:n}function lp(e){var a;if(!El(e))return{schema:xt(e)??e};const{schemaFormat:t}=e,r=e.schema,n=e[tp],s=(a=xt(r))==null?void 0:a[Cr];if(typeof s=="string")return{schema:xt(n)??{},schemaFormat:t,originalSchema:n,conversionError:s};if(n!==void 0)return{schema:xt(r)??{},schemaFormat:t,originalSchema:n};if(Fn(t)&&ap(r)){const l=To(r);if(l.length>0)return{schema:xt(r)??{},schemaFormat:t,originalSchema:r,conversionError:l[0]};try{return{schema:eo(r),schemaFormat:t,originalSchema:r}}catch(c){return{schema:xt(r)??{},schemaFormat:t,originalSchema:r,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(zn(t)&&typeof r=="string"){const l=qf();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=xt(r);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:r}}const Ie=(e,t)=>`${"#".repeat(e)} ${t}`,z=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),En=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),cp={objects:new Set,refs:new Set};function vr(e,t,r=cp){if(e===null||typeof e!="object")return e;if(r.objects.has(e)||En(e)&&typeof e.$ref=="string"&&r.refs.has(e.$ref)){const i=En(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:En(e)&&typeof e.$ref=="string"?new Set(r.refs).add(e.$ref):r.refs};if(Array.isArray(e))return e.map(i=>vr(i,t,n));if(En(e)&&typeof e.$ref=="string"){const i=t==null?void 0:t(e.$ref);return En(i)||Array.isArray(i)?vr(i,t,n):{$ref:e.$ref}}const s={};for(const[i,a]of Object.entries(e))s[i]=vr(a,t,n);return s}function $r(e,t,r){if(!t)return"";const n=vr(t,r);return`${Ie(4,`\`${z(e)}\``)}
7
7
 
8
8
  \`\`\`json
9
9
  ${JSON.stringify(n,null,2)}
10
- \`\`\``}function Nn(e,t,r){if(!t||typeof t=="boolean")return"";const{schema:n,description:s,conversionError:i,pendingConversion:a}=Rn(t,r);if(a)return`${Ie(4,`\`${z(e)}\``)}
10
+ \`\`\``}function _n(e,t,r){if(!t||typeof t=="boolean")return"";const{schema:n,description:s,conversionError:i,pendingConversion:a}=Ln(t,r);if(a)return`${Ie(4,`\`${z(e)}\``)}
11
11
 
12
12
  _(schema conversion still in progress)_`;if(i)return`${Ie(4,`\`${z(e)}\``)}
13
13
 
14
- _(could not convert schema: ${z(i)})_`;const l=s&&!n.description?{...n,description:s}:n;return Rr(e,l,r)}function Sl(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${z(e.in)}${e.name?`: \`${z(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${z(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 z(e.type)}}function lp(e){if(!(e!=null&&e.length))return"";const t=[];for(const r of e)if(r!=null&&r.type&&(t.push(`- **${Sl(r)}**`),r.description&&t.push(` ${z(r.description)}`),r.type==="openIdConnect"&&r.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${z(r.openIdConnectUrl)}\``),r.type==="oauth2"))for(const[n,s]of Object.entries(r.flows??{})){t.push(` - Flow \`${z(n)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${z(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${z(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${z(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${z(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
14
+ _(could not convert schema: ${z(i)})_`;const l=s&&!n.description?{...n,description:s}:n;return $r(e,l,r)}function Nl(e){var t;switch(e.type){case"apiKey":case"httpApiKey":return`API Key (${z(e.in)}${e.name?`: \`${z(e.name)}\``:""})`;case"http":return((t=e.scheme)==null?void 0:t.toLowerCase())==="basic"?"HTTP Basic":`HTTP Bearer${e.bearerFormat?` (format: ${z(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 z(e.type)}}function up(e){if(!(e!=null&&e.length))return"";const t=[];for(const r of e)if(r!=null&&r.type&&(t.push(`- **${Nl(r)}**`),r.description&&t.push(` ${z(r.description)}`),r.type==="openIdConnect"&&r.openIdConnectUrl&&t.push(` - OpenID Connect URL: \`${z(r.openIdConnectUrl)}\``),r.type==="oauth2"))for(const[n,s]of Object.entries(r.flows??{})){t.push(` - Flow \`${z(n)}\`:`),s.authorizationUrl&&t.push(` - Authorization URL: \`${z(s.authorizationUrl)}\``),s.tokenUrl&&t.push(` - Token URL: \`${z(s.tokenUrl)}\``),s.refreshUrl&&t.push(` - Refresh URL: \`${z(s.refreshUrl)}\``);const i=Object.keys(s.availableScopes??s.scopes??{});i.length&&t.push(` - Available scopes: ${i.map(a=>`\`${z(a)}\``).join(", ")}`)}return t.length?["**Authorization:**",t.join(`
15
15
  `)].join(`
16
16
 
17
- `):""}function Al(e){const t=[],{info:r}=e;t.push(Ie(1,z(r.title)));const n=[`**Version:** ${z(r.version)}`];if(r.license&&n.push(`**License:** ${z(r.license.name)}${r.license.url?` (${z(r.license.url)})`:""}`),r.contact){const s=[r.contact.name,r.contact.email].filter(Boolean).map(z).join(" ");s&&n.push(`**Contact:** ${s}`)}if(t.push(n.join(`
17
+ `):""}function Tl(e){const t=[],{info:r}=e;t.push(Ie(1,z(r.title)));const n=[`**Version:** ${z(r.version)}`];if(r.license&&n.push(`**License:** ${z(r.license.name)}${r.license.url?` (${z(r.license.url)})`:""}`),r.contact){const s=[r.contact.name,r.contact.email].filter(Boolean).map(z).join(" ");s&&n.push(`**Contact:** ${s}`)}if(t.push(n.join(`
18
18
  `)),r.description&&t.push(z(r.description)),e.servers&&Object.keys(e.servers).length){const s=[Ie(2,"Servers")];for(const[i,a]of Object.entries(e.servers)){s.push(Ie(3,z(i)));const l=[`**Host:** \`${z(a.host)}${a.pathname?z(a.pathname):""}\``];l.push(`**Protocol:** ${z(a.protocol)}${a.protocolVersion?` ${z(a.protocolVersion)}`:""}`),a.description&&l.push(z(a.description)),s.push(l.join(`
19
- `));const c=lp(a.security);c&&s.push(c)}t.push(s.join(`
19
+ `));const c=up(a.security);c&&s.push(c)}t.push(s.join(`
20
20
 
21
- `))}return t}function _o(e,t=Pn(e)){var i,a,l;const r=Al(e);if(e.operations&&Object.keys(e.operations).length){const c=[Ie(2,"Operations")];for(const[u,d]of Object.entries(e.operations)){const f=d.channel;c.push(Ie(3,`${z((i=d.action)==null?void 0:i.toUpperCase())} \`${z(u)}\``));const p=[];f!=null&&f.address&&p.push(`**Channel:** \`${z(f.address)}\``),d.summary&&p.push(z(d.summary)),d.description&&p.push(z(d.description));const h=d.messages??[];h.length&&p.push(`**Messages:** ${h.map(g=>`\`${z(g.name??g.title??"message")}\``).join(", ")}`),c.push(p.join(`
21
+ `))}return t}function Co(e,t=Bn(e)){var i,a,l;const r=Tl(e);if(e.operations&&Object.keys(e.operations).length){const c=[Ie(2,"Operations")];for(const[u,d]of Object.entries(e.operations)){const f=d.channel;c.push(Ie(3,`${z((i=d.action)==null?void 0:i.toUpperCase())} \`${z(u)}\``));const p=[];f!=null&&f.address&&p.push(`**Channel:** \`${z(f.address)}\``),d.summary&&p.push(z(d.summary)),d.description&&p.push(z(d.description));const h=d.messages??[];h.length&&p.push(`**Messages:** ${h.map(g=>`\`${z(g.name??g.title??"message")}\``).join(", ")}`),c.push(p.join(`
22
22
 
23
23
  `))}r.push(c.join(`
24
24
 
25
25
  `))}const n=(a=e.components)==null?void 0:a.messages;if(n&&Object.keys(n).length){const c=[Ie(2,"Messages")];for(const[u,d]of Object.entries(n)){c.push(Ie(3,z(d.title??d.name??u)));const f=[];d.summary&&f.push(z(d.summary)),d.description&&f.push(z(d.description)),d.contentType&&f.push(`**Content-Type:** \`${z(d.contentType)}\``),c.push(f.join(`
26
26
 
27
- `)),d.payload&&c.push(Nn("payload",d.payload,t)),d.headers&&c.push(Nn("headers",d.headers,t))}r.push(c.join(`
27
+ `)),d.payload&&c.push(_n("payload",d.payload,t)),d.headers&&c.push(_n("headers",d.headers,t))}r.push(c.join(`
28
28
 
29
- `))}const s=(l=e.components)==null?void 0:l.schemas;if(s&&Object.keys(s).length){const c=[Ie(2,"Schemas")];for(const[u,d]of Object.entries(s))c.push(Nn(u,d,t));r.push(c.join(`
29
+ `))}const s=(l=e.components)==null?void 0:l.schemas;if(s&&Object.keys(s).length){const c=[Ie(2,"Schemas")];for(const[u,d]of Object.entries(s))c.push(_n(u,d,t));r.push(c.join(`
30
30
 
31
31
  `))}return r.filter(Boolean).join(`
32
32
 
33
- `)}function cp(e,t,r){var l;const n=t.channel,s=[Ie(3,`${z((l=t.action)==null?void 0:l.toUpperCase())} \`${z(e)}\``)],i=[];n!=null&&n.address&&i.push(`**Channel:** \`${z(n.address)}\``),t.summary&&i.push(z(t.summary)),t.description&&i.push(z(t.description)),s.push(i.join(`
33
+ `)}function dp(e,t,r){var l;const n=t.channel,s=[Ie(3,`${z((l=t.action)==null?void 0:l.toUpperCase())} \`${z(e)}\``)],i=[];n!=null&&n.address&&i.push(`**Channel:** \`${z(n.address)}\``),t.summary&&i.push(z(t.summary)),t.description&&i.push(z(t.description)),s.push(i.join(`
34
34
 
35
35
  `));const a=t.messages??[];for(const c of a){const u=[Ie(4,z(c.title??c.name??"Message"))],d=[];c.summary&&d.push(z(c.summary)),c.description&&d.push(z(c.description)),c.contentType&&d.push(`**Content-Type:** \`${z(c.contentType)}\``),d.length&&u.push(d.join(`
36
36
 
37
37
  `)),s.push(u.join(`
38
38
 
39
- `)),c.payload&&s.push(Nn("payload",c.payload,r)),c.headers&&s.push(Nn("headers",c.headers,r))}return s.filter(Boolean).join(`
39
+ `)),c.payload&&s.push(_n("payload",c.payload,r)),c.headers&&s.push(_n("headers",c.headers,r))}return s.filter(Boolean).join(`
40
40
 
41
- `)}function Nl(e,t,r=Pn(e)){var i;const n=(i=e.operations)==null?void 0:i[t];if(!n)return"";const s=Al(e);return s.push(cp(t,n,r)),s.filter(Boolean).join(`
41
+ `)}function _l(e,t,r=Bn(e)){var i;const n=(i=e.operations)==null?void 0:i[t];if(!n)return"";const s=Tl(e);return s.push(dp(t,n,r)),s.filter(Boolean).join(`
42
42
 
43
- `)}function up(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(`- **${Sl(a)}** (\`${z(i)}\`)`),a.description&&s.push(` ${z(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${z(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${z(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${z(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${z(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${z(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=>`\`${z(f)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${z(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
43
+ `)}function fp(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(`- **${Nl(a)}** (\`${z(i)}\`)`),a.description&&s.push(` ${z(a.description)}`),a.type==="openIdConnect"&&a.openIdConnectUrl&&s.push(` - OpenID Connect URL: \`${z(a.openIdConnectUrl)}\``),a.type==="oauth2")for(const[c,u]of Object.entries(a.flows??{})){s.push(` - Flow \`${z(c)}\`:`),u.authorizationUrl&&s.push(` - Authorization URL: \`${z(u.authorizationUrl)}\``),u.tokenUrl&&s.push(` - Token URL: \`${z(u.tokenUrl)}\``),u.refreshUrl&&s.push(` - Refresh URL: \`${z(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=>`\`${z(f)}\``).join(", ")}`)}else l!=null&&l.length&&s.push(` - Required scopes: ${l.map(c=>`\`${z(c)}\``).join(", ")}`)}return s.length?["**Authorization:**",s.join(`
44
44
  `)].join(`
45
45
 
46
- `):""}function Tl(e,t,r,n,s,i){var p;const a=[Ie(3,`${e.toUpperCase()} \`${z(t)}\``)],l=[];r.summary&&l.push(z(r.summary)),r.description&&l.push(z(r.description)),r.deprecated&&l.push("**Deprecated**");const c=r.security??i??[],u=up(c,s);u&&l.push(u);for(const h of["path","query","header","cookie"]){const g=(r.parameters??[]).filter(w=>w.in===h);if(g.length){l.push(`**${h[0].toUpperCase()}${h.slice(1)} Parameters:**`);for(const w of g){const y=w.schema;l.push(`- \`${z(w.name)}\`${w.required?" (required)":""}${y!=null&&y.type?` — ${z(y.type)}`:""}${w.description?`: ${z(w.description)}`:""}`)}}}a.push(l.join(`
46
+ `):""}function Cl(e,t,r,n,s,i){var p;const a=[Ie(3,`${e.toUpperCase()} \`${z(t)}\``)],l=[];r.summary&&l.push(z(r.summary)),r.description&&l.push(z(r.description)),r.deprecated&&l.push("**Deprecated**");const c=r.security??i??[],u=fp(c,s);u&&l.push(u);for(const h of["path","query","header","cookie"]){const g=(r.parameters??[]).filter(w=>w.in===h);if(g.length){l.push(`**${h[0].toUpperCase()}${h.slice(1)} Parameters:**`);for(const w of g){const y=w.schema;l.push(`- \`${z(w.name)}\`${w.required?" (required)":""}${y!=null&&y.type?` — ${z(y.type)}`:""}${w.description?`: ${z(w.description)}`:""}`)}}}a.push(l.join(`
47
47
 
48
- `));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,g]of Object.entries(d))a.push([`**Request Body** (\`${z(h)}\`)`,Rr("body",g.schema,n)].join(`
48
+ `));const d=((p=r.requestBody)==null?void 0:p.content)??{};for(const[h,g]of Object.entries(d))a.push([`**Request Body** (\`${z(h)}\`)`,$r("body",g.schema,n)].join(`
49
49
 
50
- `));const f=r.responses??{};for(const[h,g]of Object.entries(f)){const w=[Ie(4,`${h}${g.description?`: ${z(g.description)}`:""}`)];for(const[y,E]of Object.entries(g.content??{}))w.push([`**Body** (\`${z(y)}\`)`,Rr("body",E.schema,n)].join(`
50
+ `));const f=r.responses??{};for(const[h,g]of Object.entries(f)){const w=[Ie(4,`${h}${g.description?`: ${z(g.description)}`:""}`)];for(const[y,E]of Object.entries(g.content??{}))w.push([`**Body** (\`${z(y)}\`)`,$r("body",E.schema,n)].join(`
51
51
 
52
52
  `));a.push(w.join(`
53
53
 
54
54
  `))}return a.join(`
55
55
 
56
- `)}function Co(e,t=Pn(e)){var a,l,c,u,d;const r=[],{info:n}=e;if(r.push(Ie(1,z(n.title))),r.push(`**Version:** ${z(n.version)}`),n.description&&r.push(z(n.description)),(a=e.servers)!=null&&a.length){const f=[Ie(2,"Servers")];for(const p of e.servers)f.push(`- \`${z(p.url)}\`${p.description?` — ${z(p.description)}`:""}`);r.push(f.join(`
57
- `))}const s=e.paths?Cn(e.paths):[];if(s.length){const f=[Ie(2,"Endpoints")];for(const{method:p,path:h}of s){const g=(c=(l=e.paths)==null?void 0:l[h])==null?void 0:c[p];g&&f.push(Tl(p,h,g,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}r.push(f.join(`
56
+ `)}function $o(e,t=Bn(e)){var a,l,c,u,d;const r=[],{info:n}=e;if(r.push(Ie(1,z(n.title))),r.push(`**Version:** ${z(n.version)}`),n.description&&r.push(z(n.description)),(a=e.servers)!=null&&a.length){const f=[Ie(2,"Servers")];for(const p of e.servers)f.push(`- \`${z(p.url)}\`${p.description?` — ${z(p.description)}`:""}`);r.push(f.join(`
57
+ `))}const s=e.paths?In(e.paths):[];if(s.length){const f=[Ie(2,"Endpoints")];for(const{method:p,path:h}of s){const g=(c=(l=e.paths)==null?void 0:l[h])==null?void 0:c[p];g&&f.push(Cl(p,h,g,t,(u=e.components)==null?void 0:u.securitySchemes,e.security))}r.push(f.join(`
58
58
 
59
- `))}const i=(d=e.components)==null?void 0:d.schemas;if(i&&Object.keys(i).length){const f=[Ie(2,"Schemas")];for(const[p,h]of Object.entries(i))f.push(Rr(p,h,t));r.push(f.join(`
59
+ `))}const i=(d=e.components)==null?void 0:d.schemas;if(i&&Object.keys(i).length){const f=[Ie(2,"Schemas")];for(const[p,h]of Object.entries(i))f.push($r(p,h,t));r.push(f.join(`
60
60
 
61
61
  `))}return r.filter(Boolean).join(`
62
62
 
63
- `)}function _l(e,t,r,n=Pn(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(Ie(1,z(a.title))),i.push(`**Version:** ${z(a.version)}`),a.description&&i.push(z(a.description)),(u=e.servers)!=null&&u.length){const f=[Ie(2,"Servers")];for(const p of e.servers)f.push(`- \`${z(p.url)}\`${p.description?` — ${z(p.description)}`:""}`);i.push(f.join(`
64
- `))}return i.push(Tl(t,r,s,n,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
63
+ `)}function $l(e,t,r,n=Bn(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(Ie(1,z(a.title))),i.push(`**Version:** ${z(a.version)}`),a.description&&i.push(z(a.description)),(u=e.servers)!=null&&u.length){const f=[Ie(2,"Servers")];for(const p of e.servers)f.push(`- \`${z(p.url)}\`${p.description?` — ${z(p.description)}`:""}`);i.push(f.join(`
64
+ `))}return i.push(Cl(t,r,s,n,(d=e.components)==null?void 0:d.securitySchemes,e.security)),i.filter(Boolean).join(`
65
65
 
66
- `)}const dp=/^(https?:|data:image\/)/i;function $o(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"||!dp.test(r)?null:{url:r,altText:typeof n=="string"&&n?n:void 0,backgroundColor:typeof s=="string"?s:void 0}}const Cl={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},fp=()=>Promise.resolve().then(()=>require("./LogoExtension-uCSh3C3x.cjs"));var pp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Io(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function hp(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}/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */var Ns,oa;function ia(){if(oa)return Ns;oa=1;function e($,R){(R==null||R>$.length)&&(R=$.length);for(var Y=0,oe=Array(R);Y<R;Y++)oe[Y]=$[Y];return oe}function t($){if(Array.isArray($))return $}function r($,R){var Y=$==null?null:typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(Y!=null){var oe,de,ke,Pe,pn=[],Je=!0,hn=!1;try{if(ke=(Y=Y.call($)).next,R!==0)for(;!(Je=(oe=ke.call(Y)).done)&&(pn.push(oe.value),pn.length!==R);Je=!0);}catch(ts){hn=!0,de=ts}finally{try{if(!Je&&Y.return!=null&&(Pe=Y.return(),Object(Pe)!==Pe))return}finally{if(hn)throw de}}return pn}}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s($,R){return t($)||r($,R)||i($,R)||n()}function i($,R){if($){if(typeof $=="string")return e($,R);var Y={}.toString.call($).slice(8,-1);return Y==="Object"&&$.constructor&&(Y=$.constructor.name),Y==="Map"||Y==="Set"?Array.from($):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e($,R):void 0}}const a=Object.entries,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let f=Object.freeze,p=Object.seal,h=Object.create,g=typeof Reflect<"u"&&Reflect,w=g.apply,y=g.construct;f||(f=function(R){return R}),p||(p=function(R){return R}),w||(w=function(R,Y){for(var oe=arguments.length,de=new Array(oe>2?oe-2:0),ke=2;ke<oe;ke++)de[ke-2]=arguments[ke];return R.apply(Y,de)}),y||(y=function(R){for(var Y=arguments.length,oe=new Array(Y>1?Y-1:0),de=1;de<Y;de++)oe[de-1]=arguments[de];return new R(...oe)});const E=te(Array.prototype.forEach),N=te(Array.prototype.lastIndexOf),j=te(Array.prototype.pop),I=te(Array.prototype.push),W=te(Array.prototype.splice),G=Array.isArray,T=te(String.prototype.toLowerCase),v=te(String.prototype.toString),b=te(String.prototype.match),C=te(String.prototype.replace),B=te(String.prototype.indexOf),_=te(String.prototype.trim),H=te(Number.prototype.toString),Z=te(Boolean.prototype.toString),se=typeof BigInt>"u"?null:te(BigInt.prototype.toString),S=typeof Symbol>"u"?null:te(Symbol.prototype.toString),A=te(Object.prototype.hasOwnProperty),F=te(Object.prototype.toString),J=te(RegExp.prototype.test),ae=Te(TypeError);function te($){return function(R){R instanceof RegExp&&(R.lastIndex=0);for(var Y=arguments.length,oe=new Array(Y>1?Y-1:0),de=1;de<Y;de++)oe[de-1]=arguments[de];return w($,R,oe)}}function Te($){return function(){for(var R=arguments.length,Y=new Array(R),oe=0;oe<R;oe++)Y[oe]=arguments[oe];return y($,Y)}}function q($,R){let Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T;if(l&&l($,null),!G(R))return $;let oe=R.length;for(;oe--;){let de=R[oe];if(typeof de=="string"){const ke=Y(de);ke!==de&&(c(R)||(R[oe]=ke),de=ke)}$[de]=!0}return $}function ve($){for(let R=0;R<$.length;R++)A($,R)||($[R]=null);return $}function P($){const R=h(null);for(const oe of a($)){var Y=s(oe,2);const de=Y[0],ke=Y[1];A($,de)&&(G(ke)?R[de]=ve(ke):ke&&typeof ke=="object"&&ke.constructor===Object?R[de]=P(ke):R[de]=ke)}return R}function X($){switch(typeof $){case"string":return $;case"number":return H($);case"boolean":return Z($);case"bigint":return se?se($):"0";case"symbol":return S?S($):"Symbol()";case"undefined":return F($);case"function":case"object":{if($===null)return F($);const R=$,Y=O(R,"toString");if(typeof Y=="function"){const oe=Y(R);return typeof oe=="string"?oe:F(oe)}return F($)}default:return F($)}}function O($,R){for(;$!==null;){const oe=d($,R);if(oe){if(oe.get)return te(oe.get);if(typeof oe.value=="function")return te(oe.value)}$=u($)}function Y(){return null}return Y}function ee($){try{return J($,""),!0}catch{return!1}}const le=f(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),K=f(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),pe=f(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),we=f(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fe=f(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Me=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xe=f(["#text"]),He=f(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Le=f(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Q=f(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),je=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_e=p(/{{[\w\W]*|^[\w\W]*}}/g),me=p(/<%[\w\W]*|^[\w\W]*%>/g),mt=p(/\${[\w\W]*/g),et=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Lt=p(/^aria-[\-\w]+$/),tt=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),D=p(/^(?:\w+script|data):/i),U=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ne=p(/^html$/i),ue=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Ce=p(/<[/\w!]/g),rt=p(/<[/\w]/g),qr=p(/<\/no(script|embed|frames)/i),es=p(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},uu=function(){return typeof window>"u"?null:window},du=function(R,Y){if(typeof R!="object"||typeof R.createPolicy!="function")return null;let oe=null;const de="data-tt-policy-suffix";Y&&Y.hasAttribute(de)&&(oe=Y.getAttribute(de));const ke="dompurify"+(oe?"#"+oe:"");try{return R.createPolicy(ke,{createHTML(Pe){return Pe},createScriptURL(Pe){return Pe}})}catch{return console.warn("TrustedTypes policy "+ke+" could not be created."),null}},si=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Et=function(R,Y,oe,de){return A(R,Y)&&G(R[Y])?q(de.base?P(de.base):{},R[Y],de.transform):oe};function oi(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:uu();const R=L=>oi(L);if(R.version="3.4.11",R.removed=[],!$||!$.document||$.document.nodeType!==ut.document||!$.Element)return R.isSupported=!1,R;let Y=$.document;const oe=Y,de=oe.currentScript;$.DocumentFragment;const ke=$.HTMLTemplateElement,Pe=$.Node,pn=$.Element,Je=$.NodeFilter,hn=$.NamedNodeMap;hn===void 0&&($.NamedNodeMap||$.MozNamedAttrMap),$.HTMLFormElement;const ts=$.DOMParser,er=$.trustedTypes,Pt=pn.prototype,pu=O(Pt,"cloneNode"),ii=O(Pt,"remove"),hu=O(Pt,"nextSibling"),mn=O(Pt,"childNodes"),gn=O(Pt,"parentNode"),ai=O(Pt,"shadowRoot"),ns=O(Pt,"attributes"),Ye=Pe&&Pe.prototype?O(Pe.prototype,"nodeType"):null,St=Pe&&Pe.prototype?O(Pe.prototype,"nodeName"):null;if(typeof ke=="function"){const L=Y.createElement("template");L.content&&L.content.ownerDocument&&(Y=L.content.ownerDocument)}let We,Dt="",rs,li=!1,xn=0;const ci=function(){if(xn>0)throw ae('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Xt=function(m){ci(),xn++;try{return We.createHTML(m)}finally{xn--}},mu=function(m){ci(),xn++;try{return We.createScriptURL(m)}finally{xn--}},gu=function(){return li||(rs=du(er,de),li=!0),rs},tr=Y,ss=tr.implementation,ui=tr.createNodeIterator,xu=tr.createDocumentFragment,bu=tr.getElementsByTagName,yu=oe.importNode;let $e=si();R.isSupported=typeof a=="function"&&typeof gn=="function"&&ss&&ss.createHTMLDocument!==void 0;const wu=_e,ku=me,vu=mt,ju=et,Eu=Lt,Su=D,di=U,Au=ue;let fi=tt,Ee=null;const pi=q({},[...le,...K,...pe,...fe,...xe]);let Se=null;const hi=q({},[...He,...Le,...Q,...je]);let Ae=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),bn=null,mi=null;const At=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let gi=!0,os=!0,xi=!1,bi=!0,Nt=!1,yn=!0,Bt=!1,is=!1,as=null,ls=null,cs=!1,Zt=!1,nr=!1,rr=!1,yi=!0,wi=!1;const ki="user-content-";let us=!0,ds=!1,Qt={},dt=null;const fs=q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let vi=null;const ji=q({},["audio","video","img","source","image","track"]);let ps=null;const Ei=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),sr="http://www.w3.org/1998/Math/MathML",or="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xhtml";let qt=ft,hs=!1,ms=null;const Nu=q({},[sr,or,ft],v),Si=f(["mi","mo","mn","ms","mtext"]);let gs=q({},Si);const Ai=f(["annotation-xml"]);let xs=q({},Ai);const Tu=q({},["title","style","font","a","script"]);let wn=null;const _u=["application/xhtml+xml","text/html"],Cu="text/html";let Ne=null,en=null;const $u=Y.createElement("form"),Ni=function(m){return m instanceof RegExp||m instanceof Function},bs=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(en&&en===m)return;(!m||typeof m!="object")&&(m={}),m=P(m),wn=_u.indexOf(m.PARSER_MEDIA_TYPE)===-1?Cu:m.PARSER_MEDIA_TYPE,Ne=wn==="application/xhtml+xml"?v:T,Ee=Et(m,"ALLOWED_TAGS",pi,{transform:Ne}),Se=Et(m,"ALLOWED_ATTR",hi,{transform:Ne}),ms=Et(m,"ALLOWED_NAMESPACES",Nu,{transform:v}),ps=Et(m,"ADD_URI_SAFE_ATTR",Ei,{transform:Ne,base:Ei}),vi=Et(m,"ADD_DATA_URI_TAGS",ji,{transform:Ne,base:ji}),dt=Et(m,"FORBID_CONTENTS",fs,{transform:Ne}),bn=Et(m,"FORBID_TAGS",P({}),{transform:Ne}),mi=Et(m,"FORBID_ATTR",P({}),{transform:Ne}),Qt=A(m,"USE_PROFILES")?m.USE_PROFILES&&typeof m.USE_PROFILES=="object"?P(m.USE_PROFILES):m.USE_PROFILES:!1,gi=m.ALLOW_ARIA_ATTR!==!1,os=m.ALLOW_DATA_ATTR!==!1,xi=m.ALLOW_UNKNOWN_PROTOCOLS||!1,bi=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Nt=m.SAFE_FOR_TEMPLATES||!1,yn=m.SAFE_FOR_XML!==!1,Bt=m.WHOLE_DOCUMENT||!1,Zt=m.RETURN_DOM||!1,nr=m.RETURN_DOM_FRAGMENT||!1,rr=m.RETURN_TRUSTED_TYPE||!1,cs=m.FORCE_BODY||!1,yi=m.SANITIZE_DOM!==!1,wi=m.SANITIZE_NAMED_PROPS||!1,us=m.KEEP_CONTENT!==!1,ds=m.IN_PLACE||!1,fi=ee(m.ALLOWED_URI_REGEXP)?m.ALLOWED_URI_REGEXP:tt,qt=typeof m.NAMESPACE=="string"?m.NAMESPACE:ft,gs=A(m,"MATHML_TEXT_INTEGRATION_POINTS")&&m.MATHML_TEXT_INTEGRATION_POINTS&&typeof m.MATHML_TEXT_INTEGRATION_POINTS=="object"?P(m.MATHML_TEXT_INTEGRATION_POINTS):q({},Si),xs=A(m,"HTML_INTEGRATION_POINTS")&&m.HTML_INTEGRATION_POINTS&&typeof m.HTML_INTEGRATION_POINTS=="object"?P(m.HTML_INTEGRATION_POINTS):q({},Ai);const k=A(m,"CUSTOM_ELEMENT_HANDLING")&&m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING=="object"?P(m.CUSTOM_ELEMENT_HANDLING):h(null);if(Ae=h(null),A(k,"tagNameCheck")&&Ni(k.tagNameCheck)&&(Ae.tagNameCheck=k.tagNameCheck),A(k,"attributeNameCheck")&&Ni(k.attributeNameCheck)&&(Ae.attributeNameCheck=k.attributeNameCheck),A(k,"allowCustomizedBuiltInElements")&&typeof k.allowCustomizedBuiltInElements=="boolean"&&(Ae.allowCustomizedBuiltInElements=k.allowCustomizedBuiltInElements),p(Ae),Nt&&(os=!1),nr&&(Zt=!0),Qt&&(Ee=q({},xe),Se=h(null),Qt.html===!0&&(q(Ee,le),q(Se,He)),Qt.svg===!0&&(q(Ee,K),q(Se,Le),q(Se,je)),Qt.svgFilters===!0&&(q(Ee,pe),q(Se,Le),q(Se,je)),Qt.mathMl===!0&&(q(Ee,fe),q(Se,Q),q(Se,je))),At.tagCheck=null,At.attributeCheck=null,A(m,"ADD_TAGS")&&(typeof m.ADD_TAGS=="function"?At.tagCheck=m.ADD_TAGS:G(m.ADD_TAGS)&&(Ee===pi&&(Ee=P(Ee)),q(Ee,m.ADD_TAGS,Ne))),A(m,"ADD_ATTR")&&(typeof m.ADD_ATTR=="function"?At.attributeCheck=m.ADD_ATTR:G(m.ADD_ATTR)&&(Se===hi&&(Se=P(Se)),q(Se,m.ADD_ATTR,Ne))),A(m,"ADD_URI_SAFE_ATTR")&&G(m.ADD_URI_SAFE_ATTR)&&q(ps,m.ADD_URI_SAFE_ATTR,Ne),A(m,"FORBID_CONTENTS")&&G(m.FORBID_CONTENTS)&&(dt===fs&&(dt=P(dt)),q(dt,m.FORBID_CONTENTS,Ne)),A(m,"ADD_FORBID_CONTENTS")&&G(m.ADD_FORBID_CONTENTS)&&(dt===fs&&(dt=P(dt)),q(dt,m.ADD_FORBID_CONTENTS,Ne)),us&&(Ee["#text"]=!0),Bt&&q(Ee,["html","head","body"]),Ee.table&&(q(Ee,["tbody"]),delete bn.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const M=We;We=m.TRUSTED_TYPES_POLICY;try{Dt=Xt("")}catch(V){throw We=M,V}}else m.TRUSTED_TYPES_POLICY===null?(We=void 0,Dt=""):(We===void 0&&(We=gu()),We&&typeof Dt=="string"&&(Dt=Xt("")));f&&f(m),en=m},Ti=q({},[...K,...pe,...we]),_i=q({},[...fe,...Me]),Iu=function(m,k,M){return k.namespaceURI===ft?m==="svg":k.namespaceURI===sr?m==="svg"&&(M==="annotation-xml"||gs[M]):!!Ti[m]},Ou=function(m,k,M){return k.namespaceURI===ft?m==="math":k.namespaceURI===or?m==="math"&&xs[M]:!!_i[m]},Ru=function(m,k,M){return k.namespaceURI===or&&!xs[M]||k.namespaceURI===sr&&!gs[M]?!1:!_i[m]&&(Tu[m]||!Ti[m])},Mu=function(m){let k=gn(m);(!k||!k.tagName)&&(k={namespaceURI:qt,tagName:"template"});const M=T(m.tagName),V=T(k.tagName);return ms[m.namespaceURI]?m.namespaceURI===or?Iu(M,k,V):m.namespaceURI===sr?Ou(M,k,V):m.namespaceURI===ft?Ru(M,k,V):!!(wn==="application/xhtml+xml"&&ms[m.namespaceURI]):!1},Tt=function(m){I(R.removed,{element:m});try{gn(m).removeChild(m)}catch{if(ii(m),!gn(m))throw ae("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ci=function(m){const k=mn(m);if(k){const V=[];E(k,ce=>{I(V,ce)}),E(V,ce=>{try{ii(ce)}catch{}})}const M=ns(m);if(M)for(let V=M.length-1;V>=0;--V){const ce=M[V],he=ce&&ce.name;if(typeof he=="string")try{m.removeAttribute(he)}catch{}}},Ft=function(m,k){try{I(R.removed,{attribute:k.getAttributeNode(m),from:k})}catch{I(R.removed,{attribute:null,from:k})}if(k.removeAttribute(m),m==="is")if(Zt||nr)try{Tt(k)}catch{}else try{k.setAttribute(m,"")}catch{}},Lu=function(m){const k=ns(m);if(k)for(let M=k.length-1;M>=0;--M){const V=k[M],ce=V&&V.name;if(!(typeof ce!="string"||Se[Ne(ce)]))try{m.removeAttribute(ce)}catch{}}},Pu=function(m){const k=[m];for(;k.length>0;){const M=k.pop();(Ye?Ye(M):M.nodeType)===ut.element&&Lu(M);const ce=mn(M);if(ce)for(let he=ce.length-1;he>=0;--he)k.push(ce[he])}},$i=function(m){let k=null,M=null;if(cs)m="<remove></remove>"+m;else{const he=b(m,/^[\r\n\t ]+/);M=he&&he[0]}wn==="application/xhtml+xml"&&qt===ft&&(m='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+m+"</body></html>");const V=We?Xt(m):m;if(qt===ft)try{k=new ts().parseFromString(V,wn)}catch{}if(!k||!k.documentElement){k=ss.createDocument(qt,"template",null);try{k.documentElement.innerHTML=hs?Dt:V}catch{}}const ce=k.body||k.documentElement;return m&&M&&ce.insertBefore(Y.createTextNode(M),ce.childNodes[0]||null),qt===ft?bu.call(k,Bt?"html":"body")[0]:Bt?k.documentElement:ce},Ii=function(m){return ui.call(m.ownerDocument||m,m,Je.SHOW_ELEMENT|Je.SHOW_COMMENT|Je.SHOW_TEXT|Je.SHOW_PROCESSING_INSTRUCTION|Je.SHOW_CDATA_SECTION,null)},ir=function(m){return m=C(m,wu," "),m=C(m,ku," "),m=C(m,vu," "),m},ys=function(m){var k;m.normalize();const M=ui.call(m.ownerDocument||m,m,Je.SHOW_TEXT|Je.SHOW_COMMENT|Je.SHOW_CDATA_SECTION|Je.SHOW_PROCESSING_INSTRUCTION,null);let V=M.nextNode();for(;V;)V.data=ir(V.data),V=M.nextNode();const ce=(k=m.querySelectorAll)===null||k===void 0?void 0:k.call(m,"template");ce&&E(ce,he=>{tn(he.content)&&ys(he.content)})},ar=function(m){const k=St?St(m):null;return typeof k!="string"||Ne(k)!=="form"?!1:typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||m.attributes!==ns(m)||typeof m.removeAttribute!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function"||m.nodeType!==Ye(m)||m.childNodes!==mn(m)},tn=function(m){if(!Ye||typeof m!="object"||m===null)return!1;try{return Ye(m)===ut.documentFragment}catch{return!1}},kn=function(m){if(!Ye||typeof m!="object"||m===null)return!1;try{return typeof Ye(m)=="number"}catch{return!1}};function gt(L,m,k){L.length!==0&&E(L,M=>{M.call(R,m,k,en)})}const Du=function(m,k){return!!(yn&&m.hasChildNodes()&&!kn(m.firstElementChild)&&J(Ce,m.textContent)&&J(Ce,m.innerHTML)||yn&&m.namespaceURI===ft&&k==="style"&&kn(m.firstElementChild)||m.nodeType===ut.processingInstruction||yn&&m.nodeType===ut.comment&&J(rt,m.data))},Bu=function(m,k){if(!bn[k]&&Mi(k)&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,k)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(k)))return!1;if(us&&!dt[k]){const M=gn(m),V=mn(m);if(V&&M){const ce=V.length;for(let he=ce-1;he>=0;--he){const Re=ds?V[he]:pu(V[he],!0);M.insertBefore(Re,hu(m))}}}return Tt(m),!0},Oi=function(m){if(gt($e.beforeSanitizeElements,m,null),ar(m))return Tt(m),!0;const k=Ne(St?St(m):m.nodeName);if(gt($e.uponSanitizeElement,m,{tagName:k,allowedTags:Ee}),Du(m,k))return Tt(m),!0;if(bn[k]||!(At.tagCheck instanceof Function&&At.tagCheck(k))&&!Ee[k])return Bu(m,k);if((Ye?Ye(m):m.nodeType)===ut.element&&!Mu(m)||(k==="noscript"||k==="noembed"||k==="noframes")&&J(qr,m.innerHTML))return Tt(m),!0;if(Nt&&m.nodeType===ut.text){const V=ir(m.textContent);m.textContent!==V&&(I(R.removed,{element:m.cloneNode()}),m.textContent=V)}return gt($e.afterSanitizeElements,m,null),!1},Ri=function(m,k,M){if(mi[k]||yi&&(k==="id"||k==="name")&&(M in Y||M in $u))return!1;const V=Se[k]||At.attributeCheck instanceof Function&&At.attributeCheck(k,m);if(!(os&&J(ju,k))){if(!(gi&&J(Eu,k))){if(V){if(!ps[k]){if(!J(fi,C(M,di,""))){if(!((k==="src"||k==="xlink:href"||k==="href")&&m!=="script"&&B(M,"data:")===0&&vi[m])){if(!(xi&&!J(Su,C(M,di,"")))){if(M)return!1}}}}}else if(!(Mi(m)&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,m)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(m))&&(Ae.attributeNameCheck instanceof RegExp&&J(Ae.attributeNameCheck,k)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(k,m))||k==="is"&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,M)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(M))))return!1}}return!0},Fu=q({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Mi=function(m){return!Fu[T(m)]&&J(Au,m)},zu=function(m,k,M,V){if(We&&typeof er=="object"&&typeof er.getAttributeType=="function"&&!M)switch(er.getAttributeType(m,k)){case"TrustedHTML":return Xt(V);case"TrustedScriptURL":return mu(V)}return V},Uu=function(m,k,M,V){try{M?m.setAttributeNS(M,k,V):m.setAttribute(k,V),ar(m)?Tt(m):j(R.removed)}catch{Ft(k,m)}},Li=function(m){gt($e.beforeSanitizeAttributes,m,null);const k=m.attributes;if(!k||ar(m))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let V=k.length;const ce=Ne(m.nodeName);for(;V--;){const he=k[V],Re=he.name,Oe=he.namespaceURI,nt=he.value,st=Ne(Re),ks=nt;let Fe=Re==="value"?ks:_(ks);if(M.attrName=st,M.attrValue=Fe,M.keepAttr=!0,M.forceKeepAttr=void 0,gt($e.uponSanitizeAttribute,m,M),Fe=M.attrValue,wi&&(st==="id"||st==="name")&&B(Fe,ki)!==0&&(Ft(Re,m),Fe=ki+Fe),yn&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){Ft(Re,m);continue}if(st==="attributename"&&b(Fe,"href")){Ft(Re,m);continue}if(!M.forceKeepAttr){if(!M.keepAttr){Ft(Re,m);continue}if(!bi&&J(es,Fe)){Ft(Re,m);continue}if(Nt&&(Fe=ir(Fe)),!Ri(ce,st,Fe)){Ft(Re,m);continue}Fe=zu(ce,st,Oe,Fe),Fe!==ks&&Uu(m,Re,Oe,Fe)}}gt($e.afterSanitizeAttributes,m,null)},lr=function(m){let k=null;const M=Ii(m);for(gt($e.beforeSanitizeShadowDOM,m,null);k=M.nextNode();)if(gt($e.uponSanitizeShadowNode,k,null),Oi(k),Li(k),tn(k.content)&&lr(k.content),(Ye?Ye(k):k.nodeType)===ut.element){const ce=ai(k);tn(ce)&&(ws(ce),lr(ce))}gt($e.afterSanitizeShadowDOM,m,null)},ws=function(m){const k=[{node:m,shadow:null}];for(;k.length>0;){const M=k.pop();if(M.shadow){lr(M.shadow);continue}const V=M.node,he=(Ye?Ye(V):V.nodeType)===ut.element,Re=mn(V);if(Re)for(let Oe=Re.length-1;Oe>=0;--Oe)k.push({node:Re[Oe],shadow:null});if(he){const Oe=St?St(V):null;if(typeof Oe=="string"&&Ne(Oe)==="template"){const nt=V.content;tn(nt)&&k.push({node:nt,shadow:null})}}if(he){const Oe=ai(V);tn(Oe)&&k.push({node:null,shadow:Oe},{node:Oe,shadow:null})}}};return R.sanitize=function(L){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=null,M=null,V=null,ce=null;if(hs=!L,hs&&(L="<!-->"),typeof L!="string"&&!kn(L)&&(L=X(L),typeof L!="string"))throw ae("dirty is not a string, aborting");if(!R.isSupported)return L;is?(Ee=as,Se=ls):bs(m),($e.uponSanitizeElement.length>0||$e.uponSanitizeAttribute.length>0)&&(Ee=P(Ee)),$e.uponSanitizeAttribute.length>0&&(Se=P(Se)),R.removed=[];const he=ds&&typeof L!="string"&&kn(L);if(he){const nt=St?St(L):L.nodeName;if(typeof nt=="string"){const st=Ne(nt);if(!Ee[st]||bn[st])throw ae("root node is forbidden and cannot be sanitized in-place")}if(ar(L))throw ae("root node is clobbered and cannot be sanitized in-place");try{ws(L)}catch(st){throw Ci(L),st}}else if(kn(L))k=$i("<!---->"),M=k.ownerDocument.importNode(L,!0),M.nodeType===ut.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?k=M:k.appendChild(M),ws(M);else{if(!Zt&&!Nt&&!Bt&&L.indexOf("<")===-1)return We&&rr?Xt(L):L;if(k=$i(L),!k)return Zt?null:rr?Dt:""}k&&cs&&Tt(k.firstChild);const Re=Ii(he?L:k);try{for(;V=Re.nextNode();)Oi(V),Li(V),tn(V.content)&&lr(V.content)}catch(nt){throw he&&Ci(L),nt}if(he)return E(R.removed,nt=>{nt.element&&Pu(nt.element)}),Nt&&ys(L),L;if(Zt){if(Nt&&ys(k),nr)for(ce=xu.call(k.ownerDocument);k.firstChild;)ce.appendChild(k.firstChild);else ce=k;return(Se.shadowroot||Se.shadowrootmode)&&(ce=yu.call(oe,ce,!0)),ce}let Oe=Bt?k.outerHTML:k.innerHTML;return Bt&&Ee["!doctype"]&&k.ownerDocument&&k.ownerDocument.doctype&&k.ownerDocument.doctype.name&&J(ne,k.ownerDocument.doctype.name)&&(Oe="<!DOCTYPE "+k.ownerDocument.doctype.name+`>
68
- `+Oe),Nt&&(Oe=ir(Oe)),We&&rr?Xt(Oe):Oe},R.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bs(L),is=!0,as=Ee,ls=Se},R.clearConfig=function(){en=null,is=!1,as=null,ls=null,We=rs,Dt=""},R.isValidAttribute=function(L,m,k){en||bs({});const M=Ne(L),V=Ne(m);return Ri(M,V,k)},R.addHook=function(L,m){typeof m=="function"&&A($e,L)&&I($e[L],m)},R.removeHook=function(L,m){if(A($e,L)){if(m!==void 0){const k=N($e[L],m);return k===-1?void 0:W($e[L],k,1)[0]}return j($e[L])}},R.removeHooks=function(L){A($e,L)&&($e[L]=[])},R.removeAllHooks=function(){$e=si()},R}var fu=oi();return Ns=fu,Ns}var mp=self.DOMPurify||(self.DOMPurify=ia().default||ia());const $l=Io(mp);function Oo(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jt=Oo();function Il(e){Jt=e}var Tn={exec:()=>null};function ge(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(Ue.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var Ue={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")},gp=/^(?:[ \t]*(?:\n|$))+/,xp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,bp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,zn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,yp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ro=/(?:[*+-]|\d{1,9}[.)])/,Ol=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Rl=ge(Ol).replace(/bull/g,Ro).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(),wp=ge(Ol).replace(/bull/g,Ro).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(),Mo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,kp=/^[^\n]+/,Lo=/(?!\s*\])(?:\\.|[^\[\]\\])+/,vp=ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Lo).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),jp=ge(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ro).getRegex(),Vr="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",Po=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ep=ge("^ {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",Po).replace("tag",Vr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ml=ge(Mo).replace("hr",zn).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",Vr).getRegex(),Sp=ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ml).getRegex(),Do={blockquote:Sp,code:xp,def:vp,fences:bp,heading:yp,hr:zn,html:Ep,lheading:Rl,list:jp,newline:gp,paragraph:Ml,table:Tn,text:kp},aa=ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",zn).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",Vr).getRegex(),Ap={...Do,lheading:wp,table:aa,paragraph:ge(Mo).replace("hr",zn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",aa).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",Vr).getRegex()},Np={...Do,html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Po).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:Tn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ge(Mo).replace("hr",zn).replace("heading",` *#{1,6} *[^
69
- ]`).replace("lheading",Rl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Tp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,_p=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Ll=/^( {2,}|\\)\n(?!\s*$)/,Cp=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Jr=/[\p{P}\p{S}]/u,Bo=/[\s\p{P}\p{S}]/u,Pl=/[^\s\p{P}\p{S}]/u,$p=ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bo).getRegex(),Dl=/(?!~)[\p{P}\p{S}]/u,Ip=/(?!~)[\s\p{P}\p{S}]/u,Op=/(?:[^\s\p{P}\p{S}]|~)/u,Rp=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Bl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Mp=ge(Bl,"u").replace(/punct/g,Jr).getRegex(),Lp=ge(Bl,"u").replace(/punct/g,Dl).getRegex(),Fl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Pp=ge(Fl,"gu").replace(/notPunctSpace/g,Pl).replace(/punctSpace/g,Bo).replace(/punct/g,Jr).getRegex(),Dp=ge(Fl,"gu").replace(/notPunctSpace/g,Op).replace(/punctSpace/g,Ip).replace(/punct/g,Dl).getRegex(),Bp=ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Pl).replace(/punctSpace/g,Bo).replace(/punct/g,Jr).getRegex(),Fp=ge(/\\(punct)/,"gu").replace(/punct/g,Jr).getRegex(),zp=ge(/^<(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(),Up=ge(Po).replace("(?:-->|$)","-->").getRegex(),Hp=ge("^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",Up).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Mr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Wp=ge(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Mr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zl=ge(/^!?\[(label)\]\[(ref)\]/).replace("label",Mr).replace("ref",Lo).getRegex(),Ul=ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",Lo).getRegex(),Gp=ge("reflink|nolink(?!\\()","g").replace("reflink",zl).replace("nolink",Ul).getRegex(),Fo={_backpedal:Tn,anyPunctuation:Fp,autolink:zp,blockSkip:Rp,br:Ll,code:_p,del:Tn,emStrongLDelim:Mp,emStrongRDelimAst:Pp,emStrongRDelimUnd:Bp,escape:Tp,link:Wp,nolink:Ul,punctuation:$p,reflink:zl,reflinkSearch:Gp,tag:Hp,text:Cp,url:Tn},Kp={...Fo,link:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",Mr).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Mr).getRegex()},eo={...Fo,emStrongRDelimAst:Dp,emStrongLDelim:Lp,url:ge(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Vp={...eo,br:ge(Ll).replace("{2,}","*").getRegex(),text:ge(eo.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},fr={normal:Do,gfm:Ap,pedantic:Np},jn={normal:Fo,gfm:eo,breaks:Vp,pedantic:Kp},Jp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},la=e=>Jp[e];function pt(e,t){if(t){if(Ue.escapeTest.test(e))return e.replace(Ue.escapeReplace,la)}else if(Ue.escapeTestNoEncode.test(e))return e.replace(Ue.escapeReplaceNoEncode,la);return e}function ca(e){try{e=encodeURI(e).replace(Ue.percentDecode,"%")}catch{return null}return e}function ua(e,t){var i;const r=e.replace(Ue.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ue.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(Ue.slashPipe,"|");return n}function En(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 Yp(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 da(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 Xp(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const s=n[1];return t.split(`
66
+ `)}const pp=/^(https?:|data:image\/)/i;function Io(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"||!pp.test(r)?null:{url:r,altText:typeof n=="string"&&n?n:void 0,backgroundColor:typeof s=="string"?s:void 0}}const Il={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},hp=()=>Promise.resolve().then(()=>require("./LogoExtension-BsfaM3h2.cjs"));var mp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Oo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function gp(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}/*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE */var Ts,aa;function la(){if(aa)return Ts;aa=1;function e($,R){(R==null||R>$.length)&&(R=$.length);for(var Y=0,oe=Array(R);Y<R;Y++)oe[Y]=$[Y];return oe}function t($){if(Array.isArray($))return $}function r($,R){var Y=$==null?null:typeof Symbol<"u"&&$[Symbol.iterator]||$["@@iterator"];if(Y!=null){var oe,de,ke,Pe,mn=[],Je=!0,gn=!1;try{if(ke=(Y=Y.call($)).next,R!==0)for(;!(Je=(oe=ke.call(Y)).done)&&(mn.push(oe.value),mn.length!==R);Je=!0);}catch(ns){gn=!0,de=ns}finally{try{if(!Je&&Y.return!=null&&(Pe=Y.return(),Object(Pe)!==Pe))return}finally{if(gn)throw de}}return mn}}function n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
67
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s($,R){return t($)||r($,R)||i($,R)||n()}function i($,R){if($){if(typeof $=="string")return e($,R);var Y={}.toString.call($).slice(8,-1);return Y==="Object"&&$.constructor&&(Y=$.constructor.name),Y==="Map"||Y==="Set"?Array.from($):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e($,R):void 0}}const a=Object.entries,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let f=Object.freeze,p=Object.seal,h=Object.create,g=typeof Reflect<"u"&&Reflect,w=g.apply,y=g.construct;f||(f=function(R){return R}),p||(p=function(R){return R}),w||(w=function(R,Y){for(var oe=arguments.length,de=new Array(oe>2?oe-2:0),ke=2;ke<oe;ke++)de[ke-2]=arguments[ke];return R.apply(Y,de)}),y||(y=function(R){for(var Y=arguments.length,oe=new Array(Y>1?Y-1:0),de=1;de<Y;de++)oe[de-1]=arguments[de];return new R(...oe)});const E=te(Array.prototype.forEach),N=te(Array.prototype.lastIndexOf),j=te(Array.prototype.pop),I=te(Array.prototype.push),W=te(Array.prototype.splice),G=Array.isArray,T=te(String.prototype.toLowerCase),v=te(String.prototype.toString),b=te(String.prototype.match),C=te(String.prototype.replace),B=te(String.prototype.indexOf),_=te(String.prototype.trim),H=te(Number.prototype.toString),Z=te(Boolean.prototype.toString),se=typeof BigInt>"u"?null:te(BigInt.prototype.toString),S=typeof Symbol>"u"?null:te(Symbol.prototype.toString),A=te(Object.prototype.hasOwnProperty),F=te(Object.prototype.toString),J=te(RegExp.prototype.test),ae=Te(TypeError);function te($){return function(R){R instanceof RegExp&&(R.lastIndex=0);for(var Y=arguments.length,oe=new Array(Y>1?Y-1:0),de=1;de<Y;de++)oe[de-1]=arguments[de];return w($,R,oe)}}function Te($){return function(){for(var R=arguments.length,Y=new Array(R),oe=0;oe<R;oe++)Y[oe]=arguments[oe];return y($,Y)}}function q($,R){let Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:T;if(l&&l($,null),!G(R))return $;let oe=R.length;for(;oe--;){let de=R[oe];if(typeof de=="string"){const ke=Y(de);ke!==de&&(c(R)||(R[oe]=ke),de=ke)}$[de]=!0}return $}function ve($){for(let R=0;R<$.length;R++)A($,R)||($[R]=null);return $}function P($){const R=h(null);for(const oe of a($)){var Y=s(oe,2);const de=Y[0],ke=Y[1];A($,de)&&(G(ke)?R[de]=ve(ke):ke&&typeof ke=="object"&&ke.constructor===Object?R[de]=P(ke):R[de]=ke)}return R}function X($){switch(typeof $){case"string":return $;case"number":return H($);case"boolean":return Z($);case"bigint":return se?se($):"0";case"symbol":return S?S($):"Symbol()";case"undefined":return F($);case"function":case"object":{if($===null)return F($);const R=$,Y=O(R,"toString");if(typeof Y=="function"){const oe=Y(R);return typeof oe=="string"?oe:F(oe)}return F($)}default:return F($)}}function O($,R){for(;$!==null;){const oe=d($,R);if(oe){if(oe.get)return te(oe.get);if(typeof oe.value=="function")return te(oe.value)}$=u($)}function Y(){return null}return Y}function ee($){try{return J($,""),!0}catch{return!1}}const le=f(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),K=f(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),pe=f(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),we=f(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fe=f(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Me=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),xe=f(["#text"]),He=f(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Le=f(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Q=f(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),je=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),_e=p(/{{[\w\W]*|^[\w\W]*}}/g),me=p(/<%[\w\W]*|^[\w\W]*%>/g),mt=p(/\${[\w\W]*/g),et=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Lt=p(/^aria-[\-\w]+$/),tt=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),D=p(/^(?:\w+script|data):/i),U=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ne=p(/^html$/i),ue=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Ce=p(/<[/\w!]/g),rt=p(/<[/\w]/g),es=p(/<\/no(script|embed|frames)/i),ts=p(/\/>/i),ut={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},fu=function(){return typeof window>"u"?null:window},pu=function(R,Y){if(typeof R!="object"||typeof R.createPolicy!="function")return null;let oe=null;const de="data-tt-policy-suffix";Y&&Y.hasAttribute(de)&&(oe=Y.getAttribute(de));const ke="dompurify"+(oe?"#"+oe:"");try{return R.createPolicy(ke,{createHTML(Pe){return Pe},createScriptURL(Pe){return Pe}})}catch{return console.warn("TrustedTypes policy "+ke+" could not be created."),null}},ii=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Et=function(R,Y,oe,de){return A(R,Y)&&G(R[Y])?q(de.base?P(de.base):{},R[Y],de.transform):oe};function ai(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:fu();const R=L=>ai(L);if(R.version="3.4.11",R.removed=[],!$||!$.document||$.document.nodeType!==ut.document||!$.Element)return R.isSupported=!1,R;let Y=$.document;const oe=Y,de=oe.currentScript;$.DocumentFragment;const ke=$.HTMLTemplateElement,Pe=$.Node,mn=$.Element,Je=$.NodeFilter,gn=$.NamedNodeMap;gn===void 0&&($.NamedNodeMap||$.MozNamedAttrMap),$.HTMLFormElement;const ns=$.DOMParser,Zn=$.trustedTypes,Pt=mn.prototype,mu=O(Pt,"cloneNode"),li=O(Pt,"remove"),gu=O(Pt,"nextSibling"),xn=O(Pt,"childNodes"),bn=O(Pt,"parentNode"),ci=O(Pt,"shadowRoot"),rs=O(Pt,"attributes"),Ye=Pe&&Pe.prototype?O(Pe.prototype,"nodeType"):null,St=Pe&&Pe.prototype?O(Pe.prototype,"nodeName"):null;if(typeof ke=="function"){const L=Y.createElement("template");L.content&&L.content.ownerDocument&&(Y=L.content.ownerDocument)}let We,Dt="",ss,ui=!1,yn=0;const di=function(){if(yn>0)throw ae('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Xt=function(m){di(),yn++;try{return We.createHTML(m)}finally{yn--}},xu=function(m){di(),yn++;try{return We.createScriptURL(m)}finally{yn--}},bu=function(){return ui||(ss=pu(Zn,de),ui=!0),ss},Qn=Y,os=Qn.implementation,fi=Qn.createNodeIterator,yu=Qn.createDocumentFragment,wu=Qn.getElementsByTagName,ku=oe.importNode;let $e=ii();R.isSupported=typeof a=="function"&&typeof bn=="function"&&os&&os.createHTMLDocument!==void 0;const vu=_e,ju=me,Eu=mt,Su=et,Au=Lt,Nu=D,pi=U,Tu=ue;let hi=tt,Ee=null;const mi=q({},[...le,...K,...pe,...fe,...xe]);let Se=null;const gi=q({},[...He,...Le,...Q,...je]);let Ae=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wn=null,xi=null;const At=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let bi=!0,is=!0,yi=!1,wi=!0,Nt=!1,kn=!0,Bt=!1,as=!1,ls=null,cs=null,us=!1,Zt=!1,qn=!1,er=!1,ki=!0,vi=!1;const ji="user-content-";let ds=!0,fs=!1,Qt={},dt=null;const ps=q({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Ei=null;const Si=q({},["audio","video","img","source","image","track"]);let hs=null;const Ai=q({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),tr="http://www.w3.org/1998/Math/MathML",nr="http://www.w3.org/2000/svg",ft="http://www.w3.org/1999/xhtml";let qt=ft,ms=!1,gs=null;const _u=q({},[tr,nr,ft],v),Ni=f(["mi","mo","mn","ms","mtext"]);let xs=q({},Ni);const Ti=f(["annotation-xml"]);let bs=q({},Ti);const Cu=q({},["title","style","font","a","script"]);let vn=null;const $u=["application/xhtml+xml","text/html"],Iu="text/html";let Ne=null,en=null;const Ou=Y.createElement("form"),_i=function(m){return m instanceof RegExp||m instanceof Function},ys=function(){let m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(en&&en===m)return;(!m||typeof m!="object")&&(m={}),m=P(m),vn=$u.indexOf(m.PARSER_MEDIA_TYPE)===-1?Iu:m.PARSER_MEDIA_TYPE,Ne=vn==="application/xhtml+xml"?v:T,Ee=Et(m,"ALLOWED_TAGS",mi,{transform:Ne}),Se=Et(m,"ALLOWED_ATTR",gi,{transform:Ne}),gs=Et(m,"ALLOWED_NAMESPACES",_u,{transform:v}),hs=Et(m,"ADD_URI_SAFE_ATTR",Ai,{transform:Ne,base:Ai}),Ei=Et(m,"ADD_DATA_URI_TAGS",Si,{transform:Ne,base:Si}),dt=Et(m,"FORBID_CONTENTS",ps,{transform:Ne}),wn=Et(m,"FORBID_TAGS",P({}),{transform:Ne}),xi=Et(m,"FORBID_ATTR",P({}),{transform:Ne}),Qt=A(m,"USE_PROFILES")?m.USE_PROFILES&&typeof m.USE_PROFILES=="object"?P(m.USE_PROFILES):m.USE_PROFILES:!1,bi=m.ALLOW_ARIA_ATTR!==!1,is=m.ALLOW_DATA_ATTR!==!1,yi=m.ALLOW_UNKNOWN_PROTOCOLS||!1,wi=m.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Nt=m.SAFE_FOR_TEMPLATES||!1,kn=m.SAFE_FOR_XML!==!1,Bt=m.WHOLE_DOCUMENT||!1,Zt=m.RETURN_DOM||!1,qn=m.RETURN_DOM_FRAGMENT||!1,er=m.RETURN_TRUSTED_TYPE||!1,us=m.FORCE_BODY||!1,ki=m.SANITIZE_DOM!==!1,vi=m.SANITIZE_NAMED_PROPS||!1,ds=m.KEEP_CONTENT!==!1,fs=m.IN_PLACE||!1,hi=ee(m.ALLOWED_URI_REGEXP)?m.ALLOWED_URI_REGEXP:tt,qt=typeof m.NAMESPACE=="string"?m.NAMESPACE:ft,xs=A(m,"MATHML_TEXT_INTEGRATION_POINTS")&&m.MATHML_TEXT_INTEGRATION_POINTS&&typeof m.MATHML_TEXT_INTEGRATION_POINTS=="object"?P(m.MATHML_TEXT_INTEGRATION_POINTS):q({},Ni),bs=A(m,"HTML_INTEGRATION_POINTS")&&m.HTML_INTEGRATION_POINTS&&typeof m.HTML_INTEGRATION_POINTS=="object"?P(m.HTML_INTEGRATION_POINTS):q({},Ti);const k=A(m,"CUSTOM_ELEMENT_HANDLING")&&m.CUSTOM_ELEMENT_HANDLING&&typeof m.CUSTOM_ELEMENT_HANDLING=="object"?P(m.CUSTOM_ELEMENT_HANDLING):h(null);if(Ae=h(null),A(k,"tagNameCheck")&&_i(k.tagNameCheck)&&(Ae.tagNameCheck=k.tagNameCheck),A(k,"attributeNameCheck")&&_i(k.attributeNameCheck)&&(Ae.attributeNameCheck=k.attributeNameCheck),A(k,"allowCustomizedBuiltInElements")&&typeof k.allowCustomizedBuiltInElements=="boolean"&&(Ae.allowCustomizedBuiltInElements=k.allowCustomizedBuiltInElements),p(Ae),Nt&&(is=!1),qn&&(Zt=!0),Qt&&(Ee=q({},xe),Se=h(null),Qt.html===!0&&(q(Ee,le),q(Se,He)),Qt.svg===!0&&(q(Ee,K),q(Se,Le),q(Se,je)),Qt.svgFilters===!0&&(q(Ee,pe),q(Se,Le),q(Se,je)),Qt.mathMl===!0&&(q(Ee,fe),q(Se,Q),q(Se,je))),At.tagCheck=null,At.attributeCheck=null,A(m,"ADD_TAGS")&&(typeof m.ADD_TAGS=="function"?At.tagCheck=m.ADD_TAGS:G(m.ADD_TAGS)&&(Ee===mi&&(Ee=P(Ee)),q(Ee,m.ADD_TAGS,Ne))),A(m,"ADD_ATTR")&&(typeof m.ADD_ATTR=="function"?At.attributeCheck=m.ADD_ATTR:G(m.ADD_ATTR)&&(Se===gi&&(Se=P(Se)),q(Se,m.ADD_ATTR,Ne))),A(m,"ADD_URI_SAFE_ATTR")&&G(m.ADD_URI_SAFE_ATTR)&&q(hs,m.ADD_URI_SAFE_ATTR,Ne),A(m,"FORBID_CONTENTS")&&G(m.FORBID_CONTENTS)&&(dt===ps&&(dt=P(dt)),q(dt,m.FORBID_CONTENTS,Ne)),A(m,"ADD_FORBID_CONTENTS")&&G(m.ADD_FORBID_CONTENTS)&&(dt===ps&&(dt=P(dt)),q(dt,m.ADD_FORBID_CONTENTS,Ne)),ds&&(Ee["#text"]=!0),Bt&&q(Ee,["html","head","body"]),Ee.table&&(q(Ee,["tbody"]),delete wn.tbody),m.TRUSTED_TYPES_POLICY){if(typeof m.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof m.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const M=We;We=m.TRUSTED_TYPES_POLICY;try{Dt=Xt("")}catch(V){throw We=M,V}}else m.TRUSTED_TYPES_POLICY===null?(We=void 0,Dt=""):(We===void 0&&(We=bu()),We&&typeof Dt=="string"&&(Dt=Xt("")));f&&f(m),en=m},Ci=q({},[...K,...pe,...we]),$i=q({},[...fe,...Me]),Ru=function(m,k,M){return k.namespaceURI===ft?m==="svg":k.namespaceURI===tr?m==="svg"&&(M==="annotation-xml"||xs[M]):!!Ci[m]},Mu=function(m,k,M){return k.namespaceURI===ft?m==="math":k.namespaceURI===nr?m==="math"&&bs[M]:!!$i[m]},Lu=function(m,k,M){return k.namespaceURI===nr&&!bs[M]||k.namespaceURI===tr&&!xs[M]?!1:!$i[m]&&(Cu[m]||!Ci[m])},Pu=function(m){let k=bn(m);(!k||!k.tagName)&&(k={namespaceURI:qt,tagName:"template"});const M=T(m.tagName),V=T(k.tagName);return gs[m.namespaceURI]?m.namespaceURI===nr?Ru(M,k,V):m.namespaceURI===tr?Mu(M,k,V):m.namespaceURI===ft?Lu(M,k,V):!!(vn==="application/xhtml+xml"&&gs[m.namespaceURI]):!1},Tt=function(m){I(R.removed,{element:m});try{bn(m).removeChild(m)}catch{if(li(m),!bn(m))throw ae("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Ii=function(m){const k=xn(m);if(k){const V=[];E(k,ce=>{I(V,ce)}),E(V,ce=>{try{li(ce)}catch{}})}const M=rs(m);if(M)for(let V=M.length-1;V>=0;--V){const ce=M[V],he=ce&&ce.name;if(typeof he=="string")try{m.removeAttribute(he)}catch{}}},Ft=function(m,k){try{I(R.removed,{attribute:k.getAttributeNode(m),from:k})}catch{I(R.removed,{attribute:null,from:k})}if(k.removeAttribute(m),m==="is")if(Zt||qn)try{Tt(k)}catch{}else try{k.setAttribute(m,"")}catch{}},Du=function(m){const k=rs(m);if(k)for(let M=k.length-1;M>=0;--M){const V=k[M],ce=V&&V.name;if(!(typeof ce!="string"||Se[Ne(ce)]))try{m.removeAttribute(ce)}catch{}}},Bu=function(m){const k=[m];for(;k.length>0;){const M=k.pop();(Ye?Ye(M):M.nodeType)===ut.element&&Du(M);const ce=xn(M);if(ce)for(let he=ce.length-1;he>=0;--he)k.push(ce[he])}},Oi=function(m){let k=null,M=null;if(us)m="<remove></remove>"+m;else{const he=b(m,/^[\r\n\t ]+/);M=he&&he[0]}vn==="application/xhtml+xml"&&qt===ft&&(m='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+m+"</body></html>");const V=We?Xt(m):m;if(qt===ft)try{k=new ns().parseFromString(V,vn)}catch{}if(!k||!k.documentElement){k=os.createDocument(qt,"template",null);try{k.documentElement.innerHTML=ms?Dt:V}catch{}}const ce=k.body||k.documentElement;return m&&M&&ce.insertBefore(Y.createTextNode(M),ce.childNodes[0]||null),qt===ft?wu.call(k,Bt?"html":"body")[0]:Bt?k.documentElement:ce},Ri=function(m){return fi.call(m.ownerDocument||m,m,Je.SHOW_ELEMENT|Je.SHOW_COMMENT|Je.SHOW_TEXT|Je.SHOW_PROCESSING_INSTRUCTION|Je.SHOW_CDATA_SECTION,null)},rr=function(m){return m=C(m,vu," "),m=C(m,ju," "),m=C(m,Eu," "),m},ws=function(m){var k;m.normalize();const M=fi.call(m.ownerDocument||m,m,Je.SHOW_TEXT|Je.SHOW_COMMENT|Je.SHOW_CDATA_SECTION|Je.SHOW_PROCESSING_INSTRUCTION,null);let V=M.nextNode();for(;V;)V.data=rr(V.data),V=M.nextNode();const ce=(k=m.querySelectorAll)===null||k===void 0?void 0:k.call(m,"template");ce&&E(ce,he=>{tn(he.content)&&ws(he.content)})},sr=function(m){const k=St?St(m):null;return typeof k!="string"||Ne(k)!=="form"?!1:typeof m.nodeName!="string"||typeof m.textContent!="string"||typeof m.removeChild!="function"||m.attributes!==rs(m)||typeof m.removeAttribute!="function"||typeof m.setAttribute!="function"||typeof m.namespaceURI!="string"||typeof m.insertBefore!="function"||typeof m.hasChildNodes!="function"||m.nodeType!==Ye(m)||m.childNodes!==xn(m)},tn=function(m){if(!Ye||typeof m!="object"||m===null)return!1;try{return Ye(m)===ut.documentFragment}catch{return!1}},jn=function(m){if(!Ye||typeof m!="object"||m===null)return!1;try{return typeof Ye(m)=="number"}catch{return!1}};function gt(L,m,k){L.length!==0&&E(L,M=>{M.call(R,m,k,en)})}const Fu=function(m,k){return!!(kn&&m.hasChildNodes()&&!jn(m.firstElementChild)&&J(Ce,m.textContent)&&J(Ce,m.innerHTML)||kn&&m.namespaceURI===ft&&k==="style"&&jn(m.firstElementChild)||m.nodeType===ut.processingInstruction||kn&&m.nodeType===ut.comment&&J(rt,m.data))},zu=function(m,k){if(!wn[k]&&Pi(k)&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,k)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(k)))return!1;if(ds&&!dt[k]){const M=bn(m),V=xn(m);if(V&&M){const ce=V.length;for(let he=ce-1;he>=0;--he){const Re=fs?V[he]:mu(V[he],!0);M.insertBefore(Re,gu(m))}}}return Tt(m),!0},Mi=function(m){if(gt($e.beforeSanitizeElements,m,null),sr(m))return Tt(m),!0;const k=Ne(St?St(m):m.nodeName);if(gt($e.uponSanitizeElement,m,{tagName:k,allowedTags:Ee}),Fu(m,k))return Tt(m),!0;if(wn[k]||!(At.tagCheck instanceof Function&&At.tagCheck(k))&&!Ee[k])return zu(m,k);if((Ye?Ye(m):m.nodeType)===ut.element&&!Pu(m)||(k==="noscript"||k==="noembed"||k==="noframes")&&J(es,m.innerHTML))return Tt(m),!0;if(Nt&&m.nodeType===ut.text){const V=rr(m.textContent);m.textContent!==V&&(I(R.removed,{element:m.cloneNode()}),m.textContent=V)}return gt($e.afterSanitizeElements,m,null),!1},Li=function(m,k,M){if(xi[k]||ki&&(k==="id"||k==="name")&&(M in Y||M in Ou))return!1;const V=Se[k]||At.attributeCheck instanceof Function&&At.attributeCheck(k,m);if(!(is&&J(Su,k))){if(!(bi&&J(Au,k))){if(V){if(!hs[k]){if(!J(hi,C(M,pi,""))){if(!((k==="src"||k==="xlink:href"||k==="href")&&m!=="script"&&B(M,"data:")===0&&Ei[m])){if(!(yi&&!J(Nu,C(M,pi,"")))){if(M)return!1}}}}}else if(!(Pi(m)&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,m)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(m))&&(Ae.attributeNameCheck instanceof RegExp&&J(Ae.attributeNameCheck,k)||Ae.attributeNameCheck instanceof Function&&Ae.attributeNameCheck(k,m))||k==="is"&&Ae.allowCustomizedBuiltInElements&&(Ae.tagNameCheck instanceof RegExp&&J(Ae.tagNameCheck,M)||Ae.tagNameCheck instanceof Function&&Ae.tagNameCheck(M))))return!1}}return!0},Uu=q({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Pi=function(m){return!Uu[T(m)]&&J(Tu,m)},Hu=function(m,k,M,V){if(We&&typeof Zn=="object"&&typeof Zn.getAttributeType=="function"&&!M)switch(Zn.getAttributeType(m,k)){case"TrustedHTML":return Xt(V);case"TrustedScriptURL":return xu(V)}return V},Wu=function(m,k,M,V){try{M?m.setAttributeNS(M,k,V):m.setAttribute(k,V),sr(m)?Tt(m):j(R.removed)}catch{Ft(k,m)}},Di=function(m){gt($e.beforeSanitizeAttributes,m,null);const k=m.attributes;if(!k||sr(m))return;const M={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Se,forceKeepAttr:void 0};let V=k.length;const ce=Ne(m.nodeName);for(;V--;){const he=k[V],Re=he.name,Oe=he.namespaceURI,nt=he.value,st=Ne(Re),vs=nt;let Fe=Re==="value"?vs:_(vs);if(M.attrName=st,M.attrValue=Fe,M.keepAttr=!0,M.forceKeepAttr=void 0,gt($e.uponSanitizeAttribute,m,M),Fe=M.attrValue,vi&&(st==="id"||st==="name")&&B(Fe,ji)!==0&&(Ft(Re,m),Fe=ji+Fe),kn&&J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Fe)){Ft(Re,m);continue}if(st==="attributename"&&b(Fe,"href")){Ft(Re,m);continue}if(!M.forceKeepAttr){if(!M.keepAttr){Ft(Re,m);continue}if(!wi&&J(ts,Fe)){Ft(Re,m);continue}if(Nt&&(Fe=rr(Fe)),!Li(ce,st,Fe)){Ft(Re,m);continue}Fe=Hu(ce,st,Oe,Fe),Fe!==vs&&Wu(m,Re,Oe,Fe)}}gt($e.afterSanitizeAttributes,m,null)},or=function(m){let k=null;const M=Ri(m);for(gt($e.beforeSanitizeShadowDOM,m,null);k=M.nextNode();)if(gt($e.uponSanitizeShadowNode,k,null),Mi(k),Di(k),tn(k.content)&&or(k.content),(Ye?Ye(k):k.nodeType)===ut.element){const ce=ci(k);tn(ce)&&(ks(ce),or(ce))}gt($e.afterSanitizeShadowDOM,m,null)},ks=function(m){const k=[{node:m,shadow:null}];for(;k.length>0;){const M=k.pop();if(M.shadow){or(M.shadow);continue}const V=M.node,he=(Ye?Ye(V):V.nodeType)===ut.element,Re=xn(V);if(Re)for(let Oe=Re.length-1;Oe>=0;--Oe)k.push({node:Re[Oe],shadow:null});if(he){const Oe=St?St(V):null;if(typeof Oe=="string"&&Ne(Oe)==="template"){const nt=V.content;tn(nt)&&k.push({node:nt,shadow:null})}}if(he){const Oe=ci(V);tn(Oe)&&k.push({node:null,shadow:Oe},{node:Oe,shadow:null})}}};return R.sanitize=function(L){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=null,M=null,V=null,ce=null;if(ms=!L,ms&&(L="<!-->"),typeof L!="string"&&!jn(L)&&(L=X(L),typeof L!="string"))throw ae("dirty is not a string, aborting");if(!R.isSupported)return L;as?(Ee=ls,Se=cs):ys(m),($e.uponSanitizeElement.length>0||$e.uponSanitizeAttribute.length>0)&&(Ee=P(Ee)),$e.uponSanitizeAttribute.length>0&&(Se=P(Se)),R.removed=[];const he=fs&&typeof L!="string"&&jn(L);if(he){const nt=St?St(L):L.nodeName;if(typeof nt=="string"){const st=Ne(nt);if(!Ee[st]||wn[st])throw ae("root node is forbidden and cannot be sanitized in-place")}if(sr(L))throw ae("root node is clobbered and cannot be sanitized in-place");try{ks(L)}catch(st){throw Ii(L),st}}else if(jn(L))k=Oi("<!---->"),M=k.ownerDocument.importNode(L,!0),M.nodeType===ut.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?k=M:k.appendChild(M),ks(M);else{if(!Zt&&!Nt&&!Bt&&L.indexOf("<")===-1)return We&&er?Xt(L):L;if(k=Oi(L),!k)return Zt?null:er?Dt:""}k&&us&&Tt(k.firstChild);const Re=Ri(he?L:k);try{for(;V=Re.nextNode();)Mi(V),Di(V),tn(V.content)&&or(V.content)}catch(nt){throw he&&Ii(L),nt}if(he)return E(R.removed,nt=>{nt.element&&Bu(nt.element)}),Nt&&ws(L),L;if(Zt){if(Nt&&ws(k),qn)for(ce=yu.call(k.ownerDocument);k.firstChild;)ce.appendChild(k.firstChild);else ce=k;return(Se.shadowroot||Se.shadowrootmode)&&(ce=ku.call(oe,ce,!0)),ce}let Oe=Bt?k.outerHTML:k.innerHTML;return Bt&&Ee["!doctype"]&&k.ownerDocument&&k.ownerDocument.doctype&&k.ownerDocument.doctype.name&&J(ne,k.ownerDocument.doctype.name)&&(Oe="<!DOCTYPE "+k.ownerDocument.doctype.name+`>
68
+ `+Oe),Nt&&(Oe=rr(Oe)),We&&er?Xt(Oe):Oe},R.setConfig=function(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ys(L),as=!0,ls=Ee,cs=Se},R.clearConfig=function(){en=null,as=!1,ls=null,cs=null,We=ss,Dt=""},R.isValidAttribute=function(L,m,k){en||ys({});const M=Ne(L),V=Ne(m);return Li(M,V,k)},R.addHook=function(L,m){typeof m=="function"&&A($e,L)&&I($e[L],m)},R.removeHook=function(L,m){if(A($e,L)){if(m!==void 0){const k=N($e[L],m);return k===-1?void 0:W($e[L],k,1)[0]}return j($e[L])}},R.removeHooks=function(L){A($e,L)&&($e[L]=[])},R.removeAllHooks=function(){$e=ii()},R}var hu=ai();return Ts=hu,Ts}var xp=self.DOMPurify||(self.DOMPurify=la().default||la());const Ol=Oo(xp);function Ro(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Jt=Ro();function Rl(e){Jt=e}var Cn={exec:()=>null};function ge(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(Ue.caret,"$1"),r=r.replace(s,a),n},getRegex:()=>new RegExp(r,t)};return n}var Ue={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")},bp=/^(?:[ \t]*(?:\n|$))+/,yp=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,wp=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Un=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,kp=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mo=/(?:[*+-]|\d{1,9}[.)])/,Ml=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ll=ge(Ml).replace(/bull/g,Mo).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(),vp=ge(Ml).replace(/bull/g,Mo).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(),Lo=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,jp=/^[^\n]+/,Po=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Ep=ge(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Po).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Sp=ge(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Mo).getRegex(),Wr="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",Do=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ap=ge("^ {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",Do).replace("tag",Wr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Pl=ge(Lo).replace("hr",Un).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",Wr).getRegex(),Np=ge(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Pl).getRegex(),Bo={blockquote:Np,code:yp,def:Ep,fences:wp,heading:kp,hr:Un,html:Ap,lheading:Ll,list:Sp,newline:bp,paragraph:Pl,table:Cn,text:jp},ca=ge("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Un).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",Wr).getRegex(),Tp={...Bo,lheading:vp,table:ca,paragraph:ge(Lo).replace("hr",Un).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",ca).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",Wr).getRegex()},_p={...Bo,html:ge(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Do).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:Cn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ge(Lo).replace("hr",Un).replace("heading",` *#{1,6} *[^
69
+ ]`).replace("lheading",Ll).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Cp=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,$p=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Dl=/^( {2,}|\\)\n(?!\s*$)/,Ip=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Gr=/[\p{P}\p{S}]/u,Fo=/[\s\p{P}\p{S}]/u,Bl=/[^\s\p{P}\p{S}]/u,Op=ge(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Fo).getRegex(),Fl=/(?!~)[\p{P}\p{S}]/u,Rp=/(?!~)[\s\p{P}\p{S}]/u,Mp=/(?:[^\s\p{P}\p{S}]|~)/u,Lp=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,zl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Pp=ge(zl,"u").replace(/punct/g,Gr).getRegex(),Dp=ge(zl,"u").replace(/punct/g,Fl).getRegex(),Ul="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Bp=ge(Ul,"gu").replace(/notPunctSpace/g,Bl).replace(/punctSpace/g,Fo).replace(/punct/g,Gr).getRegex(),Fp=ge(Ul,"gu").replace(/notPunctSpace/g,Mp).replace(/punctSpace/g,Rp).replace(/punct/g,Fl).getRegex(),zp=ge("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Bl).replace(/punctSpace/g,Fo).replace(/punct/g,Gr).getRegex(),Up=ge(/\\(punct)/,"gu").replace(/punct/g,Gr).getRegex(),Hp=ge(/^<(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(),Wp=ge(Do).replace("(?:-->|$)","-->").getRegex(),Gp=ge("^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",Wp).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ir=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Kp=ge(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Ir).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hl=ge(/^!?\[(label)\]\[(ref)\]/).replace("label",Ir).replace("ref",Po).getRegex(),Wl=ge(/^!?\[(ref)\](?:\[\])?/).replace("ref",Po).getRegex(),Vp=ge("reflink|nolink(?!\\()","g").replace("reflink",Hl).replace("nolink",Wl).getRegex(),zo={_backpedal:Cn,anyPunctuation:Up,autolink:Hp,blockSkip:Lp,br:Dl,code:$p,del:Cn,emStrongLDelim:Pp,emStrongRDelimAst:Bp,emStrongRDelimUnd:zp,escape:Cp,link:Kp,nolink:Wl,punctuation:Op,reflink:Hl,reflinkSearch:Vp,tag:Gp,text:Ip,url:Cn},Jp={...zo,link:ge(/^!?\[(label)\]\((.*?)\)/).replace("label",Ir).getRegex(),reflink:ge(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Ir).getRegex()},no={...zo,emStrongRDelimAst:Fp,emStrongLDelim:Dp,url:ge(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},Yp={...no,br:ge(Dl).replace("{2,}","*").getRegex(),text:ge(no.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},cr={normal:Bo,gfm:Tp,pedantic:_p},Sn={normal:zo,gfm:no,breaks:Yp,pedantic:Jp},Xp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ua=e=>Xp[e];function pt(e,t){if(t){if(Ue.escapeTest.test(e))return e.replace(Ue.escapeReplace,ua)}else if(Ue.escapeTestNoEncode.test(e))return e.replace(Ue.escapeReplaceNoEncode,ua);return e}function da(e){try{e=encodeURI(e).replace(Ue.percentDecode,"%")}catch{return null}return e}function fa(e,t){var i;const r=e.replace(Ue.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),n=r.split(Ue.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(Ue.slashPipe,"|");return n}function An(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 Zp(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 pa(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 Qp(e,t,r){const n=e.match(r.other.indentCodeCompensation);if(n===null)return t;const s=n[1];return t.split(`
70
70
  `).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(`
71
- `)}var Lr=class{constructor(e){be(this,"options");be(this,"rules");be(this,"lexer");this.options=e||Jt}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:En(r,`
72
- `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=Xp(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=En(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:En(t[0],`
73
- `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=En(t[0],`
71
+ `)}var Or=class{constructor(e){be(this,"options");be(this,"rules");be(this,"lexer");this.options=e||Jt}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:An(r,`
72
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const r=t[0],n=Qp(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=An(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:An(t[0],`
73
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let r=An(t[0],`
74
74
  `).split(`
75
75
  `),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(`
76
76
  `),d=u.replace(this.rules.other.blockquoteSetextReplace,`
@@ -88,9 +88,9 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
88
88
  `,1)[0];let T;if(p=G,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),T=p):T=p.replace(this.rules.other.tabCharGlobal," "),j.test(p)||I.test(p)||W.test(p)||E.test(p)||N.test(p))break;if(T.search(this.rules.other.nonSpaceChar)>=g||!p.trim())d+=`
89
89
  `+T.slice(g);else{if(h||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||j.test(f)||I.test(f)||N.test(f))break;d+=`
90
90
  `+p}!h&&!p.trim()&&(h=!0),u+=G+`
91
- `,e=e.substring(G.length+1),f=T.slice(g)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let w=null,y;this.options.gfm&&(w=this.rules.other.listIsTask.exec(d),w&&(y=w[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!w,checked:y,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=ua(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(`
92
- `):[],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(ua(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)===`
93
- `?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=En(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=Yp(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)),da(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 da(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 g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}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}}}},wt=class to{constructor(t){be(this,"tokens");be(this,"options");be(this,"state");be(this,"tokenizer");be(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jt,this.options.tokenizer=this.options.tokenizer||new Lr,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:Ue,block:fr.normal,inline:jn.normal};this.options.pedantic?(r.block=fr.pedantic,r.inline=jn.pedantic):this.options.gfm&&(r.block=fr.gfm,this.options.breaks?r.inline=jn.breaks:r.inline=jn.gfm),this.tokenizer.rules=r}static get rules(){return{block:fr,inline:jn}}static lex(t,r){return new to(r).lex(t)}static lexInline(t,r){return new to(r).inlineTokens(t)}lex(t){t=t.replace(Ue.carriageReturn,`
91
+ `,e=e.substring(G.length+1),f=T.slice(g)}}s.loose||(a?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let w=null,y;this.options.gfm&&(w=this.rules.other.listIsTask.exec(d),w&&(y=w[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!w,checked:y,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=fa(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(`
92
+ `):[],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(fa(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)===`
93
+ `?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=An(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{const i=Zp(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)),pa(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 pa(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 g=p.slice(1,-1);return{type:"em",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}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}}}},wt=class ro{constructor(t){be(this,"tokens");be(this,"options");be(this,"state");be(this,"tokenizer");be(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Jt,this.options.tokenizer=this.options.tokenizer||new Or,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:Ue,block:cr.normal,inline:Sn.normal};this.options.pedantic?(r.block=cr.pedantic,r.inline=Sn.pedantic):this.options.gfm&&(r.block=cr.gfm,this.options.breaks?r.inline=Sn.breaks:r.inline=Sn.gfm),this.tokenizer.rules=r}static get rules(){return{block:cr,inline:Sn}}static lex(t,r){return new ro(r).lex(t)}static lexInline(t,r){return new ro(r).inlineTokens(t)}lex(t){t=t.replace(Ue.carriageReturn,`
94
94
  `),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(Ue.tabCharGlobal," ").replace(Ue.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+=`
95
95
  `: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+=`
96
96
  `+l.raw,u.text+=`
@@ -100,7 +100,7 @@ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
100
100
  `+l.raw,u.text+=`
101
101
  `+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+=`
102
102
  `+l.raw,u.text+=`
103
- `+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 g;this.options.extensions.startInline.forEach(w=>{g=w.call({lexer:this},h),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),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}},Pr=class{constructor(e){be(this,"options");be(this,"parser");this.options=e||Jt}space(e){return""}code({text:e,lang:t,escaped:r}){var i;const n=(i=(t||"").match(Ue.notSpaceStart))==null?void 0:i[0],s=e.replace(Ue.endingNewline,"")+`
103
+ `+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 g;this.options.extensions.startInline.forEach(w=>{g=w.call({lexer:this},h),typeof g=="number"&&g>=0&&(p=Math.min(p,g))}),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}},Rr=class{constructor(e){be(this,"options");be(this,"parser");this.options=e||Jt}space(e){return""}code({text:e,lang:t,escaped:r}){var i;const n=(i=(t||"").match(Ue.notSpaceStart))==null?void 0:i[0],s=e.replace(Ue.endingNewline,"")+`
104
104
  `;return n?'<pre><code class="language-'+pt(n)+'">'+(r?s:pt(s,!0))+`</code></pre>
105
105
  `:"<pre><code>"+(r?s:pt(s,!0))+`</code></pre>
106
106
  `}blockquote({tokens:e}){return`<blockquote>
@@ -118,63 +118,63 @@ ${this.parser.parse(e)}</blockquote>
118
118
  `}tablerow({text:e}){return`<tr>
119
119
  ${e}</tr>
120
120
  `}tablecell(e){const t=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+t+`</${r}>
121
- `}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>${pt(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=ca(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+pt(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=ca(e);if(s===null)return pt(r);e=s;let i=`<img src="${e}" alt="${r}"`;return t&&(i+=` title="${pt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:pt(e.text)}},zo=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""}},kt=class no{constructor(t){be(this,"options");be(this,"renderer");be(this,"textRenderer");this.options=t||Jt,this.options.renderer=this.options.renderer||new Pr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zo}static parse(t,r){return new no(r).parse(t)}static parseInline(t,r){return new no(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+=`
122
- `+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}},Ds,Ar=(Ds=class{constructor(e){be(this,"options");be(this,"block");this.options=e||Jt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?wt.lex:wt.lexInline}provideParser(){return this.block?kt.parse:kt.parseInline}},be(Ds,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Ds),Hl=class{constructor(...e){be(this,"defaults",Oo());be(this,"options",this.setOptions);be(this,"parse",this.parseMarkdown(!0));be(this,"parseInline",this.parseMarkdown(!1));be(this,"Parser",kt);be(this,"Renderer",Pr);be(this,"TextRenderer",zo);be(this,"Lexer",wt);be(this,"Tokenizer",Lr);be(this,"Hooks",Ar);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 Pr(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 Lr(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 Ar;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];Ar.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 wt.lex(e,t??this.defaults)}parser(e,t){return kt.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?wt.lex:wt.lexInline,c=i.hooks?i.hooks.provideParser():e?kt.parse:kt.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+=`
123
- Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+pt(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Wt=new Hl;function ye(e,t){return Wt.parse(e,t)}ye.options=ye.setOptions=function(e){return Wt.setOptions(e),ye.defaults=Wt.defaults,Il(ye.defaults),ye};ye.getDefaults=Oo;ye.defaults=Jt;ye.use=function(...e){return Wt.use(...e),ye.defaults=Wt.defaults,Il(ye.defaults),ye};ye.walkTokens=function(e,t){return Wt.walkTokens(e,t)};ye.parseInline=Wt.parseInline;ye.Parser=kt;ye.parser=kt.parse;ye.Renderer=Pr;ye.TextRenderer=zo;ye.Lexer=wt;ye.lexer=wt.lex;ye.Tokenizer=Lr;ye.Hooks=Ar;ye.parse=ye;ye.options;ye.setOptions;ye.use;ye.walkTokens;ye.parseInline;kt.parse;wt.lex;function Zp(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=fa(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,r,t.lang||"")).then(pa(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.");pa(t)(n)},useNewRenderer:!0,renderer:{code(t,r,n){typeof t=="object"&&(n=t.escaped,r=t.lang,t=t.text);const s=fa(r),i=s?e.langPrefix+ma(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${n?t:ma(t,!0)}
124
- </code></pre>`}}}}function fa(e){return(e||"").match(/\S*/)[0]}function pa(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Wl=/[&<>"']/,Qp=new RegExp(Wl.source,"g"),Gl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,qp=new RegExp(Gl.source,"g"),eh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ha=e=>eh[e];function ma(e,t){if(t){if(Wl.test(e))return e.replace(Qp,ha)}else if(Gl.test(e))return e.replace(qp,ha);return e}function Kl(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)&&Kl(r)}),e}class ga{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Vl(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Ct(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 th="</span>",xa=e=>!!e.scope,nh=(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 rh{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Vl(t)}openNode(t){if(!xa(t))return;const r=nh(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){xa(t)&&(this.buffer+=th)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const ba=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Uo{constructor(){this.rootNode=ba(),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=ba({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=>{Uo._collapse(r)}))}}class sh extends Uo{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 rh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Mn(e){return e?typeof e=="string"?e:e.source:null}function Jl(e){return Yt("(?=",e,")")}function oh(e){return Yt("(?:",e,")*")}function ih(e){return Yt("(?:",e,")?")}function Yt(...e){return e.map(r=>Mn(r)).join("")}function ah(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Ho(...e){return"("+(ah(e).capture?"":"?:")+e.map(n=>Mn(n)).join("|")+")"}function Yl(e){return new RegExp(e.toString()+"|").exec("").length-1}function lh(e,t){const r=e&&e.exec(t);return r&&r.index===0}const ch=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Wo(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const s=r;let i=Mn(n),a="";for(;i.length>0;){const l=ch.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 uh=/\b\B/,Xl="[a-zA-Z]\\w*",Go="[a-zA-Z_]\\w*",Zl="\\b\\d+(\\.\\d+)?",Ql="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ql="\\b(0b[01]+)",dh="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",fh=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Yt(t,/.*\b/,e.binary,/\b.*/)),Ct({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},Ln={begin:"\\\\[\\s\\S]",relevance:0},ph={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ln]},hh={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ln]},mh={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/},Yr=function(e,t,r={}){const n=Ct({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=Ho("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:Yt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},gh=Yr("//","$"),xh=Yr("/\\*","\\*/"),bh=Yr("#","$"),yh={scope:"number",begin:Zl,relevance:0},wh={scope:"number",begin:Ql,relevance:0},kh={scope:"number",begin:ql,relevance:0},vh={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ln,{begin:/\[/,end:/\]/,relevance:0,contains:[Ln]}]},jh={scope:"title",begin:Xl,relevance:0},Eh={scope:"title",begin:Go,relevance:0},Sh={begin:"\\.\\s*"+Go,relevance:0},Ah=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 pr=Object.freeze({__proto__:null,APOS_STRING_MODE:ph,BACKSLASH_ESCAPE:Ln,BINARY_NUMBER_MODE:kh,BINARY_NUMBER_RE:ql,COMMENT:Yr,C_BLOCK_COMMENT_MODE:xh,C_LINE_COMMENT_MODE:gh,C_NUMBER_MODE:wh,C_NUMBER_RE:Ql,END_SAME_AS_BEGIN:Ah,HASH_COMMENT_MODE:bh,IDENT_RE:Xl,MATCH_NOTHING_RE:uh,METHOD_GUARD:Sh,NUMBER_MODE:yh,NUMBER_RE:Zl,PHRASAL_WORDS_MODE:mh,QUOTE_STRING_MODE:hh,REGEXP_MODE:vh,RE_STARTERS_RE:dh,SHEBANG:fh,TITLE_MODE:jh,UNDERSCORE_IDENT_RE:Go,UNDERSCORE_TITLE_MODE:Eh});function Nh(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Th(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function _h(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Nh,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Ch(e,t){Array.isArray(e.illegal)&&(e.illegal=Ho(...e.illegal))}function $h(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 Ih(e,t){e.relevance===void 0&&(e.relevance=1)}const Oh=(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=Yt(r.beforeMatch,Jl(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Rh=["of","and","for","in","not","or","if","then","parent","list","value"],Mh="keyword";function ec(e,t,r=Mh){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,ec(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,Lh(c[0],c[1])]})}}function Lh(e,t){return t?Number(t):Ph(e)?0:1}function Ph(e){return Rh.includes(e.toLowerCase())}const ya={},Ht=e=>{console.error(e)},wa=(e,...t)=>{console.log(`WARN: ${e}`,...t)},nn=(e,t)=>{ya[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ya[`${e}/${t}`]=!0)},Dr=new Error;function tc(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+=Yl(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Dh(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Dr;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ht("beginScope must be object"),Dr;tc(e,e.begin,{key:"beginScope"}),e.begin=Wo(e.begin,{joinWith:""})}}function Bh(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Dr;if(typeof e.endScope!="object"||e.endScope===null)throw Ht("endScope must be object"),Dr;tc(e,e.end,{key:"endScope"}),e.end=Wo(e.end,{joinWith:""})}}function Fh(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function zh(e){Fh(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Dh(e),Bh(e)}function Uh(e){function t(a,l){return new RegExp(Mn(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+=Yl(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(Wo(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;[Th,$h,zh,Oh].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[_h,Ch,Ih].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=ec(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=Mn(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 Hh(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=Ct(e.classNameAliases||{}),i(e)}function nc(e){return e?e.endsWithParent||nc(e.starts):!1}function Hh(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ct(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:nc(e)?Ct(e,{starts:e.starts?Ct(e.starts):null}):Object.isFrozen(e)?Ct(e):e}var Wh="11.11.1";class Gh extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const Ts=Vl,ka=Ct,va=Symbol("nomatch"),Kh=7,rc=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:sh};function c(S){return l.noHighlightRe.test(S)}function u(S){let A=S.className+" ";A+=S.parentNode?S.parentNode.className:"";const F=l.languageDetectRe.exec(A);if(F){const J=v(F[1]);return J||(wa(i.replace("{}",F[1])),wa("Falling back to no-highlight mode for this block.",S)),J?F[1]:"no-highlight"}return A.split(/\s+/).find(J=>c(J)||v(J))}function d(S,A,F){let J="",ae="";typeof A=="object"?(J=S,F=A.ignoreIllegals,ae=A.language):(nn("10.7.0","highlight(lang, code, ...args) has been deprecated."),nn("10.7.0",`Please use highlight(code, options) instead.
125
- https://github.com/highlightjs/highlight.js/issues/2277`),ae=S,J=A),F===void 0&&(F=!0);const te={code:J,language:ae};Z("before:highlight",te);const Te=te.result?te.result:f(te.language,te.code,F);return Te.code=te.code,Z("after:highlight",Te),Te}function f(S,A,F,J){const ae=Object.create(null);function te(D,U){return D.keywords[U]}function Te(){if(!Q.keywords){_e.addText(me);return}let D=0;Q.keywordPatternRe.lastIndex=0;let U=Q.keywordPatternRe.exec(me),ne="";for(;U;){ne+=me.substring(D,U.index);const ue=xe.case_insensitive?U[0].toLowerCase():U[0],Ce=te(Q,ue);if(Ce){const[rt,qr]=Ce;if(_e.addText(ne),ne="",ae[ue]=(ae[ue]||0)+1,ae[ue]<=Kh&&(mt+=qr),rt.startsWith("_"))ne+=U[0];else{const es=xe.classNameAliases[rt]||rt;P(U[0],es)}}else ne+=U[0];D=Q.keywordPatternRe.lastIndex,U=Q.keywordPatternRe.exec(me)}ne+=me.substring(D),_e.addText(ne)}function q(){if(me==="")return;let D=null;if(typeof Q.subLanguage=="string"){if(!t[Q.subLanguage]){_e.addText(me);return}D=f(Q.subLanguage,me,!0,je[Q.subLanguage]),je[Q.subLanguage]=D._top}else D=h(me,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(mt+=D.relevance),_e.__addSublanguage(D._emitter,D.language)}function ve(){Q.subLanguage!=null?q():Te(),me=""}function P(D,U){D!==""&&(_e.startScope(U),_e.addText(D),_e.endScope())}function X(D,U){let ne=1;const ue=U.length-1;for(;ne<=ue;){if(!D._emit[ne]){ne++;continue}const Ce=xe.classNameAliases[D[ne]]||D[ne],rt=U[ne];Ce?P(rt,Ce):(me=rt,Te(),me=""),ne++}}function O(D,U){return D.scope&&typeof D.scope=="string"&&_e.openNode(xe.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(P(me,xe.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),me=""):D.beginScope._multi&&(X(D.beginScope,U),me="")),Q=Object.create(D,{parent:{value:Q}}),Q}function ee(D,U,ne){let ue=lh(D.endRe,ne);if(ue){if(D["on:end"]){const Ce=new ga(D);D["on:end"](U,Ce),Ce.isMatchIgnored&&(ue=!1)}if(ue){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return ee(D.parent,U,ne)}function le(D){return Q.matcher.regexIndex===0?(me+=D[0],1):(tt=!0,0)}function K(D){const U=D[0],ne=D.rule,ue=new ga(ne),Ce=[ne.__beforeBegin,ne["on:begin"]];for(const rt of Ce)if(rt&&(rt(D,ue),ue.isMatchIgnored))return le(U);return ne.skip?me+=U:(ne.excludeBegin&&(me+=U),ve(),!ne.returnBegin&&!ne.excludeBegin&&(me=U)),O(ne,D),ne.returnBegin?0:U.length}function pe(D){const U=D[0],ne=A.substring(D.index),ue=ee(Q,D,ne);if(!ue)return va;const Ce=Q;Q.endScope&&Q.endScope._wrap?(ve(),P(U,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(ve(),X(Q.endScope,D)):Ce.skip?me+=U:(Ce.returnEnd||Ce.excludeEnd||(me+=U),ve(),Ce.excludeEnd&&(me=U));do Q.scope&&_e.closeNode(),!Q.skip&&!Q.subLanguage&&(mt+=Q.relevance),Q=Q.parent;while(Q!==ue.parent);return ue.starts&&O(ue.starts,D),Ce.returnEnd?0:U.length}function we(){const D=[];for(let U=Q;U!==xe;U=U.parent)U.scope&&D.unshift(U.scope);D.forEach(U=>_e.openNode(U))}let fe={};function Me(D,U){const ne=U&&U[0];if(me+=D,ne==null)return ve(),0;if(fe.type==="begin"&&U.type==="end"&&fe.index===U.index&&ne===""){if(me+=A.slice(U.index,U.index+1),!s){const ue=new Error(`0 width match regex (${S})`);throw ue.languageName=S,ue.badRule=fe.rule,ue}return 1}if(fe=U,U.type==="begin")return K(U);if(U.type==="illegal"&&!F){const ue=new Error('Illegal lexeme "'+ne+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw ue.mode=Q,ue}else if(U.type==="end"){const ue=pe(U);if(ue!==va)return ue}if(U.type==="illegal"&&ne==="")return me+=`
126
- `,1;if(Lt>1e5&&Lt>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return me+=ne,ne.length}const xe=v(S);if(!xe)throw Ht(i.replace("{}",S)),new Error('Unknown language: "'+S+'"');const He=Uh(xe);let Le="",Q=J||He;const je={},_e=new l.__emitter(l);we();let me="",mt=0,et=0,Lt=0,tt=!1;try{if(xe.__emitTokens)xe.__emitTokens(A,_e);else{for(Q.matcher.considerAll();;){Lt++,tt?tt=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=et;const D=Q.matcher.exec(A);if(!D)break;const U=A.substring(et,D.index),ne=Me(U,D);et=D.index+ne}Me(A.substring(et))}return _e.finalize(),Le=_e.toHTML(),{language:S,value:Le,relevance:mt,illegal:!1,_emitter:_e,_top:Q}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:S,value:Ts(A),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:et,context:A.slice(et-100,et+100),mode:D.mode,resultSoFar:Le},_emitter:_e};if(s)return{language:S,value:Ts(A),illegal:!1,relevance:0,errorRaised:D,_emitter:_e,_top:Q};throw D}}function p(S){const A={value:Ts(S),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return A._emitter.addText(S),A}function h(S,A){A=A||l.languages||Object.keys(t);const F=p(S),J=A.filter(v).filter(C).map(ve=>f(ve,S,!1));J.unshift(F);const ae=J.sort((ve,P)=>{if(ve.relevance!==P.relevance)return P.relevance-ve.relevance;if(ve.language&&P.language){if(v(ve.language).supersetOf===P.language)return 1;if(v(P.language).supersetOf===ve.language)return-1}return 0}),[te,Te]=ae,q=te;return q.secondBest=Te,q}function g(S,A,F){const J=A&&r[A]||F;S.classList.add("hljs"),S.classList.add(`language-${J}`)}function w(S){let A=null;const F=u(S);if(c(F))return;if(Z("before:highlightElement",{el:S,language:F}),S.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",S);return}if(S.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(S)),l.throwUnescapedHTML))throw new Gh("One of your code blocks includes unescaped HTML.",S.innerHTML);A=S;const J=A.textContent,ae=F?d(J,{language:F,ignoreIllegals:!0}):h(J);S.innerHTML=ae.value,S.dataset.highlighted="yes",g(S,F,ae.language),S.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(S.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),Z("after:highlightElement",{el:S,result:ae,text:J})}function y(S){l=ka(l,S)}const E=()=>{I(),nn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){I(),nn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let j=!1;function I(){function S(){I()}if(document.readyState==="loading"){j||window.addEventListener("DOMContentLoaded",S,!1),j=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function W(S,A){let F=null;try{F=A(e)}catch(J){if(Ht("Language definition for '{}' could not be registered.".replace("{}",S)),s)Ht(J);else throw J;F=a}F.name||(F.name=S),t[S]=F,F.rawDefinition=A.bind(null,e),F.aliases&&b(F.aliases,{languageName:S})}function G(S){delete t[S];for(const A of Object.keys(r))r[A]===S&&delete r[A]}function T(){return Object.keys(t)}function v(S){return S=(S||"").toLowerCase(),t[S]||t[r[S]]}function b(S,{languageName:A}){typeof S=="string"&&(S=[S]),S.forEach(F=>{r[F.toLowerCase()]=A})}function C(S){const A=v(S);return A&&!A.disableAutodetect}function B(S){S["before:highlightBlock"]&&!S["before:highlightElement"]&&(S["before:highlightElement"]=A=>{S["before:highlightBlock"](Object.assign({block:A.el},A))}),S["after:highlightBlock"]&&!S["after:highlightElement"]&&(S["after:highlightElement"]=A=>{S["after:highlightBlock"](Object.assign({block:A.el},A))})}function _(S){B(S),n.push(S)}function H(S){const A=n.indexOf(S);A!==-1&&n.splice(A,1)}function Z(S,A){const F=S;n.forEach(function(J){J[F]&&J[F](A)})}function se(S){return nn("10.7.0","highlightBlock will be removed entirely in v12.0"),nn("10.7.0","Please use highlightElement now."),w(S)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:I,highlightElement:w,highlightBlock:se,configure:y,initHighlighting:E,initHighlightingOnLoad:N,registerLanguage:W,unregisterLanguage:G,listLanguages:T,getLanguage:v,registerAliases:b,autoDetection:C,inherit:ka,addPlugin:_,removePlugin:H}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Wh,e.regex={concat:Yt,lookahead:Jl,either:Ho,optional:ih,anyNumberOfTimes:oh};for(const S in pr)typeof pr[S]=="object"&&Kl(pr[S]);return Object.assign(e,pr),e},ln=rc({});ln.newInstance=()=>rc({});var Vh=ln;ln.HighlightJS=ln;ln.default=ln;const at=Io(Vh);function Jh(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 Yh(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},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},y=[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},g,w,i,a],E=[...y];return E.pop(),E.push(l),h.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function Xh(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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],E={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],j=["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"],W=["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:w,literal:y,built_in:[...N,...j,"set","shopt",...I,...W]},contains:[h,e.SHEBANG(),g,f,i,a,E,l,c,u,d,r]}}const ja="[A-Za-z$_][0-9A-Za-z$_]*",Zh=["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"],Qh=["true","false","null","undefined","NaN","Infinity"],sc=["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"],oc=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ic=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],qh=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],em=[].concat(ic,sc,oc);function tm(e){const t=e.regex,r=(F,{after:J})=>{const ae="</"+F[0].slice(1);return F.input.indexOf(ae,J)!==-1},n=ja,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,J)=>{const ae=F[0].length+F.index,te=F.input[ae];if(te==="<"||te===","){J.ignoreMatch();return}te===">"&&(r(F,{after:ae})||J.ignoreMatch());let Te;const q=F.input.substring(ae);if(Te=q.match(/^\s*=/)){J.ignoreMatch();return}if((Te=q.match(/^\s+extends\s+/))&&Te.index===0){J.ignoreMatch();return}}},l={$pattern:ja,keyword:Zh,literal:Qh,built_in:em,"variable.language":qh},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},N={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]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,y,{match:/\$\d+/},f];p.contains=j.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(j)});const I=[].concat(N,p.contains),W=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:W},T={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"}}]},v={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:{_:[...sc,...oc]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},B={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function _(F){return t.concat("(?!",F.join("|"),")")}const H={match:t.concat(/\b/,_([...ic,"super","import"].map(F=>`${F}\\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},se={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:W,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,y,N,{match:/\$\d+/},f,v,{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:[N,e.REGEXP_MODE,{className:"function",begin:S,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:W}]}]},{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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,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:[G]},H,B,T,se,{match:/\$[(.]/}]}}function nm(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})\\.`,g=`\\b|${n.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${p})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,w,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,w,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[E]},{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:[w,E,f]}]}}at.registerLanguage("json",Jh);at.registerLanguage("yaml",Yh);at.registerLanguage("bash",Xh);at.registerLanguage("javascript",tm);at.registerLanguage("python",nm);const ac=new Hl(Zp({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!at.getLanguage(t))return e;try{return at.highlight(e,{language:t}).value}catch{return e}}}));ac.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 rm(e){return ac.parse(e)}const sm={"--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)"},lt=({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:sm,dangerouslySetInnerHTML:{__html:$l.sanitize(rm(e))}}):null;function om({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 im({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 am({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 lm({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 Sn({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 Ko({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 cm({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(Sn,{IconClass:am,text:`${i.licenseName} ${Di}`,term:Di,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Sn,{IconClass:Kr,text:Bi,href:i.externalDocsUrl,term:Bi,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Sn,{IconClass:om,text:`${i.contactEmail}`,term:Xu,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Sn,{IconClass:im,text:`${i.contactName}`,term:Yu,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(Sn,{IconClass:lm,term:Zu,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(Ko,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const um=[/^x-parser-/i,/^x-lib-/i];function dm(e){return um.some(t=>t.test(e))}const Ea=new Map;function fm(e){let t=Ea.get(e);return t||(t=x.lazy(Cl[e]),Ea.set(e,t)),t}const pm=e=>e.startsWith("x-"),Vo=(e,t)=>e?e[t]:void 0;function hm({source:e,pathPrefix:t}){const{showExtensions:r}=Be();if(!r||!e)return null;const n=Object.keys(e).filter(s=>pm(s)&&!dm(s)&&Object.prototype.hasOwnProperty.call(Cl,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=fm(s);return o.jsx(x.Suspense,{fallback:null,children:o.jsx(i,{value:Vo(e,s),path:`${t}.${s}`})},s)})})}const mm=x.lazy(fp),lc=e=>$o(Vo(e,"x-logo"))!==null;function Jo({source:e}){const t=Vo(e,"x-logo");return $o(t)?o.jsx(x.Suspense,{fallback:null,children:o.jsx(mm,{value:t,path:"info.x-logo"})}):null}function cc({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(Jo,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(lt,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(cm,{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(hm,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:u,layout:l})})}const uc=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(cc,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),gm=1500,xm=320,bm=48,ym="#011627";function wm(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 km(e){try{return await navigator.clipboard.writeText(e),!0}catch{return wm(e)}}function Xr({code:e,className:t,language:r="json",collapsedMaxHeight:n=xm}){const[s,i]=x.useState("idle"),a=x.useRef(void 0),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(0),h=x.useRef(null),g=x.useRef(null),w=x.useId();x.useEffect(()=>()=>clearTimeout(a.current),[]),x.useEffect(()=>{const T=g.current;if(!T)return;const v=()=>{p(T.scrollHeight),d(T.scrollHeight>n+bm)};v();const b=new ResizeObserver(v);return b.observe(T),()=>b.disconnect()},[e,r,n]);const y=()=>{km(e).then(T=>{i(T?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),gm)})},N=at.getLanguage(r)?at.highlight(e,{language:r}).value:null,j=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",I=u&&!l,W=e.replace(/\n+$/,"").split(`
127
- `).length,G=()=>{var T,v;l&&(((T=h.current)==null?void 0:T.getBoundingClientRect().top)??0)<0&&((v=h.current)==null||v.scrollIntoView({block:"nearest"})),c(b=>!b)};return o.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:y,"aria-label":j,title:j,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(ll,{className:"w-4 h-4 text-green-600"}):o.jsx(al,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:g,id:w,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:N!==null?o.jsx("code",{className:`hljs language-${r}`,dangerouslySetInnerHTML:{__html:$l.sanitize(N)}}):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, ${ym})`}})]}),u&&o.jsxs("button",{type:"button",onClick:G,"aria-expanded":l,"aria-controls":w,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 ${W} lines`,o.jsx(dn,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]})]})}const vm=/^x-parser-/i;function ro(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=>ro(n,t));const r={};for(const[n,s]of Object.entries(e))vm.test(n)||(r[n]=ro(s,t));return r}finally{t.delete(e)}}return e}const dc=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(ro(e),null,2);return o.jsx(Xr,{code:t})},Sa=new Set,Yo=e=>e.replace(/^#\//,"").split("/").pop()??e,so=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},jm={objects:new Set,refs:new Set},bt=(e,t,r)=>{if(!e.$ref)return{schema:e,refLabel:so(e)};const n=e.$ref,s=Yo(n);if(r.has(n))return{schema:e,refLabel:s,circular:!0};const i=xt(t(n));if(!i)return{schema:e,refLabel:s};const{schema:a}=Rn(i);r.add(n);try{const l=bt(a,t,r);return{schema:l.schema,refLabel:l.circular?void 0:s,circular:l.circular}}finally{r.delete(n)}},Gt=e=>{const t=e.items,r=Array.isArray(t)?t[0]:t;return ie(r)?r:null},fc=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},Em=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ie(e.additionalItems)?e.additionalItems:null,Sm=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ie(e.contains)?e.contains:null,pc=e=>e.contains!==void 0,Br=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
128
-
129
- ${t}`:t},Am=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),_t=(e,t,r,n)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Br(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(!ie(a))continue;const l=s.properties[i];ie(l)?s.properties[i]=_t(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 ie(i)&&ie(l)?_t(l,i):ie(i)?i:l}):s.items=t.items;else{const i=Gt(t),a=Gt(s);i&&a?s.items=_t(a,i):i&&(s.items=t.items)}if(t.patternProperties&&ie(t.patternProperties)){const i={...ie(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!ie(l)){i[a]=l;continue}const c=i[a];ie(c)?i[a]=_t(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(ie(t.propertyNames)){const i=s.propertyNames;s.propertyNames=ie(i)?_t(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ie(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=ie(i)?_t(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Am.has(i)||a===void 0||(s[i]=a);return s},Aa=(e,t,r,n)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>ie(d)?[u,ze(d,t,r,n)]:[u,d])));const i=Gt(s);i&&(s.items=ze(i,t,r,n));const a=Wn(s);a!==null&&ie(a)&&(s.propertyNames=ze(a,t,r,n));const l=fn(s);l!==null&&ie(l)&&(s.additionalProperties=ze(l,t,r,n));const c=Xo(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,ze(d,t,r,n)]))),s},ze=(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(!ie(d))continue;const{schema:f,circular:p}=bt(d,t,r);if(p)continue;const h=ze(f,t,r,n);if(h.if!==void 0){const g={if:h.if};h.then!==void 0&&(g.then=h.then),h.else!==void 0&&(g.else=h.else),i.push(g)}i.push(...gc(h)),a=_t(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?_t(a,l,t,r):a,u=Aa(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 Aa(e,t,r,n)}finally{n.delete(e)}},Un=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},Hn=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},hc=e=>e.not===void 0?null:typeof e.not=="boolean"||ie(e.not)?e.not:null,Ke=e=>hc(e)!==null,mc=e=>{const{not:t,...r}=e;return r},Nm=e=>{const{if:t,then:r,else:n,...s}=e;return s},Xe=e=>e.if!==void 0,_s=e=>e===void 0?null:typeof e=="boolean"||ie(e)?e:null,gc=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ie(t)):[],Ze=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Wn=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ie(e.propertyNames)?e.propertyNames:null,fn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ie(e.additionalProperties)?e.additionalProperties:null,Xo=e=>{const t=e.patternProperties;return ie(t)?Object.entries(t).flatMap(([r,n])=>ie(n)?[[r,n]]:[]):[]},Tm=(e,t)=>`${e}.[pattern:${t}]`,Gn=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Zr=e=>{const t=Wn(e);if(t!==null&&ie(t))return!0;const r=fn(e);return r!==null&&ie(r)?!0:Xo(e).length>0},xc=e=>!!(Un(e)||Hn(e)||Gn(e)||Zr(e)||e.type==="array"||e.items||e.type!==void 0),it=e=>!(Ke(e)||Xe(e)||Ze(e)||Un(e)||Hn(e)||Gn(e)||Zr(e)||e.items||pc(e)||e.type==="array"||e.type==="object");function _m(e){if(typeof fn(e)=="boolean")return!0;const r=Wn(e);return!!(typeof r=="boolean"||r!==null&&ie(r)&&it(r)&&typeof r.pattern=="string"&&r.pattern.length>0)}function Na(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||_m(e)}const bc=(e,t)=>Na(e)?!0:t?Na(t):!1,Cm=(e,t)=>{if(Ke(e)||Xe(e)||Ze(e)||Un(e)||Hn(e)||Gn(e)||Zr(e))return!0;if(e.type==="array"||e.items){if(pc(e)||fc(e)!==null)return!0;const r=Gt(e);if(!r)return!1;if(r.$ref&&t){const{schema:n}=bt(r,t,Sa),s=ze(n,t,Sa);return!it(s)}return!it(r)}return!1};function yc(e){return JSON.stringify(e)}function Ta(e){return typeof e=="string"?e:JSON.stringify(e)}function qe({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function wc({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 $m(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Im(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Om(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Rm(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function _a(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function Ca(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function hr({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(qe,{children:String(t.value)}),o.jsx(qe,{children:t.op})]}),o.jsx(qe,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(qe,{children:r.op}),o.jsx(qe,{children:String(r.value)})]}),n&&o.jsx(qe,{children:n})]})}function Nr({value:e,displayValue:t}){const r=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(Ta(e))},n=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(Ta(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??yc(e)})}function Mm({schema:e}){const t=fn(e);return typeof t!="boolean"?null:o.jsx(qe,{children:t?"additional properties allowed":"additional properties not allowed"})}function Lm({schema:e}){const t=Wn(e);return typeof t=="boolean"?o.jsx(wc,{children:t?"any property name":"no property names"}):t!==null&&ie(t)&&it(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(qe,{children:"property name pattern:"}),o.jsx(Nr,{value:t.pattern,displayValue:t.pattern})]}):null}function $a({schema:e,rangeName:t="value"}){const r=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,n=$m(e),s=Im(e),i=Om(e),a=Rm(e),l=_a(e,"minItems"),c=Ca(e,"maxItems"),u=_a(e,"minProperties"),d=Ca(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(qe,{children:"multiple of :"}),o.jsx(wc,{children:String(e.multipleOf)})]}),(n||s)&&o.jsx(hr,{name:t,lower:n,upper:s}),(i||a)&&o.jsx(hr,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(hr,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(hr,{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(qe,{children:"regex pattern:"}),o.jsx(Nr,{value:e.pattern,displayValue:e.pattern})]}),r&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(qe,{children:"enum values:"}),r.map((f,p)=>o.jsx(Nr,{value:f},`${p}-${yc(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(qe,{children:"const value:"}),o.jsx(Nr,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(qe,{children:"unique"}),o.jsx(Mm,{schema:e}),o.jsx(Lm,{schema:e})]})}function kc({schema:e,itemSchema:t,fieldName:r,className:n="flex flex-col gap-1"}){const s=t!=null&&it(t),i=r??"value";return o.jsxs("div",{className:n,children:[o.jsx($a,{schema:e,rangeName:i}),s&&o.jsx($a,{schema:t,rangeName:"item"})]})}const vc=(e,t)=>{const r=Un(e);if(r)return{text:`one of (${r.length})`};const n=Hn(e);if(n)return{text:`any of (${n.length})`};if(Ke(e)&&!xc(mc(e)))return{text:"not"};if(e.type==="array"||e.items){const u=Gt(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?Yo(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=fn(e);!Gn(e)&&a!==null&&ie(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}},Pm=(e,t)=>{if(!t)return!1;const r=vc(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function jc({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=vc(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 Ia="ml-6";function mr({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(jc,{schema:e})]}),bc(e)&&o.jsx(kc,{schema:e,className:`flex flex-col gap-1 mt-1 ${Ia}`}),r&&r.split(`
130
-
131
- `).map((n,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${Ia} leading-relaxed`,children:n},s))]})}function Cs({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 Dm({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 Ec({tabs:e,selected:t,onChange:r,ariaLabel:n}){const s=x.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 Bm({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(Ec,{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 Fm="ml-0 border-dashed border-border";function Ut({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 ${Fm}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:fo(e,n)},children:t})}function zm({depth:e,expanded:t,onToggle:r}){const{depthColors:n}=Be(),s=fo(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 Um="ml-6";function Ge({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(),g=fo(r,h),w=n&&Pm(n,s),y=u?Um:"";let E="",N=t;if(t.endsWith("[]")){const j=t.slice(0,-2),I=j.lastIndexOf(".");I>=0?(E=j.slice(0,I+1),N=`${j.slice(I+1)}[]`):N=t}else{const j=t.lastIndexOf("."),I=t.lastIndexOf("[]"),W=Math.max(j,I);W>=0&&(E=t.slice(0,W+(t[W]==="."?1:2)),N=t.slice(W+(t[W]==="."?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:[E&&o.jsx("span",{className:"text-foreground-muted",children:E}),o.jsx("span",{className:"font-semibold",style:{color:g},children:N})]}),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(jc,{schema:n,refLabel:s}),w&&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&&bc(n,i)&&o.jsx(kc,{schema:n,itemSchema:i,fieldName:N,className:`flex flex-col gap-1 mt-1 ${y}`}),c&&c.split(`
132
-
133
- `).map((j,I)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${y} leading-relaxed`,children:j},I)),u&&o.jsx(zm,{depth:r,expanded:d,onToggle:f})]})}function $s({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 Hm({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(Ut,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx($s,{label:"If schema matches:",children:e}),t!=null&&o.jsx($s,{label:"Then schema should follow:",children:t}),r!=null&&o.jsx($s,{label:"Else schema should follow:",children:r})]})})]})}function gr({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 Wm=e=>e==="none"?"depth":e;function ot({schema:e,path:t,depth:r,required:n,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=jm,focusTokens:d=null,focusId:f=null}){var X;const p=Wm(l),h=d!=null,w=h&&d.length===0?f??void 0:void 0,[y,E]=x.useState(c||h),[N,j]=x.useState(c);N!==c&&(j(c),E(c||h)),x.useEffect(()=>{h&&E(!0)},[h]);const[I,W]=x.useState(0),G=(X=d==null?void 0:d[0])==null?void 0:X.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),T=G?Number(G[1]):-1;x.useEffect(()=>{T>=0&&W(T)},[T]);const v=To(),{schema:b,refLabel:C,circular:B}=x.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:so(e),circular:!0};const O=bt(e,i,s);return O.circular?O:{...O,schema:ze(O.schema,i,s)}},[e,i,s,u,v]),_=x.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),H=mc(Nm(b)),Z=!xc(H)&&(Ke(b)||Xe(b)||Ze(b)),se=()=>{const O=hc(b);if(O===null)return null;if(typeof O=="boolean")return o.jsx(Cs,{children:o.jsx(Dm,{value:O})});const ee=bt(O,i,s);if(ee.circular)return o.jsx(Cs,{children:o.jsx(Ge,{path:t,depth:r+1,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const le=ze(ee.schema,i,s),K=it(le);return o.jsx(Cs,{children:K?o.jsx(mr,{schema:le,showBorder:!1}):o.jsx(ot,{schema:O,path:t,depth:r+1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},S=(O,ee)=>{if(typeof O=="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:O?"any value":"false schema"});const le=bt(O,i,s);if(le.circular)return o.jsx(Ge,{path:ee,depth:r+1,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const K=ze(le.schema,i,s);return it(K)?o.jsx(mr,{schema:K,showBorder:!1}):o.jsx(ot,{schema:O,path:ee,depth:r+1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},A=O=>{const ee=_s(O.if);if(ee===null)return null;const le=_s(O.then),K=_s(O.else);return o.jsx(Hm,{ifContent:S(ee,t),thenContent:le!==null?S(le,t):void 0,elseContent:K!==null?S(K,t):void 0})},F=()=>{const O=gc(b);return O.length===0?null:o.jsx(o.Fragment,{children:O.map((ee,le)=>o.jsx("div",{children:A(ee)},le))})};if(B)return o.jsx(Ge,{id:w,path:t,depth:r,typeLabelOverride:`↩ ${e.$ref??C??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(Z){const O=o.jsxs(o.Fragment,{children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?O:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(ee=>!ee)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:O})]})}const J=Un(H),ae=Hn(H),te=J??ae,Te=J?"oneOf":"anyOf";if(te){const O=te.map((Le,Q)=>typeof Le.title=="string"?Le.title:`case ${Q+1}`),ee=a?1:r+1,le=te[I],K=bt(le,i,s),pe=K.circular?K.schema:ze(K.schema,i,s),we=!K.circular&&it(pe),fe=d&&T===I?d.slice(1):null,Me=we?o.jsx(mr,{schema:pe,showBorder:!1}):o.jsx(ot,{schema:le,path:t,depth:ee-1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:fe,focusId:f},I),xe=o.jsx(Bm,{variant:Te,caseCount:te.length,caseLabels:O,selectedCase:I,onSelectCase:W,children:Me}),He=o.jsxs(o.Fragment,{children:[xe,Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?He:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(Le=>!Le)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:He})]})}const q=(O,ee,le)=>{const K=bt(O,i,s);if(K.circular)return o.jsx(Ge,{path:ee,depth:le,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const pe=ze(K.schema,i,s);return it(pe)?o.jsx(mr,{schema:pe,showBorder:!1}):o.jsx(ot,{schema:O,path:ee,depth:le,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c})},ve=O=>{const ee=H.properties??{},le=new Set(H.required??[]),K=Wn(H),pe=fn(H),we=Xo(H);return o.jsxs(o.Fragment,{children:[Object.entries(ee).map(([fe,Me])=>{if(!ie(Me))return null;const xe=d&&d[0]==="properties"&&d[1]===fe?d.slice(2):null;return o.jsx(ot,{schema:Me,path:`${t}.${fe}`,depth:O,required:le.has(fe),refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c,focusTokens:xe,focusId:f},fe)}),K!==null&&ie(K)&&o.jsx(gr,{label:"Property names must adhere to:",children:q(K,`${t}.[propertyName]`,O)}),we.map(([fe,Me])=>o.jsx(ot,{schema:Me,path:Tm(t,fe),depth:O,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c},fe)),pe!==null&&ie(pe)&&o.jsx(gr,{label:"Additional properties must adhere to:",children:q(pe,`${t}.[additionalProperty]`,O)}),Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]})};if(Gn(H)||Zr(H))return a?ve(r+1):o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(O=>!O)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:ve(r+1)})]});if(H.type==="array"||H.items){const O=fc(H),ee=O!==null,le=ee?Em(H):null,K=Sm(H),pe=K!==null,we=ee?null:Gt(H),fe=we!==null,Me=ee||fe||pe||Ke(b)||Xe(b)||Ze(b),xe=`${t}[]`,He=a?t:xe,Le=fe?bt(we,i,s):null,Q=(Le==null?void 0:Le.schema)??null,je=Q?ze(Q,i,s):null,_e=Q!==null&&(_.objects.has(Q)||typeof(we==null?void 0:we.$ref)=="string"&&_.refs.has(we.$ref)),me=Q!==null?{objects:new Set(_.objects).add(Q),refs:typeof(we==null?void 0:we.$ref)=="string"?new Set(_.refs).add(we.$ref):_.refs}:_,mt=!ee&&!pe&&je!==null&&it(je),et=je!=null&&je.properties?Object.entries(je.properties).filter(([,U])=>ie(U)):[],Lt=new Set(je&&Array.isArray(je.required)?je.required:[]),tt=!ee&&d&&d[0]==="items"?d.slice(1):null,D=U=>o.jsxs(o.Fragment,{children:[ee?o.jsxs(o.Fragment,{children:[O.map((ne,ue)=>o.jsx(ot,{schema:ne,path:`${t}[${ue}]`,depth:U,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c},ue)),le!==null&&typeof le!="boolean"&&o.jsx(gr,{label:"Additional items:",children:q(le,`${t}[*]`,U)}),le===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):fe&&(_e?o.jsx(Ge,{path:He,depth:U,typeLabelOverride:`↩ ${we.$ref??so(Q)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):et.length>0?et.map(([ne,ue])=>{const Ce=tt&&tt[0]==="properties"&&tt[1]===ne?tt.slice(2):null;return o.jsx(ot,{schema:ue,path:`${He}.${ne}`,depth:U,required:Lt.has(ne),refStack:s,deref:i,ancestors:me,branchLineVariant:p,defaultExpanded:c,focusTokens:Ce,focusId:f},ne)}):o.jsx(ot,{schema:we,path:He,depth:U,refStack:s,deref:i,ancestors:me,branchLineVariant:p,defaultExpanded:c,focusTokens:tt,focusId:f})),pe&&o.jsx(gr,{label:"Contains at least one:",children:typeof K=="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:K?"any item":"impossible constraint"}):q(K,`${t}[contains]`,U)}),Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return mt&&!Ke(b)&&!Xe(b)&&!Ze(b)?o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:Br(b.description,je.description),expandable:!1,expanded:!1,onToggle:()=>{}}):mt?o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:Br(b.description,je.description),expandable:!0,expanded:y,onToggle:()=>E(U=>!U)}),y&&o.jsxs(Ut,{depth:r,lineVariant:l,children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]})]}):a?Me?D(r+1):null:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:b.description,expandable:ee||fe||pe||Ke(b)||Xe(b)||Ze(b),expanded:y,onToggle:()=>E(U=>!U)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:D(r+1)})]})}if(Ke(b)||Xe(b)||Ze(b)){const O=o.jsxs(o.Fragment,{children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?O:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(ee=>!ee)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:O})]})}return a?null:o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Zo({schema:e,rootName:t,className:r="",focusTokens:n=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=Be(),l=x.useMemo(()=>new Set,[]),c=xt(e),u=x.useMemo(()=>c?ze(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?Yo(c.$ref):void 0)??"schema",f=!!t;if(!Cm(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:r,children:o.jsx(ot,{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,g=Gt(u),w=g?ze(g,i,l):null,y=w!==null&&it(w);return o.jsx("div",{className:r,children:o.jsx(Ge,{path:h,depth:0,schema:u,itemSchema:y?w:void 0,description:u.type==="array"||u.items?Br(u.description,g==null?void 0:g.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:r,children:o.jsx(ot,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:n,focusId:s})})}const Gm=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function xr(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function sn(e,t=()=>{},r=new Set,n=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return Gm(i)?n.has(s)?xr(i,"null")?{type:"null"}:{}:sn(i,t,new Set,new Set(n).add(s)):{}}if(r.has(e))return xr(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return sn({...i,...s[0]},t,r,n)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return sn({...i,...s[0]},t,r,n)}if(xr(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"]}:sn(a,t,r,n)}return{...e,properties:s}}finally{r.delete(e)}}if(xr(e,"array")&&e.items&&typeof e.items=="object"){r.add(e);try{return{...e,items:sn(e.items,t,r,n)}}finally{r.delete(e)}}return e}function Km({schema:e,providedExample:t}){const r=t!==void 0,[n,s]=x.useState(r?t:null),{deref:i}=Be();if(x.useEffect(()=>{if(r){s(t);return}let l=!1;return Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs")).then(({generate:c})=>c(sn(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(Xr,{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 Kt({schema:e,label:t,rootName:r,description:n,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:l,example:c,defaultView:u="example"}){const d=jl(s),f=!l&&np(s,a),[p,h]=x.useState(f&&u==="example"?"example":"schema");return x.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(Ec,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:g=>h(g),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 ",El(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(Zo,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(dc,{schema:i??e}),p==="example"&&f&&o.jsx(Km,{schema:e,providedExample:c})]})]})}function Sc({message:e,expanded:t,onToggleExpanded:r,paddingX:n="px-4",focusSection:s=null}){var h;const[i,a]=x.useState("payload");x.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:l}=Be(),c=To(),u=x.useMemo(()=>e.payload?Rn(e.payload,l):null,[e.payload,l,c]),d=x.useMemo(()=>e.headers?Rn(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(Vt,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:g=>a(g)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(Kt,{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(Kt,{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((g,w)=>o.jsx(Ko,{name:`#${g.name}`},w))})]})})}),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(dn,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Vm({messageKey:e,message:t,first:r,isSelected:n,focusSection:s}){const[i,a]=x.useState(!1);return x.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(Sc,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function Ac({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(Vm,{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(Ot,{content:i,stickySideContent:!1,layout:n})})}function Nc({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:zt(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 Tc(e){return o.jsx(bo,{...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 Jm(e){return o.jsx(bo,{...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 _c({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(Jm,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx($t,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),r]})}function Cc({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 Kn({trigger:e,children:t,defaultExpanded:r=!1,forceExpanded:n=!1,ariaLabelledBy:s,className:i=""}){const[a,l]=x.useState(r),c=x.useId();return x.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(dn,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Cc,{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 Is={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 Os(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 Ym(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function Xm(e){const t=(e??[]).filter(s=>Is[Os(s)]),r=new Map;for(const s of t){const i=Is[Os(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=Os(s),l=Is[a],c=(r.get(l)??0)>1?Ym(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 Qo({securities:e}){var u;const t=x.useMemo(()=>Xm(e),[e]),r=t.length>1,[n,s]=x.useState(r?null:((u=t[0])==null?void 0:u.id)??null);x.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(Vt,{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(br,{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(br,{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(br,{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(br,{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(Zm,{security:l}),a==="apiKey"&&o.jsx(Qm,{security:l}),a==="openIdConnect"&&o.jsx(qm,{security:l}),a==="oauth2"&&o.jsx(eg,{security:l})]})]})}const br=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(lt,{children:e})}):o.jsx("span",{children:t}),Zm=({security:e})=>e!=null&&e.description?o.jsx(lt,{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."]}),Qm=({security:e})=>{if(e!=null&&e.description)return o.jsx(lt,{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."]})},qm=({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(lt,{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:Ed(t)})})]})]})},eg=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(lt,{children:e.description}),t&&Object.entries(t).map(([r,n])=>{var c,u;let s="",i="";switch(r){case"clientCredentials":s=ed,i=td;break;case"implicit":s=Qu,i=qu;break;case"password":s=nd,i=rd;break;case"authorizationCode":s=sd,i=od;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 tg(e){return e.startsWith("http://")||e.startsWith("https://")}function $c(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Ic({value:e}){if(e==null)return null;if(typeof e=="string"&&tg(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(lt,{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:$c(r)}),o.jsx(Ic,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Oc({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=ld[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(Kn,{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:$c(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Ic,{value:l})})]},a))})})}function ng({host:e,protocol:t,description:r,tags:n,variables:s,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=s,d=x.useId();return o.jsxs("div",{children:[o.jsx(_c,{address:e,variables:u,children:o.jsx("div",{className:"mt-2",children:n&&n.map((f,p)=>{const h=f,g=h.externalDocs;return o.jsx(Ko,{href:g&&g.url,title:h.description||(g&&g.description?g.description:void 0),name:h.name},p)})})}),o.jsx(lt,{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(Tc,{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(Kn,{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(Qo,{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(wo,{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(Oc,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function Rc({servers:e,selectedServer:t,onSelectServer:r,focusSection:n=null,layout:s}){const i=Object.keys(e),[a,l]=x.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(ng,{...e[c],serverKey:c,focusSection:t||a?n:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:Ga,content:d,sideContent:o.jsx(Nc,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const Mc=x.forwardRef(function({isOpen:t,side:r,onClose:n,title:s,headerActions:i,children:a,width:l="w-[50rem]"},c){x.useEffect(()=>{const N=j=>{j.key==="Escape"&&n()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[n]);const u=r==="right"?"right-0":"left-0",d=r==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:h,sidePanelTopOffset:g=0}=Be(),w=h==="component";x.useEffect(()=>{if(!t||!f)return;const N=w?yd(f,p):go(f);if(N)return Za(N)},[w,t,f,p]);const y=xo(p,w),E=(()=>{if(!w)return{position:"fixed",inset:0};if(!y)return{position:"fixed",inset:0};const N=Math.max(g,y.top),j=Math.max(0,y.left),I=Math.min(window.innerHeight,y.bottom),W=Math.min(window.innerWidth,y.right);return{position:"fixed",top:N,left:j,width:Math.max(0,W-j),height:Math.max(0,I-N)}})();return f?an.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...E,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 Lc({message:e,messageId:t,i:r}){const[n,s]=x.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(Sc,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function rg({requestMessages:e,reply:t,isSend:r,operationId:n}){const[s,i]=x.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($t,{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
134
- ${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(Lc,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const sg="",og=`
135
- `;var ht=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??sg,this.lineJoin=t??og}},Vn=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},ig=class extends Vn{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},ag=class extends Vn{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"}},lg=class extends Vn{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},cg=class extends Vn{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"}},Oa=class extends Vn{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 Ra=10;function ug(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function dg(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 vt(e,t){let r=t;for(let n=0;ug(r);n++){if(n>=Ra)throw new Error(`Exceeded max $ref depth (${Ra}) resolving "${r.$ref}" — possible cycle`);r=dg(e,r.$ref)}return r}const fg=10;function pg(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 hg(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function oo(e,t,r=0){if(r>fg)return;const n=vt(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(hg(s.type)){case"object":{const i={};for(const[a,l]of Object.entries(s.properties??{})){const c=oo(e,l,r+1);c!==void 0&&(i[a]=c)}return i}case"array":{if(s.items===void 0)return[];const i=oo(e,s.items,r+1);return i!==void 0?[i]:[]}case"string":return pg(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const mg=10;function gg(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function _n(e,t,r=0){if(r>=mg||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>_n(e,s,r+1));if(gg(t))return _n(e,vt(e,t),r+1);const n={};for(const[s,i]of Object.entries(t))n[s]=_n(e,i,r+1);return n}function Pc(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 yr(e,t){return e?Pc(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function Ma(e){const t={},r=[];for(const[n,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=Pc(s.default,s.examples,n);t[n]=i.value,i.isPlaceholder&&r.push(n)}return{values:t,placeholders:r}}function La(e,t){return t!=null&&t.length?t.map(r=>vt(e,r)).filter(r=>!!(r!=null&&r.type)):[]}const xg={"kafka-secure":"kafka",wss:"ws"};function bg(e){return xg[e]??e}function yg(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function wg(e){return e.slice(e.lastIndexOf("/")+1)}function kg(e,t){return t&&t.length>0?t.map(r=>{const n=vt(e,r);if(n)return{name:yg(r)?wg(r.$ref):"",server:n}}).filter(r=>!!r):Object.entries(e.servers??{}).map(([r,n])=>{const s=vt(e,n);return s?{name:r,server:s}:void 0}).filter(r=>!!r)}function Dc(e,t){var i;const r=(i=e.operations)==null?void 0:i[t],n=r&&vt(e,r);if(!n)throw new ig(t);const s=vt(e,n.channel);if(!s)throw new lg(t);return{operation:n,channel:s}}function Bc(e,t,r,n){var l;const s=kg(e,r.servers??t.servers),i=s.find(c=>bg(c.server.protocol)===n),a=(l=t.bindings)==null?void 0:l[n];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function vg(e,t,r){try{const{operation:n,channel:s}=Dc(e,t);return Bc(e,s,n,r).eligible}catch{return!1}}function jg(e,t,r){var B,_,H,Z,se,S,A,F,J,ae,te,Te,q,ve;const{operation:n,channel:s}=Dc(e,t),{servers:i,matchedServer:a,eligible:l}=Bc(e,s,n,r);if(!l)throw new cg(t,r);const c=[];let u={},d={},f;if(r==="ws"){const P=Ma((_=(B=s.bindings)==null?void 0:B.ws)==null?void 0:_.query),X=Ma((Z=(H=s.bindings)==null?void 0:H.ws)==null?void 0:Z.headers);u=P.values,d=X.values,c.push(...P.placeholders.map(O=>`query param "${O}"`)),c.push(...X.placeholders.map(O=>`header "${O}"`))}else r==="kafka"&&(f=(S=(se=s.bindings)==null?void 0:se.kafka)==null?void 0:S.topic);const p=s.address??"";let h=p;for(const[P,X]of Object.entries(s.parameters??{})){const O=yr(X,P);h=h.replace(`{${P}}`,O.value),O.isPlaceholder&&c.push(`channel parameter "${P}"`)}r==="kafka"&&f&&(h=f);const g=(A=a??i[0])==null?void 0:A.server,w=g?`${g.protocol}://${g.host}${g.pathname??""}`:"",y=(g==null?void 0:g.host)??"",E=La(e,g==null?void 0:g.security),N=i.map(({name:P,server:X})=>({name:P,host:X.host,protocol:X.protocol,pathname:X.pathname,url:`${X.protocol}://${X.host}${X.pathname??""}`,description:X.description,security:La(e,X.security)})),j=n.messages!==void 0?vt(e,n.messages[0]):vt(e,Object.values(s.messages??{})[0]),I=(F=j==null?void 0:j.examples)==null?void 0:F[0];let W,G;if(I)W=I.name,G=I.payload;else if((j==null?void 0:j.payload)!==void 0){if(G=oo(e,j.payload),G===void 0)throw new Oa(t);c.push("message payload (no explicit example — generated from its schema)")}else throw new Oa(t);const T=(j==null?void 0:j.payload)!==void 0?_n(e,j.payload):void 0,v=(j==null?void 0:j.headers)!==void 0?_n(e,j.headers):void 0,b=n.action==="send"?"send":"receive";let C;if(r==="kafka"){const P=(ae=(J=j==null?void 0:j.bindings)==null?void 0:J.kafka)==null?void 0:ae.key,X=P?yr(P,"kafka message key"):void 0;X!=null&&X.isPlaceholder&&c.push("kafka message key");const O=yr((Te=(te=n.bindings)==null?void 0:te.kafka)==null?void 0:Te.clientId,"kafka clientId");O.isPlaceholder&&c.push("kafka clientId");let ee;b==="receive"&&(ee=yr((ve=(q=n.bindings)==null?void 0:q.kafka)==null?void 0:ve.groupId,"kafka consumer group id"),ee.isPlaceholder&&c.push("kafka consumer group id")),C={key:X==null?void 0:X.value,groupId:ee==null?void 0:ee.value,clientId:O.value}}return{operationId:t,action:b,protocol:r,serverUrl:w,serverHost:y,servers:N,channelAddress:h,channelTemplate:p,query:u,headers:d,operationSummary:n.summary,operationDescription:n.description,message:{name:W,payload:G,title:(j==null?void 0:j.title)??(j==null?void 0:j.name),summary:j==null?void 0:j.summary,description:j==null?void 0:j.description,contentType:j==null?void 0:j.contentType,payloadSchema:T,headersSchema:v},placeholders:c,info:e.info,security:E,...C?{kafka:C}:{}}}function Eg(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 Sg(e,t){if(t.length!==0){e("**Authorization:**");for(const r of t)if(e(`- **${Eg(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 Ag(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&&(Sg(e,r.security),t())}function Pa(e,t,r,n){e(`#### \`${r}\``),t(),e("```json");for(const s of JSON.stringify(n,null,2).split(`
136
- `))e(s);e("```"),t()}function Fc(e,t){var u,d,f,p,h,g,w;const r={indent:" ",...t},{push:n,blank:s,join:i}=new ht({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 y of e.servers)Ag(n,s,y)}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(y=>`\`${y}=${e.query[y]}\``).join(", ")}`),c.length>0&&n(`**Headers:** ${c.map(y=>`\`${y}: ${e.headers[y]}\``).join(", ")}`),((h=e.kafka)==null?void 0:h.clientId)!==void 0&&n(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((g=e.kafka)==null?void 0:g.groupId)!==void 0&&n(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((w=e.kafka)==null?void 0:w.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&&Pa(n,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&Pa(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 y of e.placeholders)n(`- ${y}`,1)}return i()}const Ng={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)=>Fc(e,t)},Tg={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)=>Fc(e,t)};function Jn(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 _g={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 ht({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=Jn(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(`
121
+ `}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>${pt(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=da(e);if(s===null)return n;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+pt(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=da(e);if(s===null)return pt(r);e=s;let i=`<img src="${e}" alt="${r}"`;return t&&(i+=` title="${pt(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:pt(e.text)}},Uo=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""}},kt=class so{constructor(t){be(this,"options");be(this,"renderer");be(this,"textRenderer");this.options=t||Jt,this.options.renderer=this.options.renderer||new Rr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Uo}static parse(t,r){return new so(r).parse(t)}static parseInline(t,r){return new so(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+=`
122
+ `+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}},Fs,jr=(Fs=class{constructor(e){be(this,"options");be(this,"block");this.options=e||Jt}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?wt.lex:wt.lexInline}provideParser(){return this.block?kt.parse:kt.parseInline}},be(Fs,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),Fs),Gl=class{constructor(...e){be(this,"defaults",Ro());be(this,"options",this.setOptions);be(this,"parse",this.parseMarkdown(!0));be(this,"parseInline",this.parseMarkdown(!1));be(this,"Parser",kt);be(this,"Renderer",Rr);be(this,"TextRenderer",Uo);be(this,"Lexer",wt);be(this,"Tokenizer",Or);be(this,"Hooks",jr);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 Rr(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 Or(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 jr;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];jr.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 wt.lex(e,t??this.defaults)}parser(e,t){return kt.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?wt.lex:wt.lexInline,c=i.hooks?i.hooks.provideParser():e?kt.parse:kt.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+=`
123
+ Please report this to https://github.com/markedjs/marked.`,e){const n="<p>An error occurred:</p><pre>"+pt(r.message+"",!0)+"</pre>";return t?Promise.resolve(n):n}if(t)return Promise.reject(r);throw r}}},Wt=new Gl;function ye(e,t){return Wt.parse(e,t)}ye.options=ye.setOptions=function(e){return Wt.setOptions(e),ye.defaults=Wt.defaults,Rl(ye.defaults),ye};ye.getDefaults=Ro;ye.defaults=Jt;ye.use=function(...e){return Wt.use(...e),ye.defaults=Wt.defaults,Rl(ye.defaults),ye};ye.walkTokens=function(e,t){return Wt.walkTokens(e,t)};ye.parseInline=Wt.parseInline;ye.Parser=kt;ye.parser=kt.parse;ye.Renderer=Rr;ye.TextRenderer=Uo;ye.Lexer=wt;ye.lexer=wt.lex;ye.Tokenizer=Or;ye.Hooks=jr;ye.parse=ye;ye.options;ye.setOptions;ye.use;ye.walkTokens;ye.parseInline;kt.parse;wt.lex;function qp(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=ha(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,r,t.lang||"")).then(ma(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.");ma(t)(n)},useNewRenderer:!0,renderer:{code(t,r,n){typeof t=="object"&&(n=t.escaped,r=t.lang,t=t.text);const s=ha(r),i=s?e.langPrefix+xa(s):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${n?t:xa(t,!0)}
124
+ </code></pre>`}}}}function ha(e){return(e||"").match(/\S*/)[0]}function ma(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const Kl=/[&<>"']/,eh=new RegExp(Kl.source,"g"),Vl=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,th=new RegExp(Vl.source,"g"),nh={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ga=e=>nh[e];function xa(e,t){if(t){if(Kl.test(e))return e.replace(eh,ga)}else if(Vl.test(e))return e.replace(th,ga);return e}function Jl(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)&&Jl(r)}),e}class ba{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function Yl(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function Ct(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 rh="</span>",ya=e=>!!e.scope,sh=(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 oh{constructor(t,r){this.buffer="",this.classPrefix=r.classPrefix,t.walk(this)}addText(t){this.buffer+=Yl(t)}openNode(t){if(!ya(t))return;const r=sh(t.scope,{prefix:this.classPrefix});this.span(r)}closeNode(t){ya(t)&&(this.buffer+=rh)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const wa=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ho{constructor(){this.rootNode=wa(),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=wa({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=>{Ho._collapse(r)}))}}class ih extends Ho{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 oh(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Pn(e){return e?typeof e=="string"?e:e.source:null}function Xl(e){return Yt("(?=",e,")")}function ah(e){return Yt("(?:",e,")*")}function lh(e){return Yt("(?:",e,")?")}function Yt(...e){return e.map(r=>Pn(r)).join("")}function ch(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Wo(...e){return"("+(ch(e).capture?"":"?:")+e.map(n=>Pn(n)).join("|")+")"}function Zl(e){return new RegExp(e.toString()+"|").exec("").length-1}function uh(e,t){const r=e&&e.exec(t);return r&&r.index===0}const dh=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Go(e,{joinWith:t}){let r=0;return e.map(n=>{r+=1;const s=r;let i=Pn(n),a="";for(;i.length>0;){const l=dh.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 fh=/\b\B/,Ql="[a-zA-Z]\\w*",Ko="[a-zA-Z_]\\w*",ql="\\b\\d+(\\.\\d+)?",ec="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",tc="\\b(0b[01]+)",ph="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",hh=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Yt(t,/.*\b/,e.binary,/\b.*/)),Ct({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(r,n)=>{r.index!==0&&n.ignoreMatch()}},e)},Dn={begin:"\\\\[\\s\\S]",relevance:0},mh={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Dn]},gh={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Dn]},xh={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/},Kr=function(e,t,r={}){const n=Ct({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=Wo("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:Yt(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},bh=Kr("//","$"),yh=Kr("/\\*","\\*/"),wh=Kr("#","$"),kh={scope:"number",begin:ql,relevance:0},vh={scope:"number",begin:ec,relevance:0},jh={scope:"number",begin:tc,relevance:0},Eh={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Dn,{begin:/\[/,end:/\]/,relevance:0,contains:[Dn]}]},Sh={scope:"title",begin:Ql,relevance:0},Ah={scope:"title",begin:Ko,relevance:0},Nh={begin:"\\.\\s*"+Ko,relevance:0},Th=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 ur=Object.freeze({__proto__:null,APOS_STRING_MODE:mh,BACKSLASH_ESCAPE:Dn,BINARY_NUMBER_MODE:jh,BINARY_NUMBER_RE:tc,COMMENT:Kr,C_BLOCK_COMMENT_MODE:yh,C_LINE_COMMENT_MODE:bh,C_NUMBER_MODE:vh,C_NUMBER_RE:ec,END_SAME_AS_BEGIN:Th,HASH_COMMENT_MODE:wh,IDENT_RE:Ql,MATCH_NOTHING_RE:fh,METHOD_GUARD:Nh,NUMBER_MODE:kh,NUMBER_RE:ql,PHRASAL_WORDS_MODE:xh,QUOTE_STRING_MODE:gh,REGEXP_MODE:Eh,RE_STARTERS_RE:ph,SHEBANG:hh,TITLE_MODE:Sh,UNDERSCORE_IDENT_RE:Ko,UNDERSCORE_TITLE_MODE:Ah});function _h(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function Ch(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function $h(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=_h,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function Ih(e,t){Array.isArray(e.illegal)&&(e.illegal=Wo(...e.illegal))}function Oh(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 Rh(e,t){e.relevance===void 0&&(e.relevance=1)}const Mh=(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=Yt(r.beforeMatch,Xl(r.begin)),e.starts={relevance:0,contains:[Object.assign(r,{endsParent:!0})]},e.relevance=0,delete r.beforeMatch},Lh=["of","and","for","in","not","or","if","then","parent","list","value"],Ph="keyword";function nc(e,t,r=Ph){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,nc(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,Dh(c[0],c[1])]})}}function Dh(e,t){return t?Number(t):Bh(e)?0:1}function Bh(e){return Lh.includes(e.toLowerCase())}const ka={},Ht=e=>{console.error(e)},va=(e,...t)=>{console.log(`WARN: ${e}`,...t)},nn=(e,t)=>{ka[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),ka[`${e}/${t}`]=!0)},Mr=new Error;function rc(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+=Zl(t[l-1]);e[r]=a,e[r]._emit=i,e[r]._multi=!0}function Fh(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw Ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Mr;if(typeof e.beginScope!="object"||e.beginScope===null)throw Ht("beginScope must be object"),Mr;rc(e,e.begin,{key:"beginScope"}),e.begin=Go(e.begin,{joinWith:""})}}function zh(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw Ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Mr;if(typeof e.endScope!="object"||e.endScope===null)throw Ht("endScope must be object"),Mr;rc(e,e.end,{key:"endScope"}),e.end=Go(e.end,{joinWith:""})}}function Uh(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Hh(e){Uh(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Fh(e),zh(e)}function Wh(e){function t(a,l){return new RegExp(Pn(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+=Zl(l)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const l=this.regexes.map(c=>c[1]);this.matcherRe=t(Go(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;[Ch,Oh,Hh,Mh].forEach(d=>d(a,l)),e.compilerExtensions.forEach(d=>d(a,l)),a.__beforeBegin=null,[$h,Ih,Rh].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=nc(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=Pn(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 Gh(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=Ct(e.classNameAliases||{}),i(e)}function sc(e){return e?e.endsWithParent||sc(e.starts):!1}function Gh(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Ct(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:sc(e)?Ct(e,{starts:e.starts?Ct(e.starts):null}):Object.isFrozen(e)?Ct(e):e}var Kh="11.11.1";class Vh extends Error{constructor(t,r){super(t),this.name="HTMLInjectionError",this.html=r}}const _s=Yl,ja=Ct,Ea=Symbol("nomatch"),Jh=7,oc=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:ih};function c(S){return l.noHighlightRe.test(S)}function u(S){let A=S.className+" ";A+=S.parentNode?S.parentNode.className:"";const F=l.languageDetectRe.exec(A);if(F){const J=v(F[1]);return J||(va(i.replace("{}",F[1])),va("Falling back to no-highlight mode for this block.",S)),J?F[1]:"no-highlight"}return A.split(/\s+/).find(J=>c(J)||v(J))}function d(S,A,F){let J="",ae="";typeof A=="object"?(J=S,F=A.ignoreIllegals,ae=A.language):(nn("10.7.0","highlight(lang, code, ...args) has been deprecated."),nn("10.7.0",`Please use highlight(code, options) instead.
125
+ https://github.com/highlightjs/highlight.js/issues/2277`),ae=S,J=A),F===void 0&&(F=!0);const te={code:J,language:ae};Z("before:highlight",te);const Te=te.result?te.result:f(te.language,te.code,F);return Te.code=te.code,Z("after:highlight",Te),Te}function f(S,A,F,J){const ae=Object.create(null);function te(D,U){return D.keywords[U]}function Te(){if(!Q.keywords){_e.addText(me);return}let D=0;Q.keywordPatternRe.lastIndex=0;let U=Q.keywordPatternRe.exec(me),ne="";for(;U;){ne+=me.substring(D,U.index);const ue=xe.case_insensitive?U[0].toLowerCase():U[0],Ce=te(Q,ue);if(Ce){const[rt,es]=Ce;if(_e.addText(ne),ne="",ae[ue]=(ae[ue]||0)+1,ae[ue]<=Jh&&(mt+=es),rt.startsWith("_"))ne+=U[0];else{const ts=xe.classNameAliases[rt]||rt;P(U[0],ts)}}else ne+=U[0];D=Q.keywordPatternRe.lastIndex,U=Q.keywordPatternRe.exec(me)}ne+=me.substring(D),_e.addText(ne)}function q(){if(me==="")return;let D=null;if(typeof Q.subLanguage=="string"){if(!t[Q.subLanguage]){_e.addText(me);return}D=f(Q.subLanguage,me,!0,je[Q.subLanguage]),je[Q.subLanguage]=D._top}else D=h(me,Q.subLanguage.length?Q.subLanguage:null);Q.relevance>0&&(mt+=D.relevance),_e.__addSublanguage(D._emitter,D.language)}function ve(){Q.subLanguage!=null?q():Te(),me=""}function P(D,U){D!==""&&(_e.startScope(U),_e.addText(D),_e.endScope())}function X(D,U){let ne=1;const ue=U.length-1;for(;ne<=ue;){if(!D._emit[ne]){ne++;continue}const Ce=xe.classNameAliases[D[ne]]||D[ne],rt=U[ne];Ce?P(rt,Ce):(me=rt,Te(),me=""),ne++}}function O(D,U){return D.scope&&typeof D.scope=="string"&&_e.openNode(xe.classNameAliases[D.scope]||D.scope),D.beginScope&&(D.beginScope._wrap?(P(me,xe.classNameAliases[D.beginScope._wrap]||D.beginScope._wrap),me=""):D.beginScope._multi&&(X(D.beginScope,U),me="")),Q=Object.create(D,{parent:{value:Q}}),Q}function ee(D,U,ne){let ue=uh(D.endRe,ne);if(ue){if(D["on:end"]){const Ce=new ba(D);D["on:end"](U,Ce),Ce.isMatchIgnored&&(ue=!1)}if(ue){for(;D.endsParent&&D.parent;)D=D.parent;return D}}if(D.endsWithParent)return ee(D.parent,U,ne)}function le(D){return Q.matcher.regexIndex===0?(me+=D[0],1):(tt=!0,0)}function K(D){const U=D[0],ne=D.rule,ue=new ba(ne),Ce=[ne.__beforeBegin,ne["on:begin"]];for(const rt of Ce)if(rt&&(rt(D,ue),ue.isMatchIgnored))return le(U);return ne.skip?me+=U:(ne.excludeBegin&&(me+=U),ve(),!ne.returnBegin&&!ne.excludeBegin&&(me=U)),O(ne,D),ne.returnBegin?0:U.length}function pe(D){const U=D[0],ne=A.substring(D.index),ue=ee(Q,D,ne);if(!ue)return Ea;const Ce=Q;Q.endScope&&Q.endScope._wrap?(ve(),P(U,Q.endScope._wrap)):Q.endScope&&Q.endScope._multi?(ve(),X(Q.endScope,D)):Ce.skip?me+=U:(Ce.returnEnd||Ce.excludeEnd||(me+=U),ve(),Ce.excludeEnd&&(me=U));do Q.scope&&_e.closeNode(),!Q.skip&&!Q.subLanguage&&(mt+=Q.relevance),Q=Q.parent;while(Q!==ue.parent);return ue.starts&&O(ue.starts,D),Ce.returnEnd?0:U.length}function we(){const D=[];for(let U=Q;U!==xe;U=U.parent)U.scope&&D.unshift(U.scope);D.forEach(U=>_e.openNode(U))}let fe={};function Me(D,U){const ne=U&&U[0];if(me+=D,ne==null)return ve(),0;if(fe.type==="begin"&&U.type==="end"&&fe.index===U.index&&ne===""){if(me+=A.slice(U.index,U.index+1),!s){const ue=new Error(`0 width match regex (${S})`);throw ue.languageName=S,ue.badRule=fe.rule,ue}return 1}if(fe=U,U.type==="begin")return K(U);if(U.type==="illegal"&&!F){const ue=new Error('Illegal lexeme "'+ne+'" for mode "'+(Q.scope||"<unnamed>")+'"');throw ue.mode=Q,ue}else if(U.type==="end"){const ue=pe(U);if(ue!==Ea)return ue}if(U.type==="illegal"&&ne==="")return me+=`
126
+ `,1;if(Lt>1e5&&Lt>U.index*3)throw new Error("potential infinite loop, way more iterations than matches");return me+=ne,ne.length}const xe=v(S);if(!xe)throw Ht(i.replace("{}",S)),new Error('Unknown language: "'+S+'"');const He=Wh(xe);let Le="",Q=J||He;const je={},_e=new l.__emitter(l);we();let me="",mt=0,et=0,Lt=0,tt=!1;try{if(xe.__emitTokens)xe.__emitTokens(A,_e);else{for(Q.matcher.considerAll();;){Lt++,tt?tt=!1:Q.matcher.considerAll(),Q.matcher.lastIndex=et;const D=Q.matcher.exec(A);if(!D)break;const U=A.substring(et,D.index),ne=Me(U,D);et=D.index+ne}Me(A.substring(et))}return _e.finalize(),Le=_e.toHTML(),{language:S,value:Le,relevance:mt,illegal:!1,_emitter:_e,_top:Q}}catch(D){if(D.message&&D.message.includes("Illegal"))return{language:S,value:_s(A),illegal:!0,relevance:0,_illegalBy:{message:D.message,index:et,context:A.slice(et-100,et+100),mode:D.mode,resultSoFar:Le},_emitter:_e};if(s)return{language:S,value:_s(A),illegal:!1,relevance:0,errorRaised:D,_emitter:_e,_top:Q};throw D}}function p(S){const A={value:_s(S),illegal:!1,relevance:0,_top:a,_emitter:new l.__emitter(l)};return A._emitter.addText(S),A}function h(S,A){A=A||l.languages||Object.keys(t);const F=p(S),J=A.filter(v).filter(C).map(ve=>f(ve,S,!1));J.unshift(F);const ae=J.sort((ve,P)=>{if(ve.relevance!==P.relevance)return P.relevance-ve.relevance;if(ve.language&&P.language){if(v(ve.language).supersetOf===P.language)return 1;if(v(P.language).supersetOf===ve.language)return-1}return 0}),[te,Te]=ae,q=te;return q.secondBest=Te,q}function g(S,A,F){const J=A&&r[A]||F;S.classList.add("hljs"),S.classList.add(`language-${J}`)}function w(S){let A=null;const F=u(S);if(c(F))return;if(Z("before:highlightElement",{el:S,language:F}),S.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",S);return}if(S.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(S)),l.throwUnescapedHTML))throw new Vh("One of your code blocks includes unescaped HTML.",S.innerHTML);A=S;const J=A.textContent,ae=F?d(J,{language:F,ignoreIllegals:!0}):h(J);S.innerHTML=ae.value,S.dataset.highlighted="yes",g(S,F,ae.language),S.result={language:ae.language,re:ae.relevance,relevance:ae.relevance},ae.secondBest&&(S.secondBest={language:ae.secondBest.language,relevance:ae.secondBest.relevance}),Z("after:highlightElement",{el:S,result:ae,text:J})}function y(S){l=ja(l,S)}const E=()=>{I(),nn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function N(){I(),nn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let j=!1;function I(){function S(){I()}if(document.readyState==="loading"){j||window.addEventListener("DOMContentLoaded",S,!1),j=!0;return}document.querySelectorAll(l.cssSelector).forEach(w)}function W(S,A){let F=null;try{F=A(e)}catch(J){if(Ht("Language definition for '{}' could not be registered.".replace("{}",S)),s)Ht(J);else throw J;F=a}F.name||(F.name=S),t[S]=F,F.rawDefinition=A.bind(null,e),F.aliases&&b(F.aliases,{languageName:S})}function G(S){delete t[S];for(const A of Object.keys(r))r[A]===S&&delete r[A]}function T(){return Object.keys(t)}function v(S){return S=(S||"").toLowerCase(),t[S]||t[r[S]]}function b(S,{languageName:A}){typeof S=="string"&&(S=[S]),S.forEach(F=>{r[F.toLowerCase()]=A})}function C(S){const A=v(S);return A&&!A.disableAutodetect}function B(S){S["before:highlightBlock"]&&!S["before:highlightElement"]&&(S["before:highlightElement"]=A=>{S["before:highlightBlock"](Object.assign({block:A.el},A))}),S["after:highlightBlock"]&&!S["after:highlightElement"]&&(S["after:highlightElement"]=A=>{S["after:highlightBlock"](Object.assign({block:A.el},A))})}function _(S){B(S),n.push(S)}function H(S){const A=n.indexOf(S);A!==-1&&n.splice(A,1)}function Z(S,A){const F=S;n.forEach(function(J){J[F]&&J[F](A)})}function se(S){return nn("10.7.0","highlightBlock will be removed entirely in v12.0"),nn("10.7.0","Please use highlightElement now."),w(S)}Object.assign(e,{highlight:d,highlightAuto:h,highlightAll:I,highlightElement:w,highlightBlock:se,configure:y,initHighlighting:E,initHighlightingOnLoad:N,registerLanguage:W,unregisterLanguage:G,listLanguages:T,getLanguage:v,registerAliases:b,autoDetection:C,inherit:ja,addPlugin:_,removePlugin:H}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Kh,e.regex={concat:Yt,lookahead:Xl,either:Wo,optional:lh,anyNumberOfTimes:ah};for(const S in ur)typeof ur[S]=="object"&&Jl(ur[S]);return Object.assign(e,ur),e},ln=oc({});ln.newInstance=()=>oc({});var Yh=ln;ln.HighlightJS=ln;ln.default=ln;const at=Oo(Yh);function Xh(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 Zh(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},g={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},y=[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},g,w,i,a],E=[...y];return E.pop(),E.push(l),h.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:y}}function Qh(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}),g={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],y=["true","false"],E={match:/(\/[a-z._-]+)+/},N=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],j=["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"],W=["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:w,literal:y,built_in:[...N,...j,"set","shopt",...I,...W]},contains:[h,e.SHEBANG(),g,f,i,a,E,l,c,u,d,r]}}const Sa="[A-Za-z$_][0-9A-Za-z$_]*",qh=["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"],em=["true","false","null","undefined","NaN","Infinity"],ic=["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"],ac=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],lc=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],tm=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],nm=[].concat(lc,ic,ac);function rm(e){const t=e.regex,r=(F,{after:J})=>{const ae="</"+F[0].slice(1);return F.input.indexOf(ae,J)!==-1},n=Sa,s={begin:"<>",end:"</>"},i=/<[A-Za-z0-9\\._:-]+\s*\/>/,a={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(F,J)=>{const ae=F[0].length+F.index,te=F.input[ae];if(te==="<"||te===","){J.ignoreMatch();return}te===">"&&(r(F,{after:ae})||J.ignoreMatch());let Te;const q=F.input.substring(ae);if(Te=q.match(/^\s*=/)){J.ignoreMatch();return}if((Te=q.match(/^\s+extends\s+/))&&Te.index===0){J.ignoreMatch();return}}},l={$pattern:Sa,keyword:qh,literal:em,built_in:nm,"variable.language":tm},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"}},g={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},w={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},y={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},N={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]},j=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,y,{match:/\$\d+/},f];p.contains=j.concat({begin:/\{/,end:/\}/,keywords:l,contains:["self"].concat(j)});const I=[].concat(N,p.contains),W=I.concat([{begin:/(\s*)\(/,end:/\)/,keywords:l,contains:["self"].concat(I)}]),G={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:W},T={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"}}]},v={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:{_:[...ic,...ac]}},b={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},C={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[G],illegal:/%/},B={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function _(F){return t.concat("(?!",F.join("|"),")")}const H={match:t.concat(/\b/,_([...lc,"super","import"].map(F=>`${F}\\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},se={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},G]},S="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",A={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(S)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[G]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:l,exports:{PARAMS_CONTAINS:W,CLASS_REFERENCE:v},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),b,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,g,w,y,N,{match:/\$\d+/},f,v,{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:[N,e.REGEXP_MODE,{className:"function",begin:S,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:W}]}]},{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"]}]}]},C,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[G,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:[G]},H,B,T,se,{match:/\$[(.]/}]}}function sm(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})\\.`,g=`\\b|${n.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${g})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${g})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${g})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${g})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${g})`},{begin:`\\b(${p})[jJ](?=${g})`}]},y={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",c,w,f,e.HASH_COMMENT_MODE]}]};return u.contains=[f,w,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[c,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},f,y,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[E]},{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:[w,E,f]}]}}at.registerLanguage("json",Xh);at.registerLanguage("yaml",Zh);at.registerLanguage("bash",Qh);at.registerLanguage("javascript",rm);at.registerLanguage("python",sm);const cc=new Gl(qp({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!at.getLanguage(t))return e;try{return at.highlight(e,{language:t}).value}catch{return e}}}));cc.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 om(e){return cc.parse(e)}const im={"--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)"},lt=({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:im,dangerouslySetInnerHTML:{__html:Ol.sanitize(om(e))}}):null;function am({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 lm({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 cm({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 um({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 Nn({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 Vo({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 dm({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(Nn,{IconClass:cm,text:`${i.licenseName} ${Fi}`,term:Fi,visibleTerm:!i.licenseName,href:i.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),i.externalDocsUrl&&o.jsx(Nn,{IconClass:Hr,text:zi,href:i.externalDocsUrl,term:zi,visibleTerm:!i.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),i.contactEmail&&o.jsx(Nn,{IconClass:am,text:`${i.contactEmail}`,term:Qu,visibleTerm:!i.contactEmail,href:`mailto:${i.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),i.contactUrl&&o.jsx(Nn,{IconClass:lm,text:`${i.contactName}`,term:Zu,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(Nn,{IconClass:um,term:qu,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(Vo,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},l)})})})})]})}const fm=[/^x-parser-/i,/^x-lib-/i];function pm(e){return fm.some(t=>t.test(e))}const Aa=new Map;function hm(e){let t=Aa.get(e);return t||(t=x.lazy(Il[e]),Aa.set(e,t)),t}const mm=e=>e.startsWith("x-"),Jo=(e,t)=>e?e[t]:void 0;function gm({source:e,pathPrefix:t}){const{showExtensions:r}=Be();if(!r||!e)return null;const n=Object.keys(e).filter(s=>mm(s)&&!pm(s)&&Object.prototype.hasOwnProperty.call(Il,s));return n.length===0?null:o.jsx(o.Fragment,{children:n.map(s=>{const i=hm(s);return o.jsx(x.Suspense,{fallback:null,children:o.jsx(i,{value:Jo(e,s),path:`${t}.${s}`})},s)})})}const xm=x.lazy(hp),uc=e=>Io(Jo(e,"x-logo"))!==null;function Yo({source:e}){const t=Jo(e,"x-logo");return Io(t)?o.jsx(x.Suspense,{fallback:null,children:o.jsx(xm,{value:t,path:"info.x-logo"})}):null}function dc({title:e,description:t,license:r,contact:n,externalDocs:s,tags:i,extensionsSource:a,layout:l,showLogo:c=!0}){const u=c?o.jsx(Yo,{source:a}):null,d=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(lt,{children:t})}),f=o.jsxs(o.Fragment,{children:[o.jsx(dm,{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(gm,{source:a,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:e,content:d,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:u,layout:l})})}const fc=({title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,layout:a,showLogo:l,...c})=>o.jsx(dc,{title:e,description:t,license:r,externalDocs:n,contact:s,tags:i,extensionsSource:c,layout:a,showLogo:l}),bm=1500,ym=320,wm=48,km="#011627";function vm(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 jm(e){try{return await navigator.clipboard.writeText(e),!0}catch{return vm(e)}}function Vr({code:e,className:t,language:r="json",collapsedMaxHeight:n=ym}){const[s,i]=x.useState("idle"),a=x.useRef(void 0),[l,c]=x.useState(!1),[u,d]=x.useState(!1),[f,p]=x.useState(0),h=x.useRef(null),g=x.useRef(null),w=x.useId();x.useEffect(()=>()=>clearTimeout(a.current),[]),x.useEffect(()=>{const T=g.current;if(!T)return;const v=()=>{p(T.scrollHeight),d(T.scrollHeight>n+wm)};v();const b=new ResizeObserver(v);return b.observe(T),()=>b.disconnect()},[e,r,n]);const y=()=>{jm(e).then(T=>{i(T?"copied":"error"),clearTimeout(a.current),a.current=setTimeout(()=>i("idle"),bm)})},N=at.getLanguage(r)?at.highlight(e,{language:r}).value:null,j=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",I=u&&!l,W=e.replace(/\n+$/,"").split(`
127
+ `).length,G=()=>{var T,v;l&&(((T=h.current)==null?void 0:T.getBoundingClientRect().top)??0)<0&&((v=h.current)==null||v.scrollIntoView({block:"nearest"})),c(b=>!b)};return o.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:y,"aria-label":j,title:j,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(ul,{className:"w-4 h-4 text-green-600"}):o.jsx(cl,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),o.jsxs("div",{className:"relative",children:[o.jsx("pre",{ref:g,id:w,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:N!==null?o.jsx("code",{className:`hljs language-${r}`,dangerouslySetInnerHTML:{__html:Ol.sanitize(N)}}):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, ${km})`}})]}),u&&o.jsxs("button",{type:"button",onClick:G,"aria-expanded":l,"aria-controls":w,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 ${W} lines`,o.jsx(pn,{className:`w-3 h-3 transition-transform ${l?"rotate-180":""}`})]})]})}const Em=/^x-parser-/i;function oo(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=>oo(n,t));const r={};for(const[n,s]of Object.entries(e))Em.test(n)||(r[n]=oo(s,t));return r}finally{t.delete(e)}}return e}const pc=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(oo(e),null,2);return o.jsx(Vr,{code:t})},Na=new Set,Xo=e=>e.replace(/^#\//,"").split("/").pop()??e,io=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Sm={objects:new Set,refs:new Set},bt=(e,t,r)=>{if(!e.$ref)return{schema:e,refLabel:io(e)};const n=e.$ref,s=Xo(n);if(r.has(n))return{schema:e,refLabel:s,circular:!0};const i=xt(t(n));if(!i)return{schema:e,refLabel:s};const{schema:a}=Ln(i);r.add(n);try{const l=bt(a,t,r);return{schema:l.schema,refLabel:l.circular?void 0:s,circular:l.circular}}finally{r.delete(n)}},Gt=e=>{const t=e.items,r=Array.isArray(t)?t[0]:t;return ie(r)?r:null},hc=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},Am=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ie(e.additionalItems)?e.additionalItems:null,Nm=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ie(e.contains)?e.contains:null,mc=e=>e.contains!==void 0,Lr=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
128
+
129
+ ${t}`:t},Tm=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),_t=(e,t,r,n)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Lr(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(!ie(a))continue;const l=s.properties[i];ie(l)?s.properties[i]=_t(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 ie(i)&&ie(l)?_t(l,i):ie(i)?i:l}):s.items=t.items;else{const i=Gt(t),a=Gt(s);i&&a?s.items=_t(a,i):i&&(s.items=t.items)}if(t.patternProperties&&ie(t.patternProperties)){const i={...ie(s.patternProperties)?s.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!ie(l)){i[a]=l;continue}const c=i[a];ie(c)?i[a]=_t(c,l):i[a]=l}s.patternProperties=i}if(t.propertyNames!==void 0)if(ie(t.propertyNames)){const i=s.propertyNames;s.propertyNames=ie(i)?_t(i,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ie(t.additionalProperties)){const i=s.additionalProperties;s.additionalProperties=ie(i)?_t(i,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))Tm.has(i)||a===void 0||(s[i]=a);return s},Ta=(e,t,r,n)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,d])=>ie(d)?[u,ze(d,t,r,n)]:[u,d])));const i=Gt(s);i&&(s.items=ze(i,t,r,n));const a=Gn(s);a!==null&&ie(a)&&(s.propertyNames=ze(a,t,r,n));const l=hn(s);l!==null&&ie(l)&&(s.additionalProperties=ze(l,t,r,n));const c=Zo(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,ze(d,t,r,n)]))),s},ze=(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(!ie(d))continue;const{schema:f,circular:p}=bt(d,t,r);if(p)continue;const h=ze(f,t,r,n);if(h.if!==void 0){const g={if:h.if};h.then!==void 0&&(g.then=h.then),h.else!==void 0&&(g.else=h.else),i.push(g)}i.push(...bc(h)),a=_t(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?_t(a,l,t,r):a,u=Ta(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 Ta(e,t,r,n)}finally{n.delete(e)}},Hn=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},Wn=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const r=t.filter(n=>ie(n));return r.length>0?r:null},gc=e=>e.not===void 0?null:typeof e.not=="boolean"||ie(e.not)?e.not:null,Ke=e=>gc(e)!==null,xc=e=>{const{not:t,...r}=e;return r},_m=e=>{const{if:t,then:r,else:n,...s}=e;return s},Xe=e=>e.if!==void 0,Cs=e=>e===void 0?null:typeof e=="boolean"||ie(e)?e:null,bc=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ie(t)):[],Ze=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Gn=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ie(e.propertyNames)?e.propertyNames:null,hn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ie(e.additionalProperties)?e.additionalProperties:null,Zo=e=>{const t=e.patternProperties;return ie(t)?Object.entries(t).flatMap(([r,n])=>ie(n)?[[r,n]]:[]):[]},Cm=(e,t)=>`${e}.[pattern:${t}]`,Kn=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Jr=e=>{const t=Gn(e);if(t!==null&&ie(t))return!0;const r=hn(e);return r!==null&&ie(r)?!0:Zo(e).length>0},yc=e=>!!(Hn(e)||Wn(e)||Kn(e)||Jr(e)||e.type==="array"||e.items||e.type!==void 0),it=e=>!(Ke(e)||Xe(e)||Ze(e)||Hn(e)||Wn(e)||Kn(e)||Jr(e)||e.items||mc(e)||e.type==="array"||e.type==="object");function $m(e){if(typeof hn(e)=="boolean")return!0;const r=Gn(e);return!!(typeof r=="boolean"||r!==null&&ie(r)&&it(r)&&typeof r.pattern=="string"&&r.pattern.length>0)}function _a(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||$m(e)}const wc=(e,t)=>_a(e)?!0:t?_a(t):!1,Im=(e,t)=>{if(Ke(e)||Xe(e)||Ze(e)||Hn(e)||Wn(e)||Kn(e)||Jr(e))return!0;if(e.type==="array"||e.items){if(mc(e)||hc(e)!==null)return!0;const r=Gt(e);if(!r)return!1;if(r.$ref&&t){const{schema:n}=bt(r,t,Na),s=ze(n,t,Na);return!it(s)}return!it(r)}return!1};function kc(e){return JSON.stringify(e)}function Ca(e){return typeof e=="string"?e:JSON.stringify(e)}function qe({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function vc({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 Om(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Rm(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Mm(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Lm(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function $a(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function Ia(e,t){const r=e[t];return typeof r=="number"?{value:r,op:"≤"}:null}function dr({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(qe,{children:String(t.value)}),o.jsx(qe,{children:t.op})]}),o.jsx(qe,{children:e}),r&&o.jsxs(o.Fragment,{children:[o.jsx(qe,{children:r.op}),o.jsx(qe,{children:String(r.value)})]}),n&&o.jsx(qe,{children:n})]})}function Er({value:e,displayValue:t}){const r=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(Ca(e))},n=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(Ca(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??kc(e)})}function Pm({schema:e}){const t=hn(e);return typeof t!="boolean"?null:o.jsx(qe,{children:t?"additional properties allowed":"additional properties not allowed"})}function Dm({schema:e}){const t=Gn(e);return typeof t=="boolean"?o.jsx(vc,{children:t?"any property name":"no property names"}):t!==null&&ie(t)&&it(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(qe,{children:"property name pattern:"}),o.jsx(Er,{value:t.pattern,displayValue:t.pattern})]}):null}function Oa({schema:e,rangeName:t="value"}){const r=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,n=Om(e),s=Rm(e),i=Mm(e),a=Lm(e),l=$a(e,"minItems"),c=Ia(e,"maxItems"),u=$a(e,"minProperties"),d=Ia(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(qe,{children:"multiple of :"}),o.jsx(vc,{children:String(e.multipleOf)})]}),(n||s)&&o.jsx(dr,{name:t,lower:n,upper:s}),(i||a)&&o.jsx(dr,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(dr,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(dr,{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(qe,{children:"regex pattern:"}),o.jsx(Er,{value:e.pattern,displayValue:e.pattern})]}),r&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(qe,{children:"enum values:"}),r.map((f,p)=>o.jsx(Er,{value:f},`${p}-${kc(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(qe,{children:"const value:"}),o.jsx(Er,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(qe,{children:"unique"}),o.jsx(Pm,{schema:e}),o.jsx(Dm,{schema:e})]})}function jc({schema:e,itemSchema:t,fieldName:r,className:n="flex flex-col gap-1"}){const s=t!=null&&it(t),i=r??"value";return o.jsxs("div",{className:n,children:[o.jsx(Oa,{schema:e,rangeName:i}),s&&o.jsx(Oa,{schema:t,rangeName:"item"})]})}const Ec=(e,t)=>{const r=Hn(e);if(r)return{text:`one of (${r.length})`};const n=Wn(e);if(n)return{text:`any of (${n.length})`};if(Ke(e)&&!yc(xc(e)))return{text:"not"};if(e.type==="array"||e.items){const u=Gt(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?Xo(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=hn(e);!Kn(e)&&a!==null&&ie(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}},Bm=(e,t)=>{if(!t)return!1;const r=Ec(e,t);return!r.refHint&&!r.text.includes(`(${t})`)};function Sc({schema:e,refLabel:t,className:r="text-xs text-foreground-muted"}){const{text:n,format:s,refHint:i}=Ec(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 Ra="ml-6";function fr({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(Sc,{schema:e})]}),wc(e)&&o.jsx(jc,{schema:e,className:`flex flex-col gap-1 mt-1 ${Ra}`}),r&&r.split(`
130
+
131
+ `).map((n,s)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${Ra} leading-relaxed`,children:n},s))]})}function $s({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 Fm({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 Ac({tabs:e,selected:t,onChange:r,ariaLabel:n}){const s=x.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 zm({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(Ac,{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 Um="ml-0 border-dashed border-border";function Ut({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 ${Um}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:ho(e,n)},children:t})}function Hm({depth:e,expanded:t,onToggle:r}){const{depthColors:n}=Be(),s=ho(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 Wm="ml-6";function Ge({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(),g=ho(r,h),w=n&&Bm(n,s),y=u?Wm:"";let E="",N=t;if(t.endsWith("[]")){const j=t.slice(0,-2),I=j.lastIndexOf(".");I>=0?(E=j.slice(0,I+1),N=`${j.slice(I+1)}[]`):N=t}else{const j=t.lastIndexOf("."),I=t.lastIndexOf("[]"),W=Math.max(j,I);W>=0&&(E=t.slice(0,W+(t[W]==="."?1:2)),N=t.slice(W+(t[W]==="."?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:[E&&o.jsx("span",{className:"text-foreground-muted",children:E}),o.jsx("span",{className:"font-semibold",style:{color:g},children:N})]}),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(Sc,{schema:n,refLabel:s}),w&&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&&wc(n,i)&&o.jsx(jc,{schema:n,itemSchema:i,fieldName:N,className:`flex flex-col gap-1 mt-1 ${y}`}),c&&c.split(`
132
+
133
+ `).map((j,I)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${y} leading-relaxed`,children:j},I)),u&&o.jsx(Hm,{depth:r,expanded:d,onToggle:f})]})}function Is({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 Gm({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(Ut,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(Is,{label:"If schema matches:",children:e}),t!=null&&o.jsx(Is,{label:"Then schema should follow:",children:t}),r!=null&&o.jsx(Is,{label:"Else schema should follow:",children:r})]})})]})}function pr({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 Km=e=>e==="none"?"depth":e;function ot({schema:e,path:t,depth:r,required:n,refStack:s,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=Sm,focusTokens:d=null,focusId:f=null}){var X;const p=Km(l),h=d!=null,w=h&&d.length===0?f??void 0:void 0,[y,E]=x.useState(c||h),[N,j]=x.useState(c);N!==c&&(j(c),E(c||h)),x.useEffect(()=>{h&&E(!0)},[h]);const[I,W]=x.useState(0),G=(X=d==null?void 0:d[0])==null?void 0:X.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),T=G?Number(G[1]):-1;x.useEffect(()=>{T>=0&&W(T)},[T]);const v=_o(),{schema:b,refLabel:C,circular:B}=x.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:io(e),circular:!0};const O=bt(e,i,s);return O.circular?O:{...O,schema:ze(O.schema,i,s)}},[e,i,s,u,v]),_=x.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),H=xc(_m(b)),Z=!yc(H)&&(Ke(b)||Xe(b)||Ze(b)),se=()=>{const O=gc(b);if(O===null)return null;if(typeof O=="boolean")return o.jsx($s,{children:o.jsx(Fm,{value:O})});const ee=bt(O,i,s);if(ee.circular)return o.jsx($s,{children:o.jsx(Ge,{path:t,depth:r+1,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const le=ze(ee.schema,i,s),K=it(le);return o.jsx($s,{children:K?o.jsx(fr,{schema:le,showBorder:!1}):o.jsx(ot,{schema:O,path:t,depth:r+1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},S=(O,ee)=>{if(typeof O=="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:O?"any value":"false schema"});const le=bt(O,i,s);if(le.circular)return o.jsx(Ge,{path:ee,depth:r+1,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const K=ze(le.schema,i,s);return it(K)?o.jsx(fr,{schema:K,showBorder:!1}):o.jsx(ot,{schema:O,path:ee,depth:r+1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},A=O=>{const ee=Cs(O.if);if(ee===null)return null;const le=Cs(O.then),K=Cs(O.else);return o.jsx(Gm,{ifContent:S(ee,t),thenContent:le!==null?S(le,t):void 0,elseContent:K!==null?S(K,t):void 0})},F=()=>{const O=bc(b);return O.length===0?null:o.jsx(o.Fragment,{children:O.map((ee,le)=>o.jsx("div",{children:A(ee)},le))})};if(B)return o.jsx(Ge,{id:w,path:t,depth:r,typeLabelOverride:`↩ ${e.$ref??C??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(Z){const O=o.jsxs(o.Fragment,{children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?O:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(ee=>!ee)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:O})]})}const J=Hn(H),ae=Wn(H),te=J??ae,Te=J?"oneOf":"anyOf";if(te){const O=te.map((Le,Q)=>typeof Le.title=="string"?Le.title:`case ${Q+1}`),ee=a?1:r+1,le=te[I],K=bt(le,i,s),pe=K.circular?K.schema:ze(K.schema,i,s),we=!K.circular&&it(pe),fe=d&&T===I?d.slice(1):null,Me=we?o.jsx(fr,{schema:pe,showBorder:!1}):o.jsx(ot,{schema:le,path:t,depth:ee-1,refStack:s,deref:i,ancestors:_,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:fe,focusId:f},I),xe=o.jsx(zm,{variant:Te,caseCount:te.length,caseLabels:O,selectedCase:I,onSelectCase:W,children:Me}),He=o.jsxs(o.Fragment,{children:[xe,Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?He:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(Le=>!Le)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:He})]})}const q=(O,ee,le)=>{const K=bt(O,i,s);if(K.circular)return o.jsx(Ge,{path:ee,depth:le,typeLabelOverride:`↩ ${O.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const pe=ze(K.schema,i,s);return it(pe)?o.jsx(fr,{schema:pe,showBorder:!1}):o.jsx(ot,{schema:O,path:ee,depth:le,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c})},ve=O=>{const ee=H.properties??{},le=new Set(H.required??[]),K=Gn(H),pe=hn(H),we=Zo(H);return o.jsxs(o.Fragment,{children:[Object.entries(ee).map(([fe,Me])=>{if(!ie(Me))return null;const xe=d&&d[0]==="properties"&&d[1]===fe?d.slice(2):null;return o.jsx(ot,{schema:Me,path:`${t}.${fe}`,depth:O,required:le.has(fe),refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c,focusTokens:xe,focusId:f},fe)}),K!==null&&ie(K)&&o.jsx(pr,{label:"Property names must adhere to:",children:q(K,`${t}.[propertyName]`,O)}),we.map(([fe,Me])=>o.jsx(ot,{schema:Me,path:Cm(t,fe),depth:O,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c},fe)),pe!==null&&ie(pe)&&o.jsx(pr,{label:"Additional properties must adhere to:",children:q(pe,`${t}.[additionalProperty]`,O)}),Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]})};if(Kn(H)||Jr(H))return a?ve(r+1):o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(O=>!O)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:ve(r+1)})]});if(H.type==="array"||H.items){const O=hc(H),ee=O!==null,le=ee?Am(H):null,K=Nm(H),pe=K!==null,we=ee?null:Gt(H),fe=we!==null,Me=ee||fe||pe||Ke(b)||Xe(b)||Ze(b),xe=`${t}[]`,He=a?t:xe,Le=fe?bt(we,i,s):null,Q=(Le==null?void 0:Le.schema)??null,je=Q?ze(Q,i,s):null,_e=Q!==null&&(_.objects.has(Q)||typeof(we==null?void 0:we.$ref)=="string"&&_.refs.has(we.$ref)),me=Q!==null?{objects:new Set(_.objects).add(Q),refs:typeof(we==null?void 0:we.$ref)=="string"?new Set(_.refs).add(we.$ref):_.refs}:_,mt=!ee&&!pe&&je!==null&&it(je),et=je!=null&&je.properties?Object.entries(je.properties).filter(([,U])=>ie(U)):[],Lt=new Set(je&&Array.isArray(je.required)?je.required:[]),tt=!ee&&d&&d[0]==="items"?d.slice(1):null,D=U=>o.jsxs(o.Fragment,{children:[ee?o.jsxs(o.Fragment,{children:[O.map((ne,ue)=>o.jsx(ot,{schema:ne,path:`${t}[${ue}]`,depth:U,refStack:s,deref:i,ancestors:_,branchLineVariant:p,defaultExpanded:c},ue)),le!==null&&typeof le!="boolean"&&o.jsx(pr,{label:"Additional items:",children:q(le,`${t}[*]`,U)}),le===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):fe&&(_e?o.jsx(Ge,{path:He,depth:U,typeLabelOverride:`↩ ${we.$ref??io(Q)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):et.length>0?et.map(([ne,ue])=>{const Ce=tt&&tt[0]==="properties"&&tt[1]===ne?tt.slice(2):null;return o.jsx(ot,{schema:ue,path:`${He}.${ne}`,depth:U,required:Lt.has(ne),refStack:s,deref:i,ancestors:me,branchLineVariant:p,defaultExpanded:c,focusTokens:Ce,focusId:f},ne)}):o.jsx(ot,{schema:we,path:He,depth:U,refStack:s,deref:i,ancestors:me,branchLineVariant:p,defaultExpanded:c,focusTokens:tt,focusId:f})),pe&&o.jsx(pr,{label:"Contains at least one:",children:typeof K=="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:K?"any item":"impossible constraint"}):q(K,`${t}[contains]`,U)}),Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return mt&&!Ke(b)&&!Xe(b)&&!Ze(b)?o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:Lr(b.description,je.description),expandable:!1,expanded:!1,onToggle:()=>{}}):mt?o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:Lr(b.description,je.description),expandable:!0,expanded:y,onToggle:()=>E(U=>!U)}),y&&o.jsxs(Ut,{depth:r,lineVariant:l,children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]})]}):a?Me?D(r+1):null:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:xe,depth:r,schema:b,itemSchema:je,refLabel:C,required:n,description:b.description,expandable:ee||fe||pe||Ke(b)||Xe(b)||Ze(b),expanded:y,onToggle:()=>E(U=>!U)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:D(r+1)})]})}if(Ke(b)||Xe(b)||Ze(b)){const O=o.jsxs(o.Fragment,{children:[Ke(b)&&se(),Xe(b)&&A(b),Ze(b)&&F()]});return a?O:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!0,expanded:y,onToggle:()=>E(ee=>!ee)}),y&&o.jsx(Ut,{depth:r,lineVariant:l,children:O})]})}return a?null:o.jsx(Ge,{id:w,path:t,depth:r,schema:b,refLabel:C,required:n,description:b.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Qo({schema:e,rootName:t,className:r="",focusTokens:n=null,focusId:s=null}){const{deref:i,defaultSchemaExpanded:a=!1}=Be(),l=x.useMemo(()=>new Set,[]),c=xt(e),u=x.useMemo(()=>c?ze(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?Xo(c.$ref):void 0)??"schema",f=!!t;if(!Im(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:r,children:o.jsx(ot,{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,g=Gt(u),w=g?ze(g,i,l):null,y=w!==null&&it(w);return o.jsx("div",{className:r,children:o.jsx(Ge,{path:h,depth:0,schema:u,itemSchema:y?w:void 0,description:u.type==="array"||u.items?Lr(u.description,g==null?void 0:g.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:r,children:o.jsx(ot,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:n,focusId:s})})}const Vm=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function hr(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function sn(e,t=()=>{},r=new Set,n=new Set){if(typeof e.$ref=="string"){const s=e.$ref,i=t(s);return Vm(i)?n.has(s)?hr(i,"null")?{type:"null"}:{}:sn(i,t,new Set,new Set(n).add(s)):{}}if(r.has(e))return hr(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...i}=e;return sn({...i,...s[0]},t,r,n)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...i}=e;return sn({...i,...s[0]},t,r,n)}if(hr(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"]}:sn(a,t,r,n)}return{...e,properties:s}}finally{r.delete(e)}}if(hr(e,"array")&&e.items&&typeof e.items=="object"){r.add(e);try{return{...e,items:sn(e.items,t,r,n)}}finally{r.delete(e)}}return e}function Jm({schema:e,providedExample:t}){const r=t!==void 0,[n,s]=x.useState(r?t:null),{deref:i}=Be();if(x.useEffect(()=>{if(r){s(t);return}let l=!1;return Promise.resolve().then(()=>require("./index-d8kJa7YD.cjs")).then(({generate:c})=>c(sn(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(Vr,{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 Kt({schema:e,label:t,rootName:r,description:n,schemaFormat:s,originalSchema:i,conversionError:a,pendingConversion:l,example:c,defaultView:u="example"}){const d=Sl(s),f=!l&&sp(s,a),[p,h]=x.useState(f&&u==="example"?"example":"schema");return x.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(Ac,{tabs:[...f?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:g=>h(g),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 ",Al(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(Qo,{schema:e,rootName:r??(typeof t=="string"?t:void 0)}),p==="json"&&o.jsx(pc,{schema:i??e}),p==="example"&&f&&o.jsx(Jm,{schema:e,providedExample:c})]})]})}function Nc({message:e,expanded:t,onToggleExpanded:r,paddingX:n="px-4",focusSection:s=null}){var h;const[i,a]=x.useState("payload");x.useEffect(()=>{(s==="headers"||s==="payload")&&a(s)},[s]);const{deref:l}=Be(),c=_o(),u=x.useMemo(()=>e.payload?Ln(e.payload,l):null,[e.payload,l,c]),d=x.useMemo(()=>e.headers?Ln(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(Vt,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:g=>a(g)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(Kt,{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(Kt,{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((g,w)=>o.jsx(Vo,{name:`#${g.name}`},w))})]})})}),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(pn,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function Ym({messageKey:e,message:t,first:r,isSelected:n,focusSection:s}){const[i,a]=x.useState(!1);return x.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(Nc,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:n?s:null})})})]})}function Tc({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(Ym,{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(Ot,{content:i,stickySideContent:!1,layout:n})})}function _c({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:zt(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 Cc(e){return o.jsx(yo,{...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 Xm(e){return o.jsx(yo,{...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 $c({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(Xm,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx($t,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),r]})}function Ic({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 Vn({trigger:e,children:t,defaultExpanded:r=!1,forceExpanded:n=!1,ariaLabelledBy:s,className:i=""}){const[a,l]=x.useState(r),c=x.useId();return x.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(pn,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Ic,{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 Os={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 Rs(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 Zm(e){return e.name||e.scheme||e.bearerFormat||e.type||void 0}function Qm(e){const t=(e??[]).filter(s=>Os[Rs(s)]),r=new Map;for(const s of t){const i=Os[Rs(s)];r.set(i,(r.get(i)??0)+1)}const n=new Set;return t.map((s,i)=>{const a=Rs(s),l=Os[a],c=(r.get(l)??0)>1?Zm(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 qo({securities:e}){var u;const t=x.useMemo(()=>Qm(e),[e]),r=t.length>1,[n,s]=x.useState(r?null:((u=t[0])==null?void 0:u.id)??null);x.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(Vt,{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(mr,{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(mr,{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(mr,{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(mr,{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(qm,{security:l}),a==="apiKey"&&o.jsx(eg,{security:l}),a==="openIdConnect"&&o.jsx(tg,{security:l}),a==="oauth2"&&o.jsx(ng,{security:l})]})]})}const mr=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(lt,{children:e})}):o.jsx("span",{children:t}),qm=({security:e})=>e!=null&&e.description?o.jsx(lt,{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."]}),eg=({security:e})=>{if(e!=null&&e.description)return o.jsx(lt,{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."]})},tg=({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(lt,{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:Ad(t)})})]})]})},ng=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(lt,{children:e.description}),t&&Object.entries(t).map(([r,n])=>{var c,u;let s="",i="";switch(r){case"clientCredentials":s=nd,i=rd;break;case"implicit":s=ed,i=td;break;case"password":s=sd,i=od;break;case"authorizationCode":s=id,i=ad;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 rg(e){return e.startsWith("http://")||e.startsWith("https://")}function Oc(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Rc({value:e}){if(e==null)return null;if(typeof e=="string"&&rg(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(lt,{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:Oc(r)}),o.jsx(Rc,{value:n})]},r))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Mc({bindings:e,expand:t=!1,protocol:r,focused:n}){const s=ud[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(Vn,{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:Oc(a)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(Rc,{value:l})})]},a))})})}function sg({host:e,protocol:t,description:r,tags:n,variables:s,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=s,d=x.useId();return o.jsxs("div",{children:[o.jsx($c,{address:e,variables:u,children:o.jsx("div",{className:"mt-2",children:n&&n.map((f,p)=>{const h=f,g=h.externalDocs;return o.jsx(Vo,{href:g&&g.url,title:h.description||(g&&g.description?g.description:void 0),name:h.name},p)})})}),o.jsx(lt,{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(Cc,{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(Vn,{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(qo,{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(ko,{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(Mc,{bindings:f,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function Lc({servers:e,selectedServer:t,onSelectServer:r,focusSection:n=null,layout:s}){const i=Object.keys(e),[a,l]=x.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(sg,{...e[c],serverKey:c,focusSection:t||a?n:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:Va,content:d,sideContent:o.jsx(_c,{serverNames:i,current:c,setCurrent:u}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:s})})}const Pc=x.forwardRef(function({isOpen:t,side:r,onClose:n,title:s,headerActions:i,children:a,width:l="w-[50rem]"},c){x.useEffect(()=>{const N=j=>{j.key==="Escape"&&n()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[n]);const u=r==="right"?"right-0":"left-0",d=r==="right"?"translateX(100%)":"translateX(-100%)",{portalHost:f,rootElement:p,sidePanelContainment:h,sidePanelTopOffset:g=0}=Be(),w=h==="component";x.useEffect(()=>{if(!t||!f)return;const N=w?kd(f,p):xo(f);if(N)return qa(N)},[w,t,f,p]);const y=bo(p,w),E=(()=>{if(!w)return{position:"fixed",inset:0};if(!y)return{position:"fixed",inset:0};const N=Math.max(g,y.top),j=Math.max(0,y.left),I=Math.min(window.innerHeight,y.bottom),W=Math.min(window.innerWidth,y.right);return{position:"fixed",top:N,left:j,width:Math.max(0,W-j),height:Math.max(0,I-N)}})();return f?an.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...E,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 Dc({message:e,messageId:t,i:r}){const[n,s]=x.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(Nc,{message:e,expanded:n,onToggleExpanded:()=>s(i=>!i)})]})}function og({requestMessages:e,reply:t,isSend:r,operationId:n}){const[s,i]=x.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($t,{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
134
+ ${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(Dc,{message:f,messageId:f.name,i:p},p))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}const ig="",ag=`
135
+ `;var ht=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??ig,this.lineJoin=t??ag}},Jn=class extends Error{constructor(e){super(e),this.name="AsyncSnippetError"}},lg=class extends Jn{constructor(e){super(`No operation found with id "${e}"`),this.name="UnknownOperationError"}},cg=class extends Jn{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"}},ug=class extends Jn{constructor(e){super(`Operation "${e}" has no channels`),this.name="MissingChannelError"}},dg=class extends Jn{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"}},Ma=class extends Jn{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 La=10;function fg(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function pg(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 vt(e,t){let r=t;for(let n=0;fg(r);n++){if(n>=La)throw new Error(`Exceeded max $ref depth (${La}) resolving "${r.$ref}" — possible cycle`);r=pg(e,r.$ref)}return r}const hg=10;function mg(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 gg(e){return Array.isArray(e)?e.find(t=>t!=="null")??e[0]:e}function ao(e,t,r=0){if(r>hg)return;const n=vt(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(gg(s.type)){case"object":{const i={};for(const[a,l]of Object.entries(s.properties??{})){const c=ao(e,l,r+1);c!==void 0&&(i[a]=c)}return i}case"array":{if(s.items===void 0)return[];const i=ao(e,s.items,r+1);return i!==void 0?[i]:[]}case"string":return mg(s.format);case"integer":case"number":return 0;case"boolean":return!1;case"null":return null;default:return}}const xg=10;function bg(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function $n(e,t,r=0){if(r>=xg||t===null||typeof t!="object")return t;if(Array.isArray(t))return t.map(s=>$n(e,s,r+1));if(bg(t))return $n(e,vt(e,t),r+1);const n={};for(const[s,i]of Object.entries(t))n[s]=$n(e,i,r+1);return n}function Bc(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 gr(e,t){return e?Bc(e.default,e.examples,t):{value:`<${t}>`,isPlaceholder:!0}}function Pa(e){const t={},r=[];for(const[n,s]of Object.entries((e==null?void 0:e.properties)??{})){const i=Bc(s.default,s.examples,n);t[n]=i.value,i.isPlaceholder&&r.push(n)}return{values:t,placeholders:r}}function Da(e,t){return t!=null&&t.length?t.map(r=>vt(e,r)).filter(r=>!!(r!=null&&r.type)):[]}const yg={"kafka-secure":"kafka",wss:"ws"};function wg(e){return yg[e]??e}function kg(e){return typeof e=="object"&&e!==null&&typeof e.$ref=="string"}function vg(e){return e.slice(e.lastIndexOf("/")+1)}function jg(e,t){return t&&t.length>0?t.map(r=>{const n=vt(e,r);if(n)return{name:kg(r)?vg(r.$ref):"",server:n}}).filter(r=>!!r):Object.entries(e.servers??{}).map(([r,n])=>{const s=vt(e,n);return s?{name:r,server:s}:void 0}).filter(r=>!!r)}function Fc(e,t){var i;const r=(i=e.operations)==null?void 0:i[t],n=r&&vt(e,r);if(!n)throw new lg(t);const s=vt(e,n.channel);if(!s)throw new ug(t);return{operation:n,channel:s}}function zc(e,t,r,n){var l;const s=jg(e,r.servers??t.servers),i=s.find(c=>wg(c.server.protocol)===n),a=(l=t.bindings)==null?void 0:l[n];return{servers:s,matchedServer:i,eligible:!!(i||a)}}function Eg(e,t,r){try{const{operation:n,channel:s}=Fc(e,t);return zc(e,s,n,r).eligible}catch{return!1}}function Sg(e,t,r){var B,_,H,Z,se,S,A,F,J,ae,te,Te,q,ve;const{operation:n,channel:s}=Fc(e,t),{servers:i,matchedServer:a,eligible:l}=zc(e,s,n,r);if(!l)throw new dg(t,r);const c=[];let u={},d={},f;if(r==="ws"){const P=Pa((_=(B=s.bindings)==null?void 0:B.ws)==null?void 0:_.query),X=Pa((Z=(H=s.bindings)==null?void 0:H.ws)==null?void 0:Z.headers);u=P.values,d=X.values,c.push(...P.placeholders.map(O=>`query param "${O}"`)),c.push(...X.placeholders.map(O=>`header "${O}"`))}else r==="kafka"&&(f=(S=(se=s.bindings)==null?void 0:se.kafka)==null?void 0:S.topic);const p=s.address??"";let h=p;for(const[P,X]of Object.entries(s.parameters??{})){const O=gr(X,P);h=h.replace(`{${P}}`,O.value),O.isPlaceholder&&c.push(`channel parameter "${P}"`)}r==="kafka"&&f&&(h=f);const g=(A=a??i[0])==null?void 0:A.server,w=g?`${g.protocol}://${g.host}${g.pathname??""}`:"",y=(g==null?void 0:g.host)??"",E=Da(e,g==null?void 0:g.security),N=i.map(({name:P,server:X})=>({name:P,host:X.host,protocol:X.protocol,pathname:X.pathname,url:`${X.protocol}://${X.host}${X.pathname??""}`,description:X.description,security:Da(e,X.security)})),j=n.messages!==void 0?vt(e,n.messages[0]):vt(e,Object.values(s.messages??{})[0]),I=(F=j==null?void 0:j.examples)==null?void 0:F[0];let W,G;if(I)W=I.name,G=I.payload;else if((j==null?void 0:j.payload)!==void 0){if(G=ao(e,j.payload),G===void 0)throw new Ma(t);c.push("message payload (no explicit example — generated from its schema)")}else throw new Ma(t);const T=(j==null?void 0:j.payload)!==void 0?$n(e,j.payload):void 0,v=(j==null?void 0:j.headers)!==void 0?$n(e,j.headers):void 0,b=n.action==="send"?"send":"receive";let C;if(r==="kafka"){const P=(ae=(J=j==null?void 0:j.bindings)==null?void 0:J.kafka)==null?void 0:ae.key,X=P?gr(P,"kafka message key"):void 0;X!=null&&X.isPlaceholder&&c.push("kafka message key");const O=gr((Te=(te=n.bindings)==null?void 0:te.kafka)==null?void 0:Te.clientId,"kafka clientId");O.isPlaceholder&&c.push("kafka clientId");let ee;b==="receive"&&(ee=gr((ve=(q=n.bindings)==null?void 0:q.kafka)==null?void 0:ve.groupId,"kafka consumer group id"),ee.isPlaceholder&&c.push("kafka consumer group id")),C={key:X==null?void 0:X.value,groupId:ee==null?void 0:ee.value,clientId:O.value}}return{operationId:t,action:b,protocol:r,serverUrl:w,serverHost:y,servers:N,channelAddress:h,channelTemplate:p,query:u,headers:d,operationSummary:n.summary,operationDescription:n.description,message:{name:W,payload:G,title:(j==null?void 0:j.title)??(j==null?void 0:j.name),summary:j==null?void 0:j.summary,description:j==null?void 0:j.description,contentType:j==null?void 0:j.contentType,payloadSchema:T,headersSchema:v},placeholders:c,info:e.info,security:E,...C?{kafka:C}:{}}}function Ag(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 Ng(e,t){if(t.length!==0){e("**Authorization:**");for(const r of t)if(e(`- **${Ag(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 Tg(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&&(Ng(e,r.security),t())}function Ba(e,t,r,n){e(`#### \`${r}\``),t(),e("```json");for(const s of JSON.stringify(n,null,2).split(`
136
+ `))e(s);e("```"),t()}function Uc(e,t){var u,d,f,p,h,g,w;const r={indent:" ",...t},{push:n,blank:s,join:i}=new ht({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 y of e.servers)Tg(n,s,y)}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(y=>`\`${y}=${e.query[y]}\``).join(", ")}`),c.length>0&&n(`**Headers:** ${c.map(y=>`\`${y}: ${e.headers[y]}\``).join(", ")}`),((h=e.kafka)==null?void 0:h.clientId)!==void 0&&n(`**Kafka client ID:** \`${e.kafka.clientId}\``),e.action==="receive"&&((g=e.kafka)==null?void 0:g.groupId)!==void 0&&n(`**Kafka consumer group ID:** \`${e.kafka.groupId}\``),((w=e.kafka)==null?void 0:w.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&&Ba(n,s,"payload",e.message.payloadSchema),e.message.headersSchema!==void 0&&Ba(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 y of e.placeholders)n(`- ${y}`,1)}return i()}const _g={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)=>Uc(e,t)},Cg={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)=>Uc(e,t)};function Yn(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 $g={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 ht({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=Yn(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(`
137
137
  `);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(`
138
- `))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()}},Cg={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 ht({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(`
138
+ `))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()}},Ig={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 ht({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(`
139
139
  `);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(`
140
- `))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 io(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?"[]":`[
141
- ${e.map(a=>`${s}${io(a,t,r+1)}`).join(`,
140
+ `))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 lo(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?"[]":`[
141
+ ${e.map(a=>`${s}${lo(a,t,r+1)}`).join(`,
142
142
  `)},
143
143
  ${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
144
- ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${io(l,t,r+1)}`).join(`,
144
+ ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${lo(l,t,r+1)}`).join(`,
145
145
  `)},
146
- ${n}}`}const $g={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 ht({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=Jn(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=io(e.message.payload,r.indent).split(`
146
+ ${n}}`}const Og={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 ht({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=Yn(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=lo(e.message.payload,r.indent).split(`
147
147
  `);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(`
148
- `))n(`# ${c}`,2);s(),n("async for message in websocket:",2),n("print(message)",3)}return s(),s(),n("asyncio.run(main())"),i()}};function ao(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?"[]":`[
149
- ${e.map(a=>`${s}${ao(a,t,r+1)}`).join(`,
148
+ `))n(`# ${c}`,2);s(),n("async for message in websocket:",2),n("print(message)",3)}return s(),s(),n("asyncio.run(main())"),i()}};function co(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?"[]":`[
149
+ ${e.map(a=>`${s}${co(a,t,r+1)}`).join(`,
150
150
  `)},
151
151
  ${n}]`;const i=Object.entries(e);return i.length===0?"{}":`{
152
- ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${ao(l,t,r+1)}`).join(`,
152
+ ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${co(l,t,r+1)}`).join(`,
153
153
  `)},
154
- ${n}}`}const Ig={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 ht({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=ao(e.message.payload,r.indent).split(`
154
+ ${n}}`}const Rg={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 ht({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=co(e.message.payload,r.indent).split(`
155
155
  `);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(`
156
- `))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()}},Og={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 ht({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('${Jn(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){n("socket.addEventListener('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
156
+ `))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()}},Mg={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 ht({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('${Yn(e.serverUrl,e.channelAddress,e.query)}');`),s(),e.action==="send"){n("socket.addEventListener('open', () => {");const l=JSON.stringify(e.message.payload,null,2).split(`
157
157
  `);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(`
158
- `))n(`// ${l}`);s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}return i()}},Rg={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 ht({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(`
158
+ `))n(`// ${l}`);s(),n("socket.addEventListener('message', (event) => {"),n("console.log(event.data);",1),n("});")}return i()}},Lg={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 ht({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(`
159
159
  `);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(`
160
- `))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 lo(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{}{
161
- ${e.map(a=>`${s}${lo(a,t,r+1)}`).join(`,
160
+ `))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 uo(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{}{
161
+ ${e.map(a=>`${s}${uo(a,t,r+1)}`).join(`,
162
162
  `)},
163
163
  ${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
164
- ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${lo(l,t,r+1)}`).join(`,
164
+ ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${uo(l,t,r+1)}`).join(`,
165
165
  `)},
166
- ${n}}`}const Mg={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 ht({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=Jn(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=lo(e.message.payload,r.indent).split(`
166
+ ${n}}`}const Pg={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 ht({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=Yn(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=uo(e.message.payload,r.indent).split(`
167
167
  `);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(`
168
- `))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 co(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{}{
169
- ${e.map(a=>`${s}${co(a,t,r+1)}`).join(`,
168
+ `))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 fo(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{}{
169
+ ${e.map(a=>`${s}${fo(a,t,r+1)}`).join(`,
170
170
  `)},
171
171
  ${n}}`;const i=Object.entries(e);return i.length===0?"map[string]interface{}{}":`map[string]interface{}{
172
- ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${co(l,t,r+1)}`).join(`,
172
+ ${i.map(([a,l])=>`${s}${JSON.stringify(a)}: ${fo(l,t,r+1)}`).join(`,
173
173
  `)},
174
- ${n}}`}const Lg={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 ht({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=co(e.message.payload,r.indent).split(`
174
+ ${n}}`}const Dg={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 ht({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=fo(e.message.payload,r.indent).split(`
175
175
  `);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(`
176
- `))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()}},Pg={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 ht({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=Jn(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(`
176
+ `))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()}},Bg={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 ht({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=Yn(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(`
177
177
  `);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(`
178
- `))n(`// ${l}`);s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}return i()}},cn={};function Yn(e){if(cn[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);cn[e.info.key]={...e,clientsById:{...e.clientsById}}}function ct(e,t){const r=cn[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 Dg(){return Object.values(cn).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function Bg(e,t){const r=[];for(const n of Dg()){const s=n.clients.filter(i=>vg(e,t,i.protocol));s.length>0&&r.push({...n,default:s[0].key,clients:s})}return r}Yn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});ct("agent",Tg);ct("agent",Ng);Yn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});ct("javascript",Pg);ct("javascript",Og);ct("javascript",Rg);Yn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});ct("python",$g);ct("python",Ig);Yn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});ct("rust",_g);ct("rust",Cg);Yn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});ct("go",Mg);ct("go",Lg);var Fg=class{constructor(e){this.document=e}convert(e,t,r,n={}){var a;const s=(a=cn[t])==null?void 0:a.clientsById[r];if(!s){const l=Object.values(cn).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new ag(t,r,l)}const i=jg(this.document,e,s.info.protocol);return s.convert(i,n)}};const zg="javascript",Ug="ws";function Hg(e,t){return Bg(e,t)}function zc(e,t,r,n){try{return new Fg(e).convert(t,r,n)}catch{return null}}function Wg(e,t,r){if(t){for(const n of r)for(const s of n.clients)if(zc(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${zg}:${Ug}`}const Gg={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 Uc(e){return Gg[e]??"plaintext"}const Kg={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 Fr(e){return e==="plaintext"||!!at.getLanguage(e)}async function Hc(e){if(Fr(e))return;const t=Kg[e];if(!t)return;const r=await t();at.registerLanguage(e,r.default)}function Vg({operationId:e}){const{document:t,showCodeSamples:r}=jt(),n=x.useId(),s=x.useMemo(()=>e?Hg(t,e):[],[t,e]),i=x.useMemo(()=>Wg(t,e,s),[t,e,s]),[a,l]=x.useState(null),c=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[u,d]=c.split(":"),f=Uc(u),[,p]=x.useState(()=>Fr(f));x.useEffect(()=>{p(Fr(f));let g=!1;return Hc(f).then(()=>{g||p(!0)}),()=>{g=!0}},[f]);const h=x.useMemo(()=>e?zc(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:g=>l({document:t,operationId:e,selection:g.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(g=>o.jsx("optgroup",{label:g.title,children:g.clients.map(w=>o.jsx("option",{value:`${g.key}:${w.key}`,children:w.title},w.key))},g.key))})]}),o.jsx(Xr,{code:h,language:f})]})}function Wc({label:e,children:t}){return o.jsx(Ur,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(x.Suspense,{fallback:null,children:t})})}function Gc(){const{plugins:e,pluginSlotRegistry:t}=jt();return x.useMemo(()=>t??Va(e??[]),[t,e])}function Kc(e){return Gc().get(e)??[]}function qo({name:e,context:t}){const r=Kc(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Wc,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function Vc(e){return Gc().get(e)??[]}const An="reference";function Jc({name:e,context:t,enabled:r=!0,children:n}){const s=Vc(e),[i,a]=x.useState(An),[l,c]=x.useState(()=>new Set([An])),u=x.useId(),d=x.useMemo(()=>new Map(s.map(y=>[y.id,y])),[s]),f=r&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??An,g=[{id:An,name:"Reference"},...s.map(y=>({id:y.id,name:y.label}))],w=y=>{c(E=>E.has(y)?E:new Set([...E,y])),a(y)};return f?o.jsxs(o.Fragment,{children:[o.jsx(Vt,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:g,current:h,onChange:w}),o.jsx(bd,{tabs:g,current:h,idPrefix:u,renderPanel:(y,E)=>{if(!E&&!l.has(y.id))return null;if(y.id===An)return n;const N=d.get(y.id);if(!N)return null;const j=N.Component;return o.jsx(Wc,{label:`${e}:${N.pluginName}`,children:o.jsx(j,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function Jg({op:e,id:t,focusSection:r=null}){var w;const{document:n}=Ha(),s=x.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)?(w=c.find(y=>y.bindings))==null?void 0:w.bindings:void 0),h=e.action===Tr.SEND,g=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((y,E)=>o.jsx(Lc,{message:y,messageId:y.name,i:E},E))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(Jc,{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(Kr,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(lt,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Vg,{operationId:t}),t&&o.jsx(qo,{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(Kn,{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(Qo,{securities:f})})})]}),p&&Object.entries(p).map(([y,E])=>E?o.jsxs("div",{id:`operation-${t}-bindings-${y}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Oc,{protocol:y,bindings:E,focused:r===`binding:${y}`})]},y):null),u?o.jsx(rg,{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:"]}),g]}),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((y,E)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:y.name},E))})]})]})})})}function Yc({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 N;const p=e[f],h=p.channel,g=h==null?void 0:h.address,w=h==null?void 0:h.parameters,y=((N=p.action)==null?void 0:N.toUpperCase())??"",E=t===f;return o.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),role:"button",tabIndex:0,"aria-label":`${y||"Operation"} ${g??f}`,"aria-current":E?"true":void 0,onKeyDown:j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),i(f))},className:`cursor-pointer hover:bg-neutral-50 ${E?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:g&&o.jsx($t,{address:g,parameters:w,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(It,{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(It,{method:a.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx($t,{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(Ot,{title:id,content:d,stickySideContent:!1,layout:s})}),o.jsx(Mc,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(Jg,{op:a,id:t,focusSection:n},t)})]})}function Qr({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=Be(),i=To(),a=x.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Rn(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=jl(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"," ",El(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(dc,{schema:u.originalSchema})}):o.jsx(Zo,{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 AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{content:l,stickySideContent:!1,layout:n})})}const Yg=e=>e==="operations"||e==="messages"||e==="schemas";function Xg({asyncapi:e,config:t,plugins:r}){var H,Z,se,S;const n=t.show??{},[s,i]=x.useState(!1),[a,l]=x.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&lc(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Wr}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:ol}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:yo}]:[]],{query:p,setQuery:h,results:g}=Lf(e,{threshold:.3,limit:20}),{effectiveTab:w,focusTab:y,navActiveSection:E,selected:N,setSelectedKey:j,selectedNavItem:I,handleSearchSelect:W,handleNavItemSelect:G,handleNavServerSelect:T,handleContentTabChange:v,focusSection:b,schemaFocusTarget:C}=kl({tabs:f,defaultTab:"operations",isTabKey:Yg,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}),B=e.servers?Object.keys(e.servers):[],_=w==="operations"?o.jsx(Yc,{operations:e.operations??{},selectedKey:N.operations,onSelectKey:A=>j("operations",A),focusSection:b}):w==="messages"?o.jsx(Ac,{messages:((H=e.components)==null?void 0:H.messages)??{},selectedKey:N.messages,focusSection:b}):w==="schemas"?o.jsx(Qr,{schemas:((Z=e.components)==null?void 0:Z.schemas)??{},selectedKey:N.schemas,focusTarget:C}):null;return o.jsx(mo,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(qa,{logo:u?o.jsx(Jo,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(il,{query:p,onQueryChange:h,results:g,onSelectResult:W,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(ul,{serialize:A=>_o(e,A),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(uc,{...e.info,showLogo:!1})}),n.servers!==!1&&B.length>0&&o.jsx("div",{id:`server-${N.servers??B[0]}`,children:o.jsx(Rc,{servers:e.servers,selectedServer:N.servers,onSelectServer:A=>j("servers",A),focusSection:b})}),n.sidebar!==!1&&o.jsx(Md,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(se=e.components)==null?void 0:se.messages:void 0,schemas:n.schemas!==!1?(S=e.components)==null?void 0:S.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:E,onTabChange:y,onItemSelect:G,onSelectServer:T,selectedItem:I}),o.jsx(Qa,{tabs:f,current:w,onChange:v}),w&&o.jsx("div",{id:`panel-${w}`,role:"tabpanel","aria-labelledby":`tab-${w}`,children:_})]})})}const ei=e=>o.jsx(Ur,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Zg,{...e})}),Zg=e=>{const t=e.asyncapi,r=x.useMemo(()=>Dn(t),[t]),n=e.kind;x.useEffect(()=>{n==="resolved"&&r!==t&&ho(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??un;return o.jsx(Xg,{asyncapi:r,config:s,plugins:e.plugins})};function ti({document:e,config:t=un,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Ja("openapi",e,t,r);return o.jsx(Hr.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"openapi-portal-root"}),s]})})}function Qg(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:Ve([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:Ve([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 Gr){const h=f[p];if(!h)continue;const g=`${p} ${d}`,w=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${l}-${g}`,targetId:`${l}-${g}-detail`,type:a,tab:i,key:g,name:w,path:`${c}.${d}.${p}`,location:`${u} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:Ve([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))dl(t,i,s,s);return t}function qg(e,t={}){return yl(e,Qg,t)}function Xc({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(cc,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function ex({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx(_c,{address:e,variables:r}),t&&o.jsx(lt,{children:t})]})}const Rs=e=>`server-${e}`,Ms=e=>Number(e.slice(7));function Zc({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||Rs(h)),[i,a]=x.useState(void 0),l=p=>!!p&&Ms(p)>=0&&Ms(p)<e.length,c=l(t)?t:l(i)?i:Rs(0),u=e[Ms(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(ex,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:Ga,content:f,sideContent:o.jsx(Nc,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?Rs(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const Da=320;function tx({parameters:e}){const{portalHost:t}=Be(),[r,n]=x.useState(!1),[s,i]=x.useState({top:0,left:0,placement:"bottom"}),a=x.useRef(null),l=x.useRef(null),c=x.useId();return x.useEffect(()=>{if(!r)return;const u=a.current;if(!u)return;const d=()=>i(Bs(u,{align:"end",width:Da}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[r]),x.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&&an.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Da},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:el(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 nx({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 Qc(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function rx(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${Qc(`$${r}`)}}`)}function sx(e){return e.operationId??e.operationRef??null}const ox=e=>e.trim().replace(/[.:;]+$/,""),Ls=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function ix({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=sx(s),a=Object.entries(s.parameters??{}),l=s.description?ox(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(nx,{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(x.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(Ls,{children:f})," from ",o.jsx(Ls,{children:Qc(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(Ls,{children:s.server.url})]}):null,"."]})]},n)})})}function ax(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>Gr.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function lx({callbacks:e,id:t,renderOperation:r,depth:n}){const s=ax(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(Kn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(It,{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:rx(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 cx=x.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-COchoCMD.cjs")).then(({CodeSamples:e})=>({default:e})));function ux(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function qc({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 eu(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 dx(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 fx({responses:e,onFollowOperation:t,isOperationKnown:r}){var G,T;const n=Object.keys(e),[s,i]=x.useState(n[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=x.useState(l[0]),d=c?(G=a==null?void 0:a.content)==null?void 0:G[c]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,g]=x.useState("body"),w=l.length>0&&!!d,y=Object.keys(f).length>0,E=Object.keys(p).length>0,N=[...w?[{id:"body",name:"Body"}]:[],...y?[{id:"headers",name:"Headers"}]:[]],j=N.length>1,I=N.some(v=>v.id===h)?h:(T=N[0])==null?void 0:T.id,W=N.length>0;return x.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),g("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(v=>o.jsx("button",{role:"tab","aria-selected":s===v,onClick:()=>i(v),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${dx(v)} ${s===v?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:v},v))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),W?o.jsxs(o.Fragment,{children:[j&&o.jsx(Vt,{tabs:N,current:I,onChange:v=>g(v)}),o.jsx("div",{className:j?"mt-4":void 0,children:I==="headers"?o.jsx(Kt,{schema:hx(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(Kt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(qc,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:eu(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),E&&o.jsx(ix,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function tu(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 px=e=>tu(e),hx=e=>tu(Object.entries(e).map(([t,r])=>({name:t,...r})));function mx({parameters:e}){var l;const t=cd.filter(({location:c})=>e.some(u=>u.in===c)),[r,n]=x.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=px(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(Vt,{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(Kt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function gx({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}){const s=t.length>0,i=Object.keys(r),a=i.length>0,[l,c]=x.useState(s?"parameters":"body"),[u,d]=x.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 ",xx(p),":"]}),s&&a&&o.jsx(Vt,{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(mx,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(Kt,{schema:f.schema??{},label:o.jsx(qc,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:eu(f)})]})]})}function xx(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 bx({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<yx,g=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[w,y]=x.useState(g[0]??"request");if(g.length===0)return null;const E=g.includes(w)?w:g[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:g.map(N=>o.jsx("button",{role:"tab","aria-selected":E===N,onClick:()=>y(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${E===N?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:N},N))}),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:[E==="request"&&o.jsx(gx,{label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}),E==="response"&&o.jsx(fx,{responses:s,onFollowOperation:u,isOperationKnown:d}),E==="callbacks"&&i&&o.jsx(lx,{callbacks:i,id:a,depth:l,renderOperation:nu})]})]})}const yx=1;function nu({method:e,path:t,op:r,id:n,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var j,I,W,G;const{document:d}=Wa(),f=(r.parameters??[]).filter(T=>T.in!=="query"&&T.in!=="path"),p=r.security??i??[],h=r.responses??{},g=((j=r.requestBody)==null?void 0:j.content)??{},w=r.operationId?ux(r.operationId):`${e.toUpperCase()} ${t}`,y=new Map;for(const T of p)for(const[v,b]of Object.entries(T)){if(b.length===0)continue;const C=y.get(v)??[];y.set(v,Array.from(new Set([...C,...b])))}const E=Array.from(new Set(p.flatMap(T=>Object.keys(T)))).map(T=>{const v=a==null?void 0:a[T];if(!v)return null;const b=y.get(T);return b?{...v,requiredScopes:b}:v}).filter(T=>!!T),N=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(Jc,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,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"}),((W=r.externalDocs)==null?void 0:W.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(Kr,{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(lt,{children:r.description}),o.jsx(x.Suspense,{fallback:null,children:o.jsx(cx,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(qo,{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"}),E.length>0&&o.jsx(Kn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Tc,{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:E.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(Qo,{securities:E})})})]}),o.jsx(bx,{label:w,parameters:f,requestBodyContent:g,requestBodyDescription:(G=r.requestBody)==null?void 0:G.description,responses:h,callbacks:r.callbacks,id:n,depth:u,fillHeight:N,onFollowOperation:l,isOperationKnown:c})]})})})}function ru(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 Ba(e){const t={};for(const r of e)t[r.name]=ru(r);return t}function wx(e){return e.filter(t=>t.in==="query").map(t=>({...ru(t),name:t.name,required:t.required}))}function zr({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var G;const c=T=>s==null?void 0:s(T),u=x.useMemo(()=>Cn(e),[e]),d=x.useMemo(()=>{var v,b,C;const T=new Map;for(const B of u){const _=((C=(b=(v=e[B.path])==null?void 0:v[B.method])==null?void 0:b.tags)==null?void 0:C[0])||"Other",H=T.get(_)??[];H.push(B),T.set(_,H)}return Array.from(T,([B,_])=>({label:B,items:_}))},[u,e]),[f,p]=x.useState(()=>new Set),h=f.size===0;x.useEffect(()=>{if(!n)return;const T=d.find(({items:v})=>v.some(({key:b})=>b===n));T&&p(v=>{if(!v.has(T.label))return v;const b=new Set(v);return b.delete(T.label),b})},[d,n]);const g=x.useMemo(()=>{var v,b;const T=new Map;for(const{key:C,method:B,path:_}of u){const H=(b=(v=e[_])==null?void 0:v[B])==null?void 0:b.operationId;H&&T.set(H,C)}return T},[u,e]);if(u.length===0)return null;const w=n?u.find(T=>T.key===n):null,y=w?(G=e[w.path])==null?void 0:G[w.method]:null,E=({key:T,method:v,path:b},C)=>{var H;const B=n===T,_=Gi(e[b],(H=e[b])==null?void 0:H[v]);return o.jsxs("tr",{id:`${a}-${T}`,onClick:()=>c(T),role:"button",tabIndex:C?0:-1,"aria-hidden":!C,"aria-label":`${v.toUpperCase()} ${b}`,"aria-current":B?"true":void 0,onKeyDown:Z=>{Z.key!=="Enter"&&Z.key!==" "||(Z.preventDefault(),c(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${C?`cursor-pointer opacity-100 visible ${B?"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 ${C?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${C?"max-h-12":"max-h-0"}`,children:o.jsx($t,{address:b,parameters:Ba(_),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 ${C?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${C?"max-h-12":"max-h-0"}`,children:o.jsx(It,{method:v,className:"w-20"})})})]},T)},N=d.map(({label:T,items:v},b)=>{const C=!f.has(T),B=`${a}-group-${b}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(x.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":`${T} endpoints (${v.length})`,"aria-expanded":C,"aria-controls":B,onClick:()=>p(_=>{const H=new Set(_);return C?H.add(T):H.delete(T),H}),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:C?o.jsx(dn,{className:"h-2.5 w-2.5"}):o.jsx(Cc,{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:T}),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:v.length})]})})})}),o.jsx("tbody",{id:B,"aria-hidden":!C,className:`bg-surface ${C?"divide-y divide-border":""}`,children:v.map(_=>E(_,C))})]},T)}),j=Gi(w?e[w.path]:void 0,y),I=w?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(It,{method:w.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx($t,{address:w.path,parameters:Ba(j),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(tx,{parameters:wx(j)})]}):n,W=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:T=>p(T.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),p(h?new Set(d.map(({label:v})=>v)):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"})]})}),N]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{content:W,stickySideContent:!1,layout:l})}),o.jsx(Mc,{isOpen:!!w,side:"right",onClose:()=>c(null),title:I,children:w&&y&&o.jsx(nu,{method:w.method,path:w.path,op:{...y,parameters:j},id:w.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:T=>g.has(T),onFollowOperation:T=>{const v=g.get(T);v&&c(v)}},w.key)})]})}const kx=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function vx({openapi:e,config:t,plugins:r}){var Z,se,S,A;const n=t.show??{},[s,i]=x.useState(!1),[a,l]=x.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&lc(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Wr}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:wo}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:yo}]:[]],{query:g,setQuery:w,results:y}=qg(e,{threshold:.3,limit:20}),{effectiveTab:E,focusTab:N,navActiveSection:j,selected:I,setSelectedKey:W,selectedNavItem:G,handleSearchSelect:T,handleNavItemSelect:v,handleNavServerSelect:b,handleContentTabChange:C,schemaFocusTarget:B}=kl({tabs:h,defaultTab:"endpoints",isTabKey:kx,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:g}),_=(e.servers??[]).map(F=>F.url),H=E==="endpoints"?o.jsx(zr,{paths:e.paths??{},security:e.security,securitySchemes:(Z=e.components)==null?void 0:Z.securitySchemes,selectedKey:I.endpoints,onSelectKey:F=>W("endpoints",F)}):E==="webhooks"?o.jsx(zr,{paths:f,security:e.security,securitySchemes:(se=e.components)==null?void 0:se.securitySchemes,selectedKey:I.webhooks,onSelectKey:F=>W("webhooks",F),columnLabel:"Webhook",idPrefix:"webhook"}):E==="schemas"?o.jsx(Qr,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:I.schemas,focusTarget:B}):null;return o.jsx(ti,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(qa,{logo:u?o.jsx(Jo,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(il,{query:g,onQueryChange:w,results:y,onSelectResult:T,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(ul,{serialize:F=>Co(e,F),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Xc,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),n.servers!==!1&&_.length>0&&o.jsx("div",{id:I.servers??"server-0",children:o.jsx(Zc,{servers:e.servers,selectedServer:I.servers,onSelectServer:F=>W("servers",F)})}),n.sidebar!==!1&&o.jsx(Bd,{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?_:void 0,hasInfo:n.info!==!1,activeTab:j,onTabChange:N,onItemSelect:v,onSelectServer:b,selectedItem:G}),o.jsx(Qa,{tabs:h,current:E,onChange:C}),E&&o.jsx("div",{id:`panel-${E}`,role:"tabpanel","aria-labelledby":`tab-${E}`,children:H})]})})}const ni=e=>o.jsx(Ur,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(jx,{...e})}),jx=e=>{const t=e.openapi,r=x.useMemo(()=>Dn(t),[t]),n=e.kind;x.useEffect(()=>{n==="resolved"&&r!==t&&ho(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??un;return o.jsx(vx,{openapi:r,config:s,plugins:e.plugins})};function su(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 on=e=>{var r;return typeof e!="string"?void 0:((r=e.trim().split(`
179
- `)[0])==null?void 0:r.trim())||void 0},Ex=e=>Gr.some(t=>t===e),Sx=su({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 on((t=e.info)==null?void 0:t.description)},targets:e=>Cn(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:on(s==null?void 0:s.summary)??on(s==null?void 0:s.description),target:{kind:"operation",document:e,method:r,path:n}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Co(e);if(typeof t.path!="string"||!Ex(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return _l(e,t.method,t.path)}}),Ax=su({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 on((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:on(r==null?void 0:r.summary)??on(r==null?void 0:r.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return _o(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return Nl(e,t.id)}}),Fa=[Sx,Ax];function ri(e){const t=typeof e=="object"&&e!==null?e:{},r=Fa.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: ${Fa.map(n=>n.name).join(", ")}.`);return r}function ou(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Nx(e){return ri(e).targets(e)}function Tx(e,t){const r=ri(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return r.toMarkdown(e,t)}function _x(e,t={}){const r=ri(e),{baseUrl:n,url:s,optional:i}=t,a=(n==null?void 0:n.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${ou(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(`
180
- `)}function iu(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 Cx=["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 $x(){return{validate:Ox,parse:Rx,getMimeTypes:()=>Cx}}function Ix(e){iu(e,$x(),Bn)}function Ox(e){return No(e.data).map(t=>({message:t,path:e.path}))}function Rx(e){var r,n;const t=No(e.data);if(t.length>0)return{[Or]:t[0]};try{const s=Qs(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=Qs(a)),s}catch(s){return{[Or]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Mx(){try{const e=await Promise.resolve().then(()=>require("./index-CWZRM5w7.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 au(e){try{const t=await Mx(),r=new t;Ix(r);const{registerProtobufSchemaParser:n}=await Promise.resolve().then(()=>require("./protobufSchemaParser-C2DRuW2U.cjs"));n(r);const{document:s,diagnostics:i}=await r.parse(e);return{diagnostics:i,document:s?Px(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Lx(e,t){const{diagnostics:r,document:n}=await au(e);return{diagnostics:r,view:n?o.jsx(ei,{kind:"resolved",asyncapi:n,config:t}):null}}function Px(e){return e.json()}function Dx({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=x.useState(null),c=x.useRef(n);return c.current=n,x.useEffect(()=>{let u=!0;return au(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(ei,{kind:"resolved",asyncapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}async function Bx(){try{return await Promise.resolve().then(()=>require("./index-D5GCtn8R.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 Ps=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function lu(e){try{const{validate:t,dereference:r}=await Bx(),n=await t(e);if(!n.valid)return{diagnostics:n.errors.map(l=>Ps(l,0)),document:null};const s=(n.errors??[]).map(l=>Ps(l,1)),{schema:i,errors:a}=r(e);return a!=null&&a.length&&s.push(...a.map(l=>Ps(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 Fx(e,t){const{diagnostics:r,document:n}=await lu(e);return{diagnostics:r,view:n?o.jsx(ni,{kind:"resolved",openapi:n,config:t}):null}}function zx({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=x.useState(null),c=x.useRef(n);return c.current=n,x.useEffect(()=>{let u=!0;return lu(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(ni,{kind:"resolved",openapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}function cu(e,t,r){return function({document:s,config:i,plugins:a,children:l}){const c=x.useContext(Hr),u=x.useMemo(()=>s?Dn(s):null,[s]),d=!!c&&c.specType!==r;if(x.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 Ux({document:e,config:t,plugins:r,children:n}){const s=x.useMemo(()=>Dn(e),[e]);return o.jsx(mo,{document:s,config:t,plugins:r,children:n})}const Xn=cu(mo,"AsyncAPI","asyncapi");function Zn(){const e=Be();return e.specType==="asyncapi",e.document}function Hx({layout:e}){const t=Zn();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Rc,{servers:t.servers,layout:e})}function Wx({layout:e,...t}){return o.jsx(Xn,{...t,children:o.jsx(Hx,{layout:e})})}function Gx({layout:e}){const t=Zn(),[r,n]=x.useState(null);return o.jsx(Yc,{operations:t.operations??{},selectedKey:r,onSelectKey:n,layout:e})}function Kx({layout:e,...t}){return o.jsx(Xn,{...t,children:o.jsx(Gx,{layout:e})})}function Vx({layout:e}){var r;const t=Zn();return o.jsx(Ac,{messages:((r=t.components)==null?void 0:r.messages)??{},layout:e})}function Jx({layout:e,...t}){return o.jsx(Xn,{...t,children:o.jsx(Vx,{layout:e})})}function Yx({layout:e}){var r;const t=Zn();return o.jsx(Qr,{schemas:((r=t.components)==null?void 0:r.schemas)??{},layout:e})}function Xx({layout:e,...t}){return o.jsx(Xn,{...t,children:o.jsx(Yx,{layout:e})})}function Zx({layout:e}){const t=Zn();return t.info?o.jsx(uc,{...t.info,layout:e}):null}function Qx({layout:e,...t}){return o.jsx(Xn,{...t,children:o.jsx(Zx,{layout:e})})}function qx({document:e,config:t,plugins:r,children:n}){const s=x.useMemo(()=>Dn(e),[e]);return o.jsx(ti,{document:s,config:t,plugins:r,children:n})}const Qn=cu(ti,"OpenAPI","openapi");function qn(){const e=jt();return e.specType==="openapi",e.document}function e0({layout:e}){const t=qn();return!t.servers||t.servers.length===0?null:o.jsx(Zc,{servers:t.servers,layout:e})}function t0({layout:e,...t}){return o.jsx(Qn,{...t,children:o.jsx(e0,{layout:e})})}function n0({layout:e}){var s;const t=qn(),[r,n]=x.useState(null);return o.jsx(zr,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:r,onSelectKey:n,layout:e})}function r0({layout:e,...t}){return o.jsx(Qn,{...t,children:o.jsx(n0,{layout:e})})}function s0({layout:e}){var i;const t=qn(),[r,n]=x.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(zr,{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 o0({layout:e,...t}){return o.jsx(Qn,{...t,children:o.jsx(s0,{layout:e})})}function i0({layout:e}){var r;const t=qn();return o.jsx(Qr,{schemas:((r=t.components)==null?void 0:r.schemas)??{},layout:e})}function a0({layout:e,...t}){return o.jsx(Qn,{...t,children:o.jsx(i0,{layout:e})})}function l0({layout:e}){const t=qn();return t.info?o.jsx(Xc,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function c0({layout:e,...t}){return o.jsx(Qn,{...t,children:o.jsx(l0,{layout:e})})}exports.AsyncAPI=ei;exports.AsyncAPIInfo=Qx;exports.AsyncAPIMessages=Jx;exports.AsyncAPIOperations=Kx;exports.AsyncAPIProvider=Ux;exports.AsyncAPIRenderer=Dx;exports.AsyncAPISchemas=Xx;exports.AsyncAPIServers=Wx;exports.CodeBlock=Xr;exports.ErrorBoundary=Ur;exports.OpenAPI=ni;exports.OpenAPIEndpoints=r0;exports.OpenAPIInfo=c0;exports.OpenAPIProvider=qx;exports.OpenAPIRenderer=zx;exports.OpenAPISchemas=a0;exports.OpenAPIServers=t0;exports.OpenAPIWebhooks=o0;exports.PluginSlot=qo;exports.SchemaTabs=Kt;exports.SchemaTree=Zo;exports.X_LIB_CONVERSION_ERROR=Or;exports.asyncApiOperationToMarkdown=Nl;exports.asyncApiToMarkdown=_o;exports.commonjsGlobal=pp;exports.defaultConfig=un;exports.documentToLlmsTxt=_x;exports.documentToMarkdown=Tx;exports.ensureHljsLanguage=Hc;exports.getAugmentedNamespace=hp;exports.getDefaultExportFromCjs=Io;exports.hljsLanguageForTarget=Uc;exports.isHljsLanguageReady=Fr;exports.isProtobufSchemaFormat=Fn;exports.listDocumentTargets=Nx;exports.markdownForLlm=cl;exports.openApiEndpointToMarkdown=_l;exports.openApiToMarkdown=Co;exports.parseAndRender=Lx;exports.parseAndRender$1=Fx;exports.registerSchemaParserWithFallback=iu;exports.resolveLogo=$o;exports.targetSlug=ou;exports.useAsyncAPIDocument=Be;exports.useAsyncAPIDocumentContext=Ha;exports.useDocumentContext=jt;exports.useOpenAPIDocumentContext=Wa;exports.useOperationTabPlugins=Vc;exports.usePluginSlot=Kc;
178
+ `))n(`// ${l}`);s(),n("socket.on('message', (data) => {"),n("console.log(data.toString());",1),n("});")}return i()}},cn={};function Xn(e){if(cn[e.info.key])throw new Error(`Target "${e.info.key}" is already registered`);cn[e.info.key]={...e,clientsById:{...e.clientsById}}}function ct(e,t){const r=cn[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 Fg(){return Object.values(cn).map(e=>({key:e.info.key,title:e.info.title,default:e.info.default,clients:Object.values(e.clientsById).map(t=>t.info)}))}function zg(e,t){const r=[];for(const n of Fg()){const s=n.clients.filter(i=>Eg(e,t,i.protocol));s.length>0&&r.push({...n,default:s[0].key,clients:s})}return r}Xn({info:{key:"agent",title:"Agent Prompt",default:"ws"},clientsById:{}});ct("agent",Cg);ct("agent",_g);Xn({info:{key:"javascript",title:"JavaScript",default:"ws"},clientsById:{}});ct("javascript",Bg);ct("javascript",Mg);ct("javascript",Lg);Xn({info:{key:"python",title:"Python",default:"websockets"},clientsById:{}});ct("python",Og);ct("python",Rg);Xn({info:{key:"rust",title:"Rust",default:"tokio-tungstenite"},clientsById:{}});ct("rust",$g);ct("rust",Ig);Xn({info:{key:"go",title:"Go",default:"gorilla"},clientsById:{}});ct("go",Pg);ct("go",Dg);var Ug=class{constructor(e){this.document=e}convert(e,t,r,n={}){var a;const s=(a=cn[t])==null?void 0:a.clientsById[r];if(!s){const l=Object.values(cn).flatMap(c=>Object.keys(c.clientsById).map(u=>`${c.info.key}/${u}`));throw new cg(t,r,l)}const i=Sg(this.document,e,s.info.protocol);return s.convert(i,n)}};const Hg="javascript",Wg="ws";function Gg(e,t){return zg(e,t)}function Hc(e,t,r,n){try{return new Ug(e).convert(t,r,n)}catch{return null}}function Kg(e,t,r){if(t){for(const n of r)for(const s of n.clients)if(Hc(e,t,n.key,s.key)!==null)return`${n.key}:${s.key}`}return`${Hg}:${Wg}`}const Vg={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 Wc(e){return Vg[e]??"plaintext"}const Jg={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 Pr(e){return e==="plaintext"||!!at.getLanguage(e)}async function Gc(e){if(Pr(e))return;const t=Jg[e];if(!t)return;const r=await t();at.registerLanguage(e,r.default)}function Yg({operationId:e}){const{document:t,showCodeSamples:r}=jt(),n=x.useId(),s=x.useMemo(()=>e?Gg(t,e):[],[t,e]),i=x.useMemo(()=>Kg(t,e,s),[t,e,s]),[a,l]=x.useState(null),c=(a==null?void 0:a.document)===t&&a.operationId===e?a.selection:i,[u,d]=c.split(":"),f=Wc(u),[,p]=x.useState(()=>Pr(f));x.useEffect(()=>{p(Pr(f));let g=!1;return Gc(f).then(()=>{g||p(!0)}),()=>{g=!0}},[f]);const h=x.useMemo(()=>e?Hc(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:g=>l({document:t,operationId:e,selection:g.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(g=>o.jsx("optgroup",{label:g.title,children:g.clients.map(w=>o.jsx("option",{value:`${g.key}:${w.key}`,children:w.title},w.key))},g.key))})]}),o.jsx(Vr,{code:h,language:f})]})}function Kc({label:e,children:t}){return o.jsx(Br,{fallback:null,onError:r=>console.error(`[apiuikit] plugin error in slot "${e}":`,r),children:o.jsx(x.Suspense,{fallback:null,children:t})})}function Vc(){const{plugins:e,pluginSlotRegistry:t}=jt();return x.useMemo(()=>t??Ya(e??[]),[t,e])}function Jc(e){return Vc().get(e)??[]}function ei({name:e,context:t}){const r=Jc(e);return r.length===0?null:o.jsx(o.Fragment,{children:r.map(({id:n,pluginName:s,Component:i})=>o.jsx(Kc,{label:`${e}:${s} (${n})`,children:o.jsx(i,{...t})},n))})}function Yc(e){return Vc().get(e)??[]}const Tn="reference";function Xc({name:e,context:t,enabled:r=!0,children:n}){const s=Yc(e),[i,a]=x.useState(Tn),[l,c]=x.useState(()=>new Set([Tn])),u=x.useId(),d=x.useMemo(()=>new Map(s.map(y=>[y.id,y])),[s]),f=r&&s.length>0,p=f?d.get(i):void 0,h=(p==null?void 0:p.id)??Tn,g=[{id:Tn,name:"Reference"},...s.map(y=>({id:y.id,name:y.label}))],w=y=>{c(E=>E.has(y)?E:new Set([...E,y])),a(y)};return f?o.jsxs(o.Fragment,{children:[o.jsx(Vt,{variant:"segmented",ariaLabel:"Operation view",selectLabel:"Select operation view",idPrefix:u,tabs:g,current:h,onChange:w}),o.jsx(wd,{tabs:g,current:h,idPrefix:u,renderPanel:(y,E)=>{if(!E&&!l.has(y.id))return null;if(y.id===Tn)return n;const N=d.get(y.id);if(!N)return null;const j=N.Component;return o.jsx(Kc,{label:`${e}:${N.pluginName}`,children:o.jsx(j,{...t})})}})]}):o.jsx(o.Fragment,{children:n})}function Xg({op:e,id:t,focusSection:r=null}){var w;const{document:n}=Ga(),s=x.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)?(w=c.find(y=>y.bindings))==null?void 0:w.bindings:void 0),h=e.action===Sr.SEND,g=o.jsx("div",{className:"flex flex-col gap-2",children:i.map((y,E)=>o.jsx(Dc,{message:y,messageId:y.name,i:E},E))});return o.jsx("div",{className:"flex flex-col gap-6",id:`operation-${t}-detail`,children:o.jsx(Xc,{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(Hr,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(lt,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),o.jsx(Yg,{operationId:t}),t&&o.jsx(ei,{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(Vn,{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(qo,{securities:f})})})]}),p&&Object.entries(p).map(([y,E])=>E?o.jsxs("div",{id:`operation-${t}-bindings-${y}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(Mc,{protocol:y,bindings:E,focused:r===`binding:${y}`})]},y):null),u?o.jsx(og,{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:"]}),g]}),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((y,E)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:y.name},E))})]})]})})})}function Zc({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 N;const p=e[f],h=p.channel,g=h==null?void 0:h.address,w=h==null?void 0:h.parameters,y=((N=p.action)==null?void 0:N.toUpperCase())??"",E=t===f;return o.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),role:"button",tabIndex:0,"aria-label":`${y||"Operation"} ${g??f}`,"aria-current":E?"true":void 0,onKeyDown:j=>{j.key!=="Enter"&&j.key!==" "||(j.preventDefault(),i(f))},className:`cursor-pointer hover:bg-neutral-50 ${E?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full",children:g&&o.jsx($t,{address:g,parameters:w,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32",children:o.jsx(It,{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(It,{method:a.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx($t,{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(Ot,{title:ld,content:d,stickySideContent:!1,layout:s})}),o.jsx(Pc,{isOpen:!!a,side:"right",onClose:()=>i(null),title:u,children:a&&o.jsx(Xg,{op:a,id:t,focusSection:n},t)})]})}function ti({schemas:e,selectedKey:t,focusTarget:r,layout:n}){const{deref:s}=Be(),i=_o(),a=x.useMemo(()=>Object.entries(e).map(([c,u])=>[c,Ln(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=Sl(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"," ",Al(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(pc,{schema:u.originalSchema})}):o.jsx(Qo,{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(Ot,{content:l,stickySideContent:!1,layout:n})})}const Zg=e=>e==="operations"||e==="messages"||e==="schemas";function Qg({asyncapi:e,config:t,plugins:r}){var H,Z,se,S;const n=t.show??{},[s,i]=x.useState(!1),[a,l]=x.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&uc(e.info),d=c||u,f=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:zr}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:al}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:wo}]:[]],{query:p,setQuery:h,results:g}=Df(e,{threshold:.3,limit:20}),{effectiveTab:w,focusTab:y,navActiveSection:E,selected:N,setSelectedKey:j,selectedNavItem:I,handleSearchSelect:W,handleNavItemSelect:G,handleNavServerSelect:T,handleContentTabChange:v,focusSection:b,schemaFocusTarget:C}=jl({tabs:f,defaultTab:"operations",isTabKey:Zg,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}),B=e.servers?Object.keys(e.servers):[],_=w==="operations"?o.jsx(Zc,{operations:e.operations??{},selectedKey:N.operations,onSelectKey:A=>j("operations",A),focusSection:b}):w==="messages"?o.jsx(Tc,{messages:((H=e.components)==null?void 0:H.messages)??{},selectedKey:N.messages,focusSection:b}):w==="schemas"?o.jsx(ti,{schemas:((Z=e.components)==null?void 0:Z.schemas)??{},selectedKey:N.schemas,focusTarget:C}):null;return o.jsx(Fr,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&f.length>0?"pt-14":""}`,children:[d&&o.jsxs(tl,{logo:u?o.jsx(Yo,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(ll,{query:p,onQueryChange:h,results:g,onSelectResult:W,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(fl,{serialize:A=>Co(e,A),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(fc,{...e.info,showLogo:!1})}),n.servers!==!1&&B.length>0&&o.jsx("div",{id:`server-${N.servers??B[0]}`,children:o.jsx(Lc,{servers:e.servers,selectedServer:N.servers,onSelectServer:A=>j("servers",A),focusSection:b})}),n.sidebar!==!1&&o.jsx(Pd,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(se=e.components)==null?void 0:se.messages:void 0,schemas:n.schemas!==!1?(S=e.components)==null?void 0:S.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:E,onTabChange:y,onItemSelect:G,onSelectServer:T,selectedItem:I}),o.jsx(el,{tabs:f,current:w,onChange:v}),w&&o.jsx("div",{id:`panel-${w}`,role:"tabpanel","aria-labelledby":`tab-${w}`,children:_})]})})}const ni=e=>o.jsx(Br,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(qg,{...e})}),qg=e=>{const t=e.asyncapi,r=x.useMemo(()=>dn(t),[t]),n=e.kind;x.useEffect(()=>{n==="resolved"&&r!==t&&go(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??un;return o.jsx(Qg,{asyncapi:r,config:s,plugins:e.plugins})};function Yr({document:e,config:t=un,plugins:r,className:n="",children:s}){const{contextValue:i,themeVars:a,setPortalHost:l,setRootElement:c}=Xa("openapi",e,t,r);return o.jsx(fn.Provider,{value:i,children:o.jsxs("div",{ref:c,style:a,className:`apiuikit-root relative @container bg-background text-foreground ${n}`,children:[o.jsx("div",{ref:l,className:"openapi-portal-root"}),s]})})}function ex(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:Ve([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:Ve([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 Ur){const h=f[p];if(!h)continue;const g=`${p} ${d}`,w=h.summary??`${p.toUpperCase()} ${d}`;t.push({id:`${l}-${g}`,targetId:`${l}-${g}-detail`,type:a,tab:i,key:g,name:w,path:`${c}.${d}.${p}`,location:`${u} > ${p.toUpperCase()} ${d}`,subtitle:h.description,text:Ve([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))pl(t,i,s,s);return t}function tx(e,t={}){return kl(e,ex,t)}function Qc({info:e,tags:t,externalDocs:r,layout:n,showLogo:s}){const{title:i,description:a,license:l,contact:c}=e;return o.jsx(dc,{title:i,description:a,license:l,contact:c,externalDocs:r,tags:t,extensionsSource:e,layout:n,showLogo:s})}function nx({url:e,description:t,variables:r}){return o.jsxs("div",{children:[o.jsx($c,{address:e,variables:r}),t&&o.jsx(lt,{children:t})]})}const Ms=e=>`server-${e}`,Ls=e=>Number(e.slice(7));function qc({servers:e,selectedServer:t,onSelectServer:r,layout:n}){const s=e.map((p,h)=>p.url||Ms(h)),[i,a]=x.useState(void 0),l=p=>!!p&&Ls(p)>=0&&Ls(p)<e.length,c=l(t)?t:l(i)?i:Ms(0),u=e[Ls(c)],d=p=>{a(p),r==null||r(p)},f=u?o.jsx(nx,{...u}):null;return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{title:Va,content:f,sideContent:o.jsx(_c,{serverNames:s,current:(u==null?void 0:u.url)||c,setCurrent:p=>{const h=s.indexOf(p);d(h>=0?Ms(h):p)}}),stickySideContent:!0,reverseLayoutOnMobile:!0,layout:n})})}const Fa=320;function rx({parameters:e}){const{portalHost:t}=Be(),[r,n]=x.useState(!1),[s,i]=x.useState({top:0,left:0,placement:"bottom"}),a=x.useRef(null),l=x.useRef(null),c=x.useId();return x.useEffect(()=>{if(!r)return;const u=a.current;if(!u)return;const d=()=>i(zs(u,{align:"end",width:Fa}));return d(),window.addEventListener("scroll",d,!0),window.addEventListener("resize",d),()=>{window.removeEventListener("scroll",d,!0),window.removeEventListener("resize",d)}},[r]),x.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&&an.createPortal(o.jsxs("div",{ref:l,id:c,role:"dialog","aria-label":"Query parameters",style:{top:s.top,left:s.left,width:Fa},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:nl(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 sx({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 eu(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function ox(e){return e.replace(/\{\$([^}]+)\}/g,(t,r)=>`{${eu(`$${r}`)}}`)}function ix(e){return e.operationId??e.operationRef??null}const ax=e=>e.trim().replace(/[.:;]+$/,""),Ps=({children:e})=>o.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function lx({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=ix(s),a=Object.entries(s.parameters??{}),l=s.description?ax(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(sx,{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(x.Fragment,{children:[h>0&&(h===a.length-1?" and ":", "),o.jsx(Ps,{children:f})," from ",o.jsx(Ps,{children:eu(p)})]},f))]}),(d=s.server)!=null&&d.url?o.jsxs(o.Fragment,{children:[" via ",o.jsx(Ps,{children:s.server.url})]}):null,"."]})]},n)})})}function cx(e){return Object.entries(e).flatMap(([t,r])=>Object.entries(r??{}).flatMap(([n,s],i)=>Ur.filter(a=>s==null?void 0:s[a]).map(a=>({name:t,url:n,method:a,op:s[a],urlIndex:i}))))}function ux({callbacks:e,id:t,renderOperation:r,depth:n}){const s=cx(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(Vn,{trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[o.jsx(It,{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:ox(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 dx=x.lazy(()=>Promise.resolve().then(()=>require("./CodeSamples-CE_PYa2j.cjs")).then(({CodeSamples:e})=>({default:e})));function fx(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function tu({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 nu(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 px(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 hx({responses:e,onFollowOperation:t,isOperationKnown:r}){var G,T;const n=Object.keys(e),[s,i]=x.useState(n[0]),a=e[s],l=Object.keys((a==null?void 0:a.content)??{}),[c,u]=x.useState(l[0]),d=c?(G=a==null?void 0:a.content)==null?void 0:G[c]:void 0,f=(a==null?void 0:a.headers)??{},p=(a==null?void 0:a.links)??{},[h,g]=x.useState("body"),w=l.length>0&&!!d,y=Object.keys(f).length>0,E=Object.keys(p).length>0,N=[...w?[{id:"body",name:"Body"}]:[],...y?[{id:"headers",name:"Headers"}]:[]],j=N.length>1,I=N.some(v=>v.id===h)?h:(T=N[0])==null?void 0:T.id,W=N.length>0;return x.useEffect(()=>{u(Object.keys((a==null?void 0:a.content)??{})[0]),g("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(v=>o.jsx("button",{role:"tab","aria-selected":s===v,onClick:()=>i(v),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${px(v)} ${s===v?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:v},v))}),(a==null?void 0:a.description)&&o.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:a.description}),W?o.jsxs(o.Fragment,{children:[j&&o.jsx(Vt,{tabs:N,current:I,onChange:v=>g(v)}),o.jsx("div",{className:j?"mt-4":void 0,children:I==="headers"?o.jsx(Kt,{schema:gx(f),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):o.jsx(Kt,{schema:(d==null?void 0:d.schema)??{},label:o.jsx(tu,{prefix:"Body",mediaTypes:l,selected:c,onChange:u}),rootName:"Body",example:nu(d)},"body")})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),E&&o.jsx(lx,{links:p,onFollowOperation:t,isOperationKnown:r})]})}function ru(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 mx=e=>ru(e),gx=e=>ru(Object.entries(e).map(([t,r])=>({name:t,...r})));function xx({parameters:e}){var l;const t=dd.filter(({location:c})=>e.some(u=>u.in===c)),[r,n]=x.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=mx(e.filter(c=>c.in===s));return o.jsxs("div",{children:[t.length>1&&o.jsx(Vt,{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(Kt,{schema:a,label:i.label,rootName:i.label,defaultView:"schema"})})]})}function bx({label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}){const s=t.length>0,i=Object.keys(r),a=i.length>0,[l,c]=x.useState(s?"parameters":"body"),[u,d]=x.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 ",yx(p),":"]}),s&&a&&o.jsx(Vt,{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(xx,{parameters:t}),(l==="body"||!s)&&a&&f&&o.jsx(Kt,{schema:f.schema??{},label:o.jsx(tu,{prefix:"Request Body",mediaTypes:i,selected:u,onChange:d}),rootName:"Body ",description:n,example:nu(f)})]})]})}function yx(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 wx({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<kx,g=[...f?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[w,y]=x.useState(g[0]??"request");if(g.length===0)return null;const E=g.includes(w)?w:g[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:g.map(N=>o.jsx("button",{role:"tab","aria-selected":E===N,onClick:()=>y(N),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${E===N?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:N},N))}),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:[E==="request"&&o.jsx(bx,{label:e,parameters:t,requestBodyContent:r,requestBodyDescription:n}),E==="response"&&o.jsx(hx,{responses:s,onFollowOperation:u,isOperationKnown:d}),E==="callbacks"&&i&&o.jsx(ux,{callbacks:i,id:a,depth:l,renderOperation:su})]})]})}const kx=1;function su({method:e,path:t,op:r,id:n,idPrefix:s="endpoint",globalSecurity:i,securitySchemes:a,onFollowOperation:l,isOperationKnown:c,depth:u=0}){var j,I,W,G;const{document:d}=Ka(),f=(r.parameters??[]).filter(T=>T.in!=="query"&&T.in!=="path"),p=r.security??i??[],h=r.responses??{},g=((j=r.requestBody)==null?void 0:j.content)??{},w=r.operationId?fx(r.operationId):`${e.toUpperCase()} ${t}`,y=new Map;for(const T of p)for(const[v,b]of Object.entries(T)){if(b.length===0)continue;const C=y.get(v)??[];y.set(v,Array.from(new Set([...C,...b])))}const E=Array.from(new Set(p.flatMap(T=>Object.keys(T)))).map(T=>{const v=a==null?void 0:a[T];if(!v)return null;const b=y.get(T);return b?{...v,requiredScopes:b}:v}).filter(T=>!!T),N=u===0;return o.jsx("div",{className:`flex flex-col gap-6 ${N?"min-h-full":""}`,id:`${s}-${n}-detail`,children:o.jsx(Xc,{name:"openapi.operation.tab",context:{document:d,method:e,path:t},enabled:N,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"}),((W=r.externalDocs)==null?void 0:W.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(Hr,{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(lt,{children:r.description}),o.jsx(x.Suspense,{fallback:null,children:o.jsx(dx,{method:e,path:t,parameters:f,requestBody:r.requestBody,security:p,id:n})}),o.jsx(ei,{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"}),E.length>0&&o.jsx(Vn,{className:"mt-3",trigger:o.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[o.jsx(Cc,{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:E.length})]}),children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(qo,{securities:E})})})]}),o.jsx(wx,{label:w,parameters:f,requestBodyContent:g,requestBodyDescription:(G=r.requestBody)==null?void 0:G.description,responses:h,callbacks:r.callbacks,id:n,depth:u,fillHeight:N,onFollowOperation:l,isOperationKnown:c})]})})})}function ou(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 za(e){const t={};for(const r of e)t[r.name]=ou(r);return t}function vx(e){return e.filter(t=>t.in==="query").map(t=>({...ou(t),name:t.name,required:t.required}))}function Dr({paths:e,security:t,securitySchemes:r,selectedKey:n=null,onSelectKey:s,columnLabel:i="Path",idPrefix:a="endpoint",layout:l}){var G;const c=T=>s==null?void 0:s(T),u=x.useMemo(()=>In(e),[e]),d=x.useMemo(()=>{var v,b,C;const T=new Map;for(const B of u){const _=((C=(b=(v=e[B.path])==null?void 0:v[B.method])==null?void 0:b.tags)==null?void 0:C[0])||"Other",H=T.get(_)??[];H.push(B),T.set(_,H)}return Array.from(T,([B,_])=>({label:B,items:_}))},[u,e]),[f,p]=x.useState(()=>new Set),h=f.size===0;x.useEffect(()=>{if(!n)return;const T=d.find(({items:v})=>v.some(({key:b})=>b===n));T&&p(v=>{if(!v.has(T.label))return v;const b=new Set(v);return b.delete(T.label),b})},[d,n]);const g=x.useMemo(()=>{var v,b;const T=new Map;for(const{key:C,method:B,path:_}of u){const H=(b=(v=e[_])==null?void 0:v[B])==null?void 0:b.operationId;H&&T.set(H,C)}return T},[u,e]);if(u.length===0)return null;const w=n?u.find(T=>T.key===n):null,y=w?(G=e[w.path])==null?void 0:G[w.method]:null,E=({key:T,method:v,path:b},C)=>{var H;const B=n===T,_=Vi(e[b],(H=e[b])==null?void 0:H[v]);return o.jsxs("tr",{id:`${a}-${T}`,onClick:()=>c(T),role:"button",tabIndex:C?0:-1,"aria-hidden":!C,"aria-label":`${v.toUpperCase()} ${b}`,"aria-current":B?"true":void 0,onKeyDown:Z=>{Z.key!=="Enter"&&Z.key!==" "||(Z.preventDefault(),c(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${C?`cursor-pointer opacity-100 visible ${B?"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 ${C?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${C?"max-h-12":"max-h-0"}`,children:o.jsx($t,{address:b,parameters:za(_),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 ${C?"py-2":"py-0"}`,children:o.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${C?"max-h-12":"max-h-0"}`,children:o.jsx(It,{method:v,className:"w-20"})})})]},T)},N=d.map(({label:T,items:v},b)=>{const C=!f.has(T),B=`${a}-group-${b}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return o.jsxs(x.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":`${T} endpoints (${v.length})`,"aria-expanded":C,"aria-controls":B,onClick:()=>p(_=>{const H=new Set(_);return C?H.add(T):H.delete(T),H}),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:C?o.jsx(pn,{className:"h-2.5 w-2.5"}):o.jsx(Ic,{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:T}),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:v.length})]})})})}),o.jsx("tbody",{id:B,"aria-hidden":!C,className:`bg-surface ${C?"divide-y divide-border":""}`,children:v.map(_=>E(_,C))})]},T)}),j=Vi(w?e[w.path]:void 0,y),I=w?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx(It,{method:w.method}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx($t,{address:w.path,parameters:za(j),truncate:!0,peek:!0,className:"text-xs"})}),o.jsx(rx,{parameters:vx(j)})]}):n,W=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:T=>p(T.target.checked?new Set:new Set(d.map(({label:v})=>v))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),p(h?new Set(d.map(({label:v})=>v)):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"})]})}),N]})})]});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Ot,{content:W,stickySideContent:!1,layout:l})}),o.jsx(Pc,{isOpen:!!w,side:"right",onClose:()=>c(null),title:I,children:w&&y&&o.jsx(su,{method:w.method,path:w.path,op:{...y,parameters:j},id:w.key,idPrefix:a,globalSecurity:t,securitySchemes:r,isOperationKnown:T=>g.has(T),onFollowOperation:T=>{const v=g.get(T);v&&c(v)}},w.key)})]})}const jx=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function Ex({openapi:e,config:t,plugins:r}){var Z,se,S,A;const n=t.show??{},[s,i]=x.useState(!1),[a,l]=x.useState(!1),c=n.search!==!1||n.copyMarkdown!==!1,u=n.info!==!1&&uc(e.info),d=c||u,f=e.webhooks??{},p=Object.keys(f).length>0,h=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:zr}]:[],...p&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:ko}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:wo}]:[]],{query:g,setQuery:w,results:y}=tx(e,{threshold:.3,limit:20}),{effectiveTab:E,focusTab:N,navActiveSection:j,selected:I,setSelectedKey:W,selectedNavItem:G,handleSearchSelect:T,handleNavItemSelect:v,handleNavServerSelect:b,handleContentTabChange:C,schemaFocusTarget:B}=jl({tabs:h,defaultTab:"endpoints",isTabKey:jx,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:g}),_=(e.servers??[]).map(F=>F.url),H=E==="endpoints"?o.jsx(Dr,{paths:e.paths??{},security:e.security,securitySchemes:(Z=e.components)==null?void 0:Z.securitySchemes,selectedKey:I.endpoints,onSelectKey:F=>W("endpoints",F)}):E==="webhooks"?o.jsx(Dr,{paths:f,security:e.security,securitySchemes:(se=e.components)==null?void 0:se.securitySchemes,selectedKey:I.webhooks,onSelectKey:F=>W("webhooks",F),columnLabel:"Webhook",idPrefix:"webhook"}):E==="schemas"?o.jsx(ti,{schemas:((S=e.components)==null?void 0:S.schemas)??{},selectedKey:I.schemas,focusTarget:B}):null;return o.jsx(Yr,{document:e,config:t,plugins:r,children:o.jsxs("div",{className:`px-4 ${d&&h.length>0?"pt-14":""}`,children:[d&&o.jsxs(tl,{logo:u?o.jsx(Yo,{source:e.info}):void 0,forceVisible:s||a,children:[n.search!==!1&&o.jsx(ll,{query:g,onQueryChange:w,results:y,onSelectResult:T,onOpenChange:i}),n.copyMarkdown!==!1&&o.jsx(fl,{serialize:F=>$o(e,F),onOpenChange:l})]}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Qc,{info:e.info,tags:e.tags,externalDocs:e.externalDocs,showLogo:!1})}),n.servers!==!1&&_.length>0&&o.jsx("div",{id:I.servers??"server-0",children:o.jsx(qc,{servers:e.servers,selectedServer:I.servers,onSelectServer:F=>W("servers",F)})}),n.sidebar!==!1&&o.jsx(zd,{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?_:void 0,hasInfo:n.info!==!1,activeTab:j,onTabChange:N,onItemSelect:v,onSelectServer:b,selectedItem:G}),o.jsx(el,{tabs:h,current:E,onChange:C}),E&&o.jsx("div",{id:`panel-${E}`,role:"tabpanel","aria-labelledby":`tab-${E}`,children:H})]})})}const ri=e=>o.jsx(Br,{fallback:e.errorFallback,onError:e.onError,children:o.jsx(Sx,{...e})}),Sx=e=>{const t=e.openapi,r=x.useMemo(()=>dn(t),[t]),n=e.kind;x.useEffect(()=>{n==="resolved"&&r!==t&&go(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??un;return o.jsx(Ex,{openapi:r,config:s,plugins:e.plugins})};function iu(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 on=e=>{var r;return typeof e!="string"?void 0:((r=e.trim().split(`
179
+ `)[0])==null?void 0:r.trim())||void 0},Ax=e=>Ur.some(t=>t===e),Nx=iu({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 on((t=e.info)==null?void 0:t.description)},targets:e=>In(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:on(s==null?void 0:s.summary)??on(s==null?void 0:s.description),target:{kind:"operation",document:e,method:r,path:n}}}),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return $o(e);if(typeof t.path!="string"||!Ax(t.method))throw new Error("[apiuikit] An OpenAPI operation target requires a valid method and path.");return $l(e,t.method,t.path)}}),Tx=iu({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 on((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:on(r==null?void 0:r.summary)??on(r==null?void 0:r.description),target:{kind:"operation",document:e,id:t}})),toMarkdown:(e,t)=>{if(!t||t.kind==="document")return Co(e);if(typeof t.id!="string"||!t.id)throw new Error("[apiuikit] An AsyncAPI operation target requires an operation id.");return _l(e,t.id)}}),Ua=[Nx,Tx];function si(e){const t=typeof e=="object"&&e!==null?e:{},r=Ua.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: ${Ua.map(n=>n.name).join(", ")}.`);return r}function au(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function _x(e){return si(e).targets(e)}function Cx(e,t){const r=si(e);if(t&&t.document!==e)throw new Error("[apiuikit] Markdown target belongs to a different document.");return r.toMarkdown(e,t)}function $x(e,t={}){const r=si(e),{baseUrl:n,url:s,optional:i}=t,a=(n==null?void 0:n.replace(/\/+$/,""))??"",c=s??(p=>`${a}/${au(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(`
180
+ `)}function lu(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 Ix=["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 Ox(){return{validate:Mx,parse:Lx,getMimeTypes:()=>Ix}}function Rx(e){lu(e,Ox(),Fn)}function Mx(e){return To(e.data).map(t=>({message:t,path:e.path}))}function Lx(e){var r,n;const t=To(e.data);if(t.length>0)return{[Cr]:t[0]};try{const s=eo(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=eo(a)),s}catch(s){return{[Cr]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function Px(){try{const e=await Promise.resolve().then(()=>require("./index-CXAGho9r.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 cu(e){try{const t=await Px(),r=new t;Rx(r);const{registerProtobufSchemaParser:n}=await Promise.resolve().then(()=>require("./protobufSchemaParser-BDvHrzAl.cjs"));n(r);const{document:s,diagnostics:i}=await r.parse(e);return{diagnostics:i,document:s?Bx(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Dx(e,t){const{diagnostics:r,document:n}=await cu(e);return{diagnostics:r,view:n?o.jsx(ni,{kind:"resolved",asyncapi:n,config:t}):null}}function Bx(e){return e.json()}function Fx({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=x.useState(null),c=x.useRef(n);return c.current=n,x.useEffect(()=>{let u=!0;return cu(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(ni,{kind:"resolved",asyncapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}async function zx(){try{return await Promise.resolve().then(()=>require("./index-C4dsAuGH.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 Ds=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function uu(e){try{const{validate:t,dereference:r}=await zx(),n=await t(e);if(!n.valid)return{diagnostics:n.errors.map(l=>Ds(l,0)),document:null};const s=(n.errors??[]).map(l=>Ds(l,1)),{schema:i,errors:a}=r(e);return a!=null&&a.length&&s.push(...a.map(l=>Ds(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 Ux(e,t){const{diagnostics:r,document:n}=await uu(e);return{diagnostics:r,view:n?o.jsx(ri,{kind:"resolved",openapi:n,config:t}):null}}function Hx({raw:e,config:t,plugins:r,onDiagnostics:n,errorFallback:s,onError:i}){const[a,l]=x.useState(null),c=x.useRef(n);return c.current=n,x.useEffect(()=>{let u=!0;return uu(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(ri,{kind:"resolved",openapi:a,config:t,plugins:r,errorFallback:s,onError:i}):null}function du(e,t,r){return function({document:s,config:i,plugins:a,children:l}){const c=x.useContext(fn),u=x.useMemo(()=>s?dn(s):null,[s]),d=!!c&&c.specType!==r;if(x.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 Wx({document:e,config:t,plugins:r,children:n}){const s=x.useMemo(()=>dn(e),[e]);return o.jsx(Fr,{document:s,config:t,plugins:r,children:n})}const Xr=du(Fr,"AsyncAPI","asyncapi");function Zr(){const e=Be();return e.specType==="asyncapi",e.document}function Gx({layout:e}){const t=Zr();return!t.servers||Object.keys(t.servers).length===0?null:o.jsx(Lc,{servers:t.servers,layout:e})}function Kx({layout:e,...t}){return o.jsx(Xr,{...t,children:o.jsx(Gx,{layout:e})})}function Vx({layout:e}){const t=Zr(),[r,n]=x.useState(null);return o.jsx(Zc,{operations:t.operations??{},selectedKey:r,onSelectKey:n,layout:e})}function Jx({layout:e,...t}){return o.jsx(Xr,{...t,children:o.jsx(Vx,{layout:e})})}function Yx({layout:e}){var r;const t=Zr();return o.jsx(Tc,{messages:((r=t.components)==null?void 0:r.messages)??{},layout:e})}function Xx({layout:e,...t}){return o.jsx(Xr,{...t,children:o.jsx(Yx,{layout:e})})}function Zx({layout:e}){const t=Zr();return t.info?o.jsx(fc,{...t.info,layout:e}):null}function Qx({layout:e,...t}){return o.jsx(Xr,{...t,children:o.jsx(Zx,{layout:e})})}const qx=e=>{const t=e;return typeof t.openapi=="string"||typeof t.swagger=="string"};function Bs({layout:e}){var n,s;const t=x.useContext(fn),r=((s=(n=t==null?void 0:t.document)==null?void 0:n.components)==null?void 0:s.schemas)??{};return o.jsx(ti,{schemas:r,layout:e})}function oi({document:e,config:t,plugins:r,layout:n}){const s=x.useContext(fn),i=x.useMemo(()=>e?dn(e):null,[e]);if(s)return o.jsx(Bs,{layout:n});if(!i)throw new Error("The Schemas section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <OpenAPIProvider>.");return qx(i)?o.jsx(Yr,{document:i,config:t,plugins:r,children:o.jsx(Bs,{layout:n})}):o.jsx(Fr,{document:i,config:t,plugins:r,children:o.jsx(Bs,{layout:n})})}const e0=oi,t0=oi;function n0({document:e,config:t,plugins:r,children:n}){const s=x.useMemo(()=>dn(e),[e]);return o.jsx(Yr,{document:s,config:t,plugins:r,children:n})}const Qr=du(Yr,"OpenAPI","openapi");function qr(){const e=jt();return e.specType==="openapi",e.document}function r0({layout:e}){const t=qr();return!t.servers||t.servers.length===0?null:o.jsx(qc,{servers:t.servers,layout:e})}function s0({layout:e,...t}){return o.jsx(Qr,{...t,children:o.jsx(r0,{layout:e})})}function o0({layout:e}){var s;const t=qr(),[r,n]=x.useState(null);return o.jsx(Dr,{paths:t.paths??{},security:t.security,securitySchemes:(s=t.components)==null?void 0:s.securitySchemes,selectedKey:r,onSelectKey:n,layout:e})}function i0({layout:e,...t}){return o.jsx(Qr,{...t,children:o.jsx(o0,{layout:e})})}function a0({layout:e}){var i;const t=qr(),[r,n]=x.useState(null),s=t.webhooks??{};return Object.keys(s).length===0?null:o.jsx(Dr,{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 l0({layout:e,...t}){return o.jsx(Qr,{...t,children:o.jsx(a0,{layout:e})})}function c0({layout:e}){const t=qr();return t.info?o.jsx(Qc,{info:t.info,tags:t.tags,externalDocs:t.externalDocs,layout:e}):null}function u0({layout:e,...t}){return o.jsx(Qr,{...t,children:o.jsx(c0,{layout:e})})}exports.AsyncAPI=ni;exports.AsyncAPIInfo=Qx;exports.AsyncAPIMessages=Xx;exports.AsyncAPIOperations=Jx;exports.AsyncAPIProvider=Wx;exports.AsyncAPIRenderer=Fx;exports.AsyncAPISchemas=e0;exports.AsyncAPIServers=Kx;exports.CodeBlock=Vr;exports.ErrorBoundary=Br;exports.OpenAPI=ri;exports.OpenAPIEndpoints=i0;exports.OpenAPIInfo=u0;exports.OpenAPIProvider=n0;exports.OpenAPIRenderer=Hx;exports.OpenAPISchemas=t0;exports.OpenAPIServers=s0;exports.OpenAPIWebhooks=l0;exports.PluginSlot=ei;exports.SchemaTabs=Kt;exports.SchemaTree=Qo;exports.Schemas=oi;exports.X_LIB_CONVERSION_ERROR=Cr;exports.asyncApiOperationToMarkdown=_l;exports.asyncApiToMarkdown=Co;exports.commonjsGlobal=mp;exports.defaultConfig=un;exports.documentToLlmsTxt=$x;exports.documentToMarkdown=Cx;exports.ensureHljsLanguage=Gc;exports.getAugmentedNamespace=gp;exports.getDefaultExportFromCjs=Oo;exports.hljsLanguageForTarget=Wc;exports.isHljsLanguageReady=Pr;exports.isProtobufSchemaFormat=zn;exports.listDocumentTargets=_x;exports.markdownForLlm=dl;exports.openApiEndpointToMarkdown=$l;exports.openApiToMarkdown=$o;exports.parseAndRender=Dx;exports.parseAndRender$1=Ux;exports.registerSchemaParserWithFallback=lu;exports.resolveLogo=Io;exports.targetSlug=au;exports.useAsyncAPIDocument=Be;exports.useAsyncAPIDocumentContext=Ga;exports.useDocumentContext=jt;exports.useOpenAPIDocumentContext=Ka;exports.useOperationTabPlugins=Yc;exports.usePluginSlot=Jc;