apiuikit 0.2.0 → 0.2.1

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,6 +1,6 @@
1
- "use strict";var eu=Object.defineProperty;var tu=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ee=(e,t,n)=>tu(e,typeof t!="symbol"?t+"":t,n);const u=require("react/jsx-runtime"),ie=require("react"),ml=require("react-dom"),Is=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Ms=(e,t)=>{const n=t.length>0?t:Is,i=(e%n.length+n.length)%n.length;return n[i]},gl={show:{sidebar:!0,info:!0,servers:!0,operations:!0,messages:!0,messageExamples:!1,schemas:!0},theme:{colors:{primary:{50:"#ebf1fe",100:"#d6e3fd",200:"#adc7fb",300:"#85abf9",500:"#7aa2f7",600:"#5a7ef0",700:"#3d5bc4"}},dark:{background:"#1a1b26",surface:"#24283b",border:"#414868",textPrimary:"#c0caf5",textSecondary:"#a9b1d6",textMuted:"#666c86"},depthColors:Is},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!1}},yl=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Vr=e=>typeof e=="object"&&e!==null,nu=e=>e.replace(/^#\//,"").split("/").pop()??e,xl=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),yl(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(i=>xl(i,t))),ru=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let i=e;for(const r of n){if(!Vr(i)&&!Array.isArray(i))return;const s=r.replace(/~1/g,"/").replace(/~0/g,"~");if(i=i[s],i==null)return}return i};function iu(e){if(!xl(e))return e;const t=new Map,n=new Set,i=r=>{if(Array.isArray(r)){const s=t.get(r);if(s!==void 0)return s;const o=[];t.set(r,o),n.add(r);try{for(const a of r)o.push(i(a))}finally{n.delete(r)}return o}if(yl(r)){const s=ru(e,r.$ref),o=Vr(s)||Array.isArray(s);if(o&&!n.has(s)){const a=i(s);return Vr(a)&&a["x-parser-schema-id"]===void 0&&(a["x-parser-schema-id"]=nu(r.$ref)),a}if(s!==void 0&&!o)return s}if(Vr(r)){const s=t.get(r);if(s!==void 0)return s;const o={};t.set(r,o),n.add(r);try{for(const[a,l]of Object.entries(r))o[a]=i(l)}finally{n.delete(r)}return o}return r};return i(e)}const bl=ie.createContext(null),zt=()=>{const e=ie.useContext(bl);if(!e)throw new Error("useAsyncAPIDocument must be used within an AsyncAPIDocumentProvider");return e};function Bn({title:e,content:t,sideContent:n,stickySideContent:i=!1,info:r=!1,reverseLayoutOnMobile:s=!1}){return u.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[e&&u.jsx("h1",{className:`${r?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),u.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&s?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[u.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),u.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:u.jsx("div",{className:`${i&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Cn(...e){return e.filter(Boolean).join(" ")}function Cs({tabs:e,current:t,onChange:n=()=>{},ariaLabel:i="Tabs",selectLabel:r="Select a tab"}){var l;const s=ie.useId(),o=t??((l=e[0])==null?void 0:l.id)??"",a=e.some(c=>!!c.icon);return e.length?u.jsxs("div",{children:[u.jsxs("div",{className:"@sm:hidden",children:[u.jsx("label",{htmlFor:s,className:"sr-only",children:r}),u.jsx("select",{id:s,name:"tabs",value:o,onChange:c=>n(c.target.value),className:Cn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",a?"mt-0":"mt-4"),children:e.map(c=>u.jsx("option",{value:c.id,children:c.name},c.id))})]}),u.jsx("div",{className:Cn("hidden @sm:block",a?"":"mt-6"),children:a?u.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":i,children:u.jsx("div",{className:"flex flex-wrap gap-6",children:e.map(c=>{const d=c.id===t,f=c.icon;return u.jsx("button",{id:`tab-${c.id}`,type:"button",role:"tab","aria-selected":d,"aria-controls":`panel-${c.id}`,onClick:()=>n(c.id),className:Cn("border-b-2 px-1 py-3 text-sm font-semibold transition-colors",d?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[f?u.jsx(f,{className:"h-4 w-4 shrink-0"}):null,u.jsx("span",{children:c.name})]})},c.id)})})}):u.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow","aria-label":i,children:e.map((c,d)=>u.jsxs("button",{onClick:()=>n(c.id),className:Cn(c.id===t?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",d===0?"rounded-l-lg":"",d===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),"aria-current":c.id===t?"page":void 0,children:[u.jsx("span",{children:c.name}),u.jsx("span",{"aria-hidden":"true",className:Cn(c.id===t?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},c.id))})})]}):null}function su({tabs:e,current:t,onChange:n}){if(!e.length)return null;const i=u.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:u.jsx(Cs,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return u.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:u.jsx(Bn,{content:i,stickySideContent:!1})})}const ou=({isCollapsed:e})=>u.jsxs("svg",{width:22,height:22,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[u.jsx("path",{d:"M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"}),u.jsx("rect",{className:`panel-icon-rect ${e?"panel-icon-rect-collapsed":""}`,x:"2",y:"3",height:"10",rx:"1"})]});function au(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function lu(e){let t=e;for(;t&&t!==document.body;){if(au(t))return t;t=t.parentElement}return document.documentElement}function cu(e){const t=e.style.overflow,n=e.style.paddingRight,i=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",i>0){const r=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${r+i}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function vl(e,t){const[n,i]=ie.useState(null);return ie.useLayoutEffect(()=>{if(!e||!t){i(null);return}let r=null;const s=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null,i(e.getBoundingClientRect())}))};i(e.getBoundingClientRect());const o=new ResizeObserver(s);return o.observe(e),window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{r!==null&&cancelAnimationFrame(r),o.disconnect(),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}},[e,t]),n}const wl=ie.forwardRef(function({isOpen:t,side:n,onClose:i,title:r,children:s,width:o="w-[50rem]"},a){ie.useEffect(()=>{const g=_=>{_.key==="Escape"&&i()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[i]);const l=n==="right"?"translate-x-full":"-translate-x-full",c=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:f}=zt();ie.useEffect(()=>{if(!(!t||!d))return cu(lu(d))},[t,d]);const p=vl(f,!0),h=p?{position:"fixed",top:0,left:p.left,width:p.width,height:"100vh"}:{position:"fixed",inset:0};return d?ml.createPortal(u.jsxs("div",{className:"z-50 overflow-hidden",style:{...h,pointerEvents:t?"auto":"none"},children:[u.jsx("div",{onClick:i,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),u.jsxs("div",{ref:a,className:`absolute top-0 ${c} h-full ${o} max-w-[100cqw] bg-surface shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":l}`,children:[r&&u.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[u.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof r=="string"?u.jsx("span",{className:"truncate block",children:r}):r}),u.jsx("button",{onClick:i,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:u.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:s})]})]}),d):null});function _l({className:e}){return u.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:u.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 El({className:e}){return u.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[u.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"}),u.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"})]})}function Ol({className:e}){return u.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[u.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"}),u.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"})]})}var sn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(sn||{});function uu(e,t){const[n,i]=ie.useState("docked"),r=ie.useRef(t);return r.current=t,ie.useEffect(()=>{if(!e)return;let s=null,o=null;const a=()=>{o=null;const c=e.getBoundingClientRect().top,d=s===null?0:c-s;s=c,c>=0?i("docked"):r.current||d>0?i("pinned"):d<0?i("hidden"):i(f=>f==="docked"?"hidden":f)},l=()=>{o===null&&(o=requestAnimationFrame(a))};return a(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{o!==null&&cancelAnimationFrame(o),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e]),ie.useEffect(()=>{t&&i(s=>s==="hidden"?"pinned":s)},[t]),n}const fu="Contact",du="Email",To="License",No="External Documentation",pu="Tags",hu="Implicit",mu=`The Implicit flow is a simplified OAuth flow previously recommended
1
+ "use strict";var eu=Object.defineProperty;var tu=(e,t,n)=>t in e?eu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ee=(e,t,n)=>tu(e,typeof t!="symbol"?t+"":t,n);const u=require("react/jsx-runtime"),ie=require("react"),ml=require("react-dom"),Is=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Ms=(e,t)=>{const n=t.length>0?t:Is,i=(e%n.length+n.length)%n.length;return n[i]},gl={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:Is},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!1}},yl=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",Vr=e=>typeof e=="object"&&e!==null,nu=e=>e.replace(/^#\//,"").split("/").pop()??e,xl=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),yl(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(i=>xl(i,t))),ru=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let i=e;for(const r of n){if(!Vr(i)&&!Array.isArray(i))return;const s=r.replace(/~1/g,"/").replace(/~0/g,"~");if(i=i[s],i==null)return}return i};function iu(e){if(!xl(e))return e;const t=new Map,n=new Set,i=r=>{if(Array.isArray(r)){const s=t.get(r);if(s!==void 0)return s;const o=[];t.set(r,o),n.add(r);try{for(const a of r)o.push(i(a))}finally{n.delete(r)}return o}if(yl(r)){const s=ru(e,r.$ref),o=Vr(s)||Array.isArray(s);if(o&&!n.has(s)){const a=i(s);return Vr(a)&&a["x-parser-schema-id"]===void 0&&(a["x-parser-schema-id"]=nu(r.$ref)),a}if(s!==void 0&&!o)return s}if(Vr(r)){const s=t.get(r);if(s!==void 0)return s;const o={};t.set(r,o),n.add(r);try{for(const[a,l]of Object.entries(r))o[a]=i(l)}finally{n.delete(r)}return o}return r};return i(e)}const bl=ie.createContext(null),zt=()=>{const e=ie.useContext(bl);if(!e)throw new Error("useAsyncAPIDocument must be used within an AsyncAPIDocumentProvider");return e};function Bn({title:e,content:t,sideContent:n,stickySideContent:i=!1,info:r=!1,reverseLayoutOnMobile:s=!1}){return u.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[e&&u.jsx("h1",{className:`${r?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),u.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&s?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[u.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),u.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:u.jsx("div",{className:`${i&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Cn(...e){return e.filter(Boolean).join(" ")}function Cs({tabs:e,current:t,onChange:n=()=>{},ariaLabel:i="Tabs",selectLabel:r="Select a tab"}){var l;const s=ie.useId(),o=t??((l=e[0])==null?void 0:l.id)??"",a=e.some(c=>!!c.icon);return e.length?u.jsxs("div",{children:[u.jsxs("div",{className:"@sm:hidden",children:[u.jsx("label",{htmlFor:s,className:"sr-only",children:r}),u.jsx("select",{id:s,name:"tabs",value:o,onChange:c=>n(c.target.value),className:Cn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",a?"mt-0":"mt-4"),children:e.map(c=>u.jsx("option",{value:c.id,children:c.name},c.id))})]}),u.jsx("div",{className:Cn("hidden @sm:block",a?"":"mt-6"),children:a?u.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":i,children:u.jsx("div",{className:"flex flex-wrap gap-6",children:e.map(c=>{const d=c.id===t,f=c.icon;return u.jsx("button",{id:`tab-${c.id}`,type:"button",role:"tab","aria-selected":d,"aria-controls":`panel-${c.id}`,onClick:()=>n(c.id),className:Cn("border-b-2 px-1 py-3 text-sm font-semibold transition-colors",d?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:u.jsxs("span",{className:"inline-flex items-center gap-2",children:[f?u.jsx(f,{className:"h-4 w-4 shrink-0"}):null,u.jsx("span",{children:c.name})]})},c.id)})})}):u.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow","aria-label":i,children:e.map((c,d)=>u.jsxs("button",{onClick:()=>n(c.id),className:Cn(c.id===t?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",d===0?"rounded-l-lg":"",d===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),"aria-current":c.id===t?"page":void 0,children:[u.jsx("span",{children:c.name}),u.jsx("span",{"aria-hidden":"true",className:Cn(c.id===t?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},c.id))})})]}):null}function su({tabs:e,current:t,onChange:n}){if(!e.length)return null;const i=u.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:u.jsx(Cs,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return u.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:u.jsx(Bn,{content:i,stickySideContent:!1})})}const ou=({isCollapsed:e})=>u.jsxs("svg",{width:22,height:22,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[u.jsx("path",{d:"M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"}),u.jsx("rect",{className:`panel-icon-rect ${e?"panel-icon-rect-collapsed":""}`,x:"2",y:"3",height:"10",rx:"1"})]});function au(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function lu(e){let t=e;for(;t&&t!==document.body;){if(au(t))return t;t=t.parentElement}return document.documentElement}function cu(e){const t=e.style.overflow,n=e.style.paddingRight,i=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",i>0){const r=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${r+i}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function vl(e,t){const[n,i]=ie.useState(null);return ie.useLayoutEffect(()=>{if(!e||!t){i(null);return}let r=null;const s=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null,i(e.getBoundingClientRect())}))};i(e.getBoundingClientRect());const o=new ResizeObserver(s);return o.observe(e),window.addEventListener("scroll",s,!0),window.addEventListener("resize",s),()=>{r!==null&&cancelAnimationFrame(r),o.disconnect(),window.removeEventListener("scroll",s,!0),window.removeEventListener("resize",s)}},[e,t]),n}const wl=ie.forwardRef(function({isOpen:t,side:n,onClose:i,title:r,children:s,width:o="w-[50rem]"},a){ie.useEffect(()=>{const g=_=>{_.key==="Escape"&&i()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[i]);const l=n==="right"?"translate-x-full":"-translate-x-full",c=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:f}=zt();ie.useEffect(()=>{if(!(!t||!d))return cu(lu(d))},[t,d]);const p=vl(f,!0),h=p?{position:"fixed",top:0,left:p.left,width:p.width,height:"100vh"}:{position:"fixed",inset:0};return d?ml.createPortal(u.jsxs("div",{className:"z-50 overflow-hidden",style:{...h,pointerEvents:t?"auto":"none"},children:[u.jsx("div",{onClick:i,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),u.jsxs("div",{ref:a,className:`absolute top-0 ${c} h-full ${o} max-w-[100cqw] bg-surface shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":l}`,children:[r&&u.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[u.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof r=="string"?u.jsx("span",{className:"truncate block",children:r}):r}),u.jsx("button",{onClick:i,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:u.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:u.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:s})]})]}),d):null});function _l({className:e}){return u.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:u.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 El({className:e}){return u.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[u.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"}),u.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"})]})}function Ol({className:e}){return u.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[u.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"}),u.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"})]})}var sn=(e=>(e.SEND="send",e.RECEIVE="receive",e))(sn||{});function uu(e,t){const[n,i]=ie.useState("docked"),r=ie.useRef(t);return r.current=t,ie.useEffect(()=>{if(!e)return;let s=null,o=null;const a=()=>{o=null;const c=e.getBoundingClientRect().top,d=s===null?0:c-s;s=c,c>=0?i("docked"):r.current||d>0?i("pinned"):d<0?i("hidden"):i(f=>f==="docked"?"hidden":f)},l=()=>{o===null&&(o=requestAnimationFrame(a))};return a(),window.addEventListener("scroll",l,!0),window.addEventListener("resize",l),()=>{o!==null&&cancelAnimationFrame(o),window.removeEventListener("scroll",l,!0),window.removeEventListener("resize",l)}},[e]),ie.useEffect(()=>{t&&i(s=>s==="hidden"?"pinned":s)},[t]),n}const fu="Contact",du="Email",To="License",No="External Documentation",pu="Tags",hu="Implicit",mu=`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.`,gu="Client Credentials",yu="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",xu="Password",bu="The Password grant type is a legacy way to exchange a user's credentials for an access token.",vu="Authorization Code",wu="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",_u="Connecting to a server",Eu="",jo=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],Ou=[50,100,200,300,500,600,700],ku={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"}};function Au(e){if(e.length===0)return u.jsx("span",{children:"No allowed values."});if(e.length===1)return u.jsxs("span",{children:["Allowed value is ",u.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((i,r)=>u.jsxs(ie.Fragment,{children:[u.jsx("code",{children:i}),", "," "]},r)),n=u.jsx("code",{children:e[e.length-1]},"last");return u.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function Tu(e){return e.map(t=>`\`${t}\``).join(", ")}function Nu(e){const t=[],n=/\{([^}]+)\}/g;let i=0,r;for(;(r=n.exec(e))!==null;)r.index>i&&t.push({type:"text",value:e.slice(i,r.index)}),t.push({type:"param",value:r[1]}),i=r.index+r[0].length;return i<e.length&&t.push({type:"text",value:e.slice(i)}),t}function dr({address:e,parameters:t,className:n="text-xs",truncate:i=!1}){const{portalHost:r}=zt(),[s,o]=ie.useState(null),[a,l]=ie.useState({top:0,left:0,placement:"top"}),[c,d]=ie.useState(!1),f=ie.useRef(null),p=Nu(e);let h=0;const g=40;ie.useEffect(()=>{if(!i)return;const y=f.current;if(!y)return;const x=()=>d(y.scrollWidth>y.clientWidth);x();const w=new ResizeObserver(x);return w.observe(y),()=>w.disconnect()},[i,e]);const _=(y,x)=>{const w=x.getBoundingClientRect(),E=w.top<g?"bottom":"top";l({top:E==="top"?w.top-8:w.bottom+8,left:w.left+w.width/2,placement:E}),o(y)},k=p.map((y,x)=>{if(y.type==="text")return u.jsx("span",{children:y.value},x);const w=t==null?void 0:t[y.value],E=jo[h++%jo.length],j=s===x,N=!!w&&(w.description||w.default||w.enum&&w.enum.length>0||w.examples&&w.examples.length>0);return u.jsxs("span",{className:"inline-block",onMouseEnter:R=>_(x,R.currentTarget),onMouseLeave:()=>o(null),children:[u.jsx("span",{className:`font-semibold ${E} ${N?"cursor-help underline decoration-dotted":""}`,children:`{${y.value}}`}),N&&j&&r&&ml.createPortal(u.jsxs("div",{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 ${a.placement==="top"?"-translate-y-full":""}`,style:{top:a.top,left:a.left},children:[w.description&&u.jsx("div",{children:w.description}),w.default&&u.jsxs("div",{className:"mt-1",children:[u.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",u.jsx("code",{children:w.default})]}),w.enum&&w.enum.length>0&&u.jsx("div",{className:"mt-1",children:Au(w.enum)}),w.examples&&w.examples.length>0&&u.jsxs("div",{className:"mt-1",children:[u.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",w.examples.join(", ")]})]}),r)]},x)});return i?u.jsxs("code",{className:`px-2 py-1 rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[u.jsx("span",{ref:f,className:"overflow-hidden whitespace-nowrap min-w-0",children:k}),c&&u.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):u.jsx("code",{className:`px-2 py-1 rounded text-foreground-secondary break-all ${n}`,children:k})}function ju({info:e,operations:t={},messages:n={},schemas:i={},activeTab:r,onTabChange:s,onItemSelect:o,selectedItem:a,sidebarConfig:l}){const[c,d]=ie.useState(!1),[f,p]=ie.useState(0),[h,g]=ie.useState(null),{rootElement:_}=zt(),k=uu(_,c),y=k!=="docked",x=vl(_,y),E={transform:`translate(${c&&f?f-2:0}px, ${k==="hidden"?"-150%":"0px"})`,...y?{position:"fixed",top:10,left:((x==null?void 0:x.left)??0)+12,pointerEvents:k==="hidden"?"none":void 0}:{}};ie.useEffect(()=>{if(!h)return;const Z=new ResizeObserver(([H])=>p(H.contentRect.width));return Z.observe(h),()=>Z.disconnect()},[h]);const j=Z=>{var K;return l!=null&&l.useChannelAddressAsIdentifier?((K=t[Z])==null?void 0:K.channel)??null:null},N=[{id:"operations",label:"Operations",icon:_l,items:Object.keys(t)},{id:"messages",label:"Messages",icon:El,items:Object.keys(n)},{id:"schemas",label:"Schemas",icon:Ol,items:Object.keys(i)}],R=(Z,H)=>{s(Z),H&&setTimeout(()=>{var K;(K=document.getElementById(H))==null||K.scrollIntoView({behavior:"smooth",block:"start"})},50)};return u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:()=>d(Z=>!Z),title:c?"Close navigation":"Open navigation",className:"panel-toggle-btn bg-neutral-100",style:E,children:u.jsx(ou,{isCollapsed:c})}),u.jsx(wl,{ref:g,isOpen:c,side:"left",onClose:()=>d(!1),width:"min-w-[450px] w-auto",children:u.jsxs("nav",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2 pb-4 mb-2 border-b border-border",children:[u.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:e.title}),e.version&&u.jsxs("span",{className:"shrink-0 text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:["v",e.version]})]}),N.map(({id:Z,label:H,icon:K,items:Y})=>{const pe=r===Z;if(!(Y.length<1))return u.jsxs("div",{className:"pb-1",children:[u.jsxs("button",{onClick:()=>R(Z),className:`flex items-center gap-2 w-full text-left px-2 py-2 rounded-md group transition-colors ${pe?"bg-primary-50":"hover:bg-neutral-50"}`,children:[u.jsx(K,{className:`w-3.5 h-3.5 shrink-0 transition-colors ${pe?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),u.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${pe?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:H}),u.jsx("span",{className:`ml-auto text-[10px] font-mono px-1.5 py-0.5 rounded transition-colors ${pe?"bg-primary-100 text-primary-500 border border-primary-200":"bg-neutral-100 text-foreground-muted"}`,children:Y.length})]}),Y.length>0&&u.jsx("ul",{className:"mt-0.5 space-y-0.5 pl-3 border-l border-border ml-4",children:Y.map(S=>{const O=Z==="operations"?t[S]:null,m=Z==="operations"?j(S):null,M=O==null?void 0:O.action,q=M===sn.SEND?"bg-green-100 text-green-700":M===sn.RECEIVE?"bg-blue-100 text-blue-700":null,P=(a==null?void 0:a.tab)===Z&&(a==null?void 0:a.key)===S;return u.jsx("li",{children:u.jsxs("button",{onClick:()=>{R(Z,`${Z.slice(0,-1)}-${S}`),o==null||o(Z,S)},className:`w-full text-left flex items-center gap-2 text-xs py-1.5 px-2 rounded-md transition-colors ${P?"bg-primary-50 text-primary-500 font-medium":pe?"text-foreground-secondary hover:text-foreground hover:bg-primary-50":"text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-50"}`,children:[q&&u.jsx("span",{className:`shrink-0 text-[10px] font-medium uppercase px-1.5 py-0.5 rounded ${q}`,children:M}),m!=null&&m.address?u.jsx(dr,{address:m.address,parameters:m.parameters,className:"text-xs bg-transparent p-0"}):u.jsx("span",{className:"truncate",children:S})]})},S)})})]},Z)})]})})]})}function kl(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),i=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return`${n} ${i} ${r}`}function yi(e,t,n){if(e)for(const i of Ou){const r=e[i];r&&(n[`--color-${t}-${i}`]=kl(r))}}const Su=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Ru={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 Iu(e){const t={},n=e.dark?"dark":e.light?"light":null,i=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[r,s]of Object.entries(Ru))t[`--color-neutral-${r}`]=s;if(i)for(const[r,s]of Su){const o=i[r];o&&(t[s]=kl(o))}return e.colors&&(yi(e.colors.primary,"primary",t),yi(e.colors.secondary,"secondary",t),yi(e.colors.neutral,"neutral",t)),t}var Mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ls(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}/*! @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 xi,So;function Ro(){if(So)return xi;So=1;function e(L,z){(z==null||z>L.length)&&(z=L.length);for(var Q=0,v=Array(z);Q<z;Q++)v[Q]=L[Q];return v}function t(L){if(Array.isArray(L))return L}function n(L,z){var Q=L==null?null:typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(Q!=null){var v,A,D,le,Ie=[],Oe=!0,re=!1;try{if(D=(Q=Q.call(L)).next,z!==0)for(;!(Oe=(v=D.call(Q)).done)&&(Ie.push(v.value),Ie.length!==z);Oe=!0);}catch(ne){re=!0,A=ne}finally{try{if(!Oe&&Q.return!=null&&(le=Q.return(),Object(le)!==le))return}finally{if(re)throw A}}return Ie}}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
3
+ immediately without an extra authorization code exchange step.`,gu="Client Credentials",yu="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",xu="Password",bu="The Password grant type is a legacy way to exchange a user's credentials for an access token.",vu="Authorization Code",wu="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",_u="Connecting to a server",Eu="",jo=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],Ou=[50,100,200,300,500,600,700],ku={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"}};function Au(e){if(e.length===0)return u.jsx("span",{children:"No allowed values."});if(e.length===1)return u.jsxs("span",{children:["Allowed value is ",u.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((i,r)=>u.jsxs(ie.Fragment,{children:[u.jsx("code",{children:i}),", "," "]},r)),n=u.jsx("code",{children:e[e.length-1]},"last");return u.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function Tu(e){return e.map(t=>`\`${t}\``).join(", ")}function Nu(e){const t=[],n=/\{([^}]+)\}/g;let i=0,r;for(;(r=n.exec(e))!==null;)r.index>i&&t.push({type:"text",value:e.slice(i,r.index)}),t.push({type:"param",value:r[1]}),i=r.index+r[0].length;return i<e.length&&t.push({type:"text",value:e.slice(i)}),t}function dr({address:e,parameters:t,className:n="text-xs",truncate:i=!1}){const{portalHost:r}=zt(),[s,o]=ie.useState(null),[a,l]=ie.useState({top:0,left:0,placement:"top"}),[c,d]=ie.useState(!1),f=ie.useRef(null),p=Nu(e);let h=0;const g=40;ie.useEffect(()=>{if(!i)return;const y=f.current;if(!y)return;const x=()=>d(y.scrollWidth>y.clientWidth);x();const w=new ResizeObserver(x);return w.observe(y),()=>w.disconnect()},[i,e]);const _=(y,x)=>{const w=x.getBoundingClientRect(),E=w.top<g?"bottom":"top";l({top:E==="top"?w.top-8:w.bottom+8,left:w.left+w.width/2,placement:E}),o(y)},k=p.map((y,x)=>{if(y.type==="text")return u.jsx("span",{children:y.value},x);const w=t==null?void 0:t[y.value],E=jo[h++%jo.length],j=s===x,N=!!w&&(w.description||w.default||w.enum&&w.enum.length>0||w.examples&&w.examples.length>0);return u.jsxs("span",{className:"inline-block",onMouseEnter:R=>_(x,R.currentTarget),onMouseLeave:()=>o(null),children:[u.jsx("span",{className:`font-semibold ${E} ${N?"cursor-help underline decoration-dotted":""}`,children:`{${y.value}}`}),N&&j&&r&&ml.createPortal(u.jsxs("div",{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 ${a.placement==="top"?"-translate-y-full":""}`,style:{top:a.top,left:a.left},children:[w.description&&u.jsx("div",{children:w.description}),w.default&&u.jsxs("div",{className:"mt-1",children:[u.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",u.jsx("code",{children:w.default})]}),w.enum&&w.enum.length>0&&u.jsx("div",{className:"mt-1",children:Au(w.enum)}),w.examples&&w.examples.length>0&&u.jsxs("div",{className:"mt-1",children:[u.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",w.examples.join(", ")]})]}),r)]},x)});return i?u.jsxs("code",{className:`px-2 py-1 rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[u.jsx("span",{ref:f,className:"overflow-hidden whitespace-nowrap min-w-0",children:k}),c&&u.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):u.jsx("code",{className:`px-2 py-1 rounded text-foreground-secondary break-all ${n}`,children:k})}function ju({info:e,operations:t={},messages:n={},schemas:i={},activeTab:r,onTabChange:s,onItemSelect:o,selectedItem:a,sidebarConfig:l}){const[c,d]=ie.useState(!1),[f,p]=ie.useState(0),[h,g]=ie.useState(null),{rootElement:_}=zt(),k=uu(_,c),y=k!=="docked",x=vl(_,y),E={transform:`translate(${c&&f?f-2:0}px, ${k==="hidden"?"-150%":"0px"})`,...y?{position:"fixed",top:10,left:((x==null?void 0:x.left)??0)+12,pointerEvents:k==="hidden"?"none":void 0}:{}};ie.useEffect(()=>{if(!h)return;const Z=new ResizeObserver(([H])=>p(H.contentRect.width));return Z.observe(h),()=>Z.disconnect()},[h]);const j=Z=>{var K;return l!=null&&l.useChannelAddressAsIdentifier?((K=t[Z])==null?void 0:K.channel)??null:null},N=[{id:"operations",label:"Operations",icon:_l,items:Object.keys(t)},{id:"messages",label:"Messages",icon:El,items:Object.keys(n)},{id:"schemas",label:"Schemas",icon:Ol,items:Object.keys(i)}],R=(Z,H)=>{s(Z),H&&setTimeout(()=>{var K;(K=document.getElementById(H))==null||K.scrollIntoView({behavior:"smooth",block:"start"})},50)};return u.jsxs(u.Fragment,{children:[u.jsx("button",{onClick:()=>d(Z=>!Z),title:c?"Close navigation":"Open navigation",className:"panel-toggle-btn bg-neutral-100",style:E,children:u.jsx(ou,{isCollapsed:c})}),u.jsx(wl,{ref:g,isOpen:c,side:"left",onClose:()=>d(!1),width:"min-w-[450px] w-auto",children:u.jsxs("nav",{className:"space-y-1",children:[u.jsxs("div",{className:"flex items-center gap-2 pb-4 mb-2 border-b border-border",children:[u.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:e.title}),e.version&&u.jsxs("span",{className:"shrink-0 text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:["v",e.version]})]}),N.map(({id:Z,label:H,icon:K,items:Y})=>{const pe=r===Z;if(!(Y.length<1))return u.jsxs("div",{className:"pb-1",children:[u.jsxs("button",{onClick:()=>R(Z),className:`flex items-center gap-2 w-full text-left px-2 py-2 rounded-md group transition-colors ${pe?"bg-primary-50":"hover:bg-neutral-50"}`,children:[u.jsx(K,{className:`w-3.5 h-3.5 shrink-0 transition-colors ${pe?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),u.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${pe?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:H}),u.jsx("span",{className:`ml-auto text-[10px] font-mono px-1.5 py-0.5 rounded transition-colors ${pe?"bg-primary-100 text-primary-500 border border-primary-200":"bg-neutral-100 text-foreground-muted"}`,children:Y.length})]}),Y.length>0&&u.jsx("ul",{className:"mt-0.5 space-y-0.5 pl-3 border-l border-border ml-4",children:Y.map(S=>{const O=Z==="operations"?t[S]:null,m=Z==="operations"?j(S):null,M=O==null?void 0:O.action,q=M===sn.SEND?"bg-green-100 text-green-700":M===sn.RECEIVE?"bg-blue-100 text-blue-700":null,P=(a==null?void 0:a.tab)===Z&&(a==null?void 0:a.key)===S;return u.jsx("li",{children:u.jsxs("button",{onClick:()=>{R(Z,`${Z.slice(0,-1)}-${S}`),o==null||o(Z,S)},className:`w-full text-left flex items-center gap-2 text-xs py-1.5 px-2 rounded-md transition-colors ${P?"bg-primary-50 text-primary-500 font-medium":pe?"text-foreground-secondary hover:text-foreground hover:bg-primary-50":"text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-50"}`,children:[q&&u.jsx("span",{className:`shrink-0 text-[10px] font-medium uppercase px-1.5 py-0.5 rounded ${q}`,children:M}),m!=null&&m.address?u.jsx(dr,{address:m.address,parameters:m.parameters,className:"text-xs bg-transparent p-0"}):u.jsx("span",{className:"truncate",children:S})]})},S)})})]},Z)})]})})]})}function kl(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),i=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return`${n} ${i} ${r}`}function yi(e,t,n){if(e)for(const i of Ou){const r=e[i];r&&(n[`--color-${t}-${i}`]=kl(r))}}const Su=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Ru={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 Iu(e){const t={},n=e.light?"light":e.dark?"dark":null,i=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[r,s]of Object.entries(Ru))t[`--color-neutral-${r}`]=s;if(i)for(const[r,s]of Su){const o=i[r];o&&(t[s]=kl(o))}return e.colors&&(yi(e.colors.primary,"primary",t),yi(e.colors.secondary,"secondary",t),yi(e.colors.neutral,"neutral",t)),t}var Mn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ls(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Mu(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function i(){return this instanceof i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(i){var r=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(n,i,r.get?r:{enumerable:!0,get:function(){return e[i]}})}),n}/*! @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 xi,So;function Ro(){if(So)return xi;So=1;function e(L,z){(z==null||z>L.length)&&(z=L.length);for(var Q=0,v=Array(z);Q<z;Q++)v[Q]=L[Q];return v}function t(L){if(Array.isArray(L))return L}function n(L,z){var Q=L==null?null:typeof Symbol<"u"&&L[Symbol.iterator]||L["@@iterator"];if(Q!=null){var v,A,D,le,Ie=[],Oe=!0,re=!1;try{if(D=(Q=Q.call(L)).next,z!==0)for(;!(Oe=(v=D.call(Q)).done)&&(Ie.push(v.value),Ie.length!==z);Oe=!0);}catch(ne){re=!0,A=ne}finally{try{if(!Oe&&Q.return!=null&&(le=Q.return(),Object(le)!==le))return}finally{if(re)throw A}}return Ie}}function i(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
4
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(L,z){return t(L)||n(L,z)||s(L,z)||i()}function s(L,z){if(L){if(typeof L=="string")return e(L,z);var Q={}.toString.call(L).slice(8,-1);return Q==="Object"&&L.constructor&&(Q=L.constructor.name),Q==="Map"||Q==="Set"?Array.from(L):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?e(L,z):void 0}}const o=Object.entries,a=Object.setPrototypeOf,l=Object.isFrozen,c=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let f=Object.freeze,p=Object.seal,h=Object.create,g=typeof Reflect<"u"&&Reflect,_=g.apply,k=g.construct;f||(f=function(z){return z}),p||(p=function(z){return z}),_||(_=function(z,Q){for(var v=arguments.length,A=new Array(v>2?v-2:0),D=2;D<v;D++)A[D-2]=arguments[D];return z.apply(Q,A)}),k||(k=function(z){for(var Q=arguments.length,v=new Array(Q>1?Q-1:0),A=1;A<Q;A++)v[A-1]=arguments[A];return new z(...v)});const y=J(Array.prototype.forEach),x=J(Array.prototype.lastIndexOf),w=J(Array.prototype.pop),E=J(Array.prototype.push),j=J(Array.prototype.splice),N=Array.isArray,R=J(String.prototype.toLowerCase),Z=J(String.prototype.toString),H=J(String.prototype.match),K=J(String.prototype.replace),Y=J(String.prototype.indexOf),pe=J(String.prototype.trim),S=J(Number.prototype.toString),O=J(Boolean.prototype.toString),m=typeof BigInt>"u"?null:J(BigInt.prototype.toString),M=typeof Symbol>"u"?null:J(Symbol.prototype.toString),q=J(Object.prototype.hasOwnProperty),P=J(Object.prototype.toString),U=J(RegExp.prototype.test),B=de(TypeError);function J(L){return function(z){z instanceof RegExp&&(z.lastIndex=0);for(var Q=arguments.length,v=new Array(Q>1?Q-1:0),A=1;A<Q;A++)v[A-1]=arguments[A];return _(L,z,v)}}function de(L){return function(){for(var z=arguments.length,Q=new Array(z),v=0;v<z;v++)Q[v]=arguments[v];return k(L,Q)}}function X(L,z){let Q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:R;if(a&&a(L,null),!N(z))return L;let v=z.length;for(;v--;){let A=z[v];if(typeof A=="string"){const D=Q(A);D!==A&&(l(z)||(z[v]=D),A=D)}L[A]=!0}return L}function xe(L){for(let z=0;z<L.length;z++)q(L,z)||(L[z]=null);return L}function ve(L){const z=h(null);for(const v of o(L)){var Q=r(v,2);const A=Q[0],D=Q[1];q(L,A)&&(N(D)?z[A]=xe(D):D&&typeof D=="object"&&D.constructor===Object?z[A]=ve(D):z[A]=D)}return z}function ee(L){switch(typeof L){case"string":return L;case"number":return S(L);case"boolean":return O(L);case"bigint":return m?m(L):"0";case"symbol":return M?M(L):"Symbol()";case"undefined":return P(L);case"function":case"object":{if(L===null)return P(L);const z=L,Q=we(z,"toString");if(typeof Q=="function"){const v=Q(z);return typeof v=="string"?v:P(v)}return P(L)}default:return P(L)}}function we(L,z){for(;L!==null;){const v=d(L,z);if(v){if(v.get)return J(v.get);if(typeof v.value=="function")return J(v.value)}L=c(L)}function Q(){return null}return Q}function qe(L){try{return U(L,""),!0}catch{return!1}}const Fe=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"]),yt=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"]),rt=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"]),Kt=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"]),Rt=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"]),on=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ht=f(["#text"]),Ve=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"]),Be=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"]),xt=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"]),Xe=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),En=p(/{{[\w\W]*|^[\w\W]*}}/g),Hn=p(/<%[\w\W]*|^[\w\W]*%>/g),Vn=p(/\${[\w\W]*/g),an=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),Et=p(/^aria-[\-\w]+$/),Qe=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ot=p(/^(?:\w+script|data):/i),It=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),On=p(/^html$/i),Qt=p(/^[a-z][.\w]*(-[.\w]+)+$/i),kn=p(/<[/\w!]/g),Wn=p(/<[/\w]/g),Jn=p(/<\/no(script|embed|frames)/i),We=p(/\/>/i),I={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},C=function(){return typeof window>"u"?null:window},F=function(z,Q){if(typeof z!="object"||typeof z.createPolicy!="function")return null;let v=null;const A="data-tt-policy-suffix";Q&&Q.hasAttribute(A)&&(v=Q.getAttribute(A));const D="dompurify"+(v?"#"+v:"");try{return z.createPolicy(D,{createHTML(le){return le},createScriptURL(le){return le}})}catch{return console.warn("TrustedTypes policy "+D+" could not be created."),null}},V=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},oe=function(z,Q,v,A){return q(z,Q)&&N(z[Q])?X(A.base?ve(A.base):{},z[Q],A.transform):v};function ae(){let L=arguments.length>0&&arguments[0]!==void 0?arguments[0]:C();const z=G=>ae(G);if(z.version="3.4.11",z.removed=[],!L||!L.document||L.document.nodeType!==I.document||!L.Element)return z.isSupported=!1,z;let Q=L.document;const v=Q,A=v.currentScript;L.DocumentFragment;const D=L.HTMLTemplateElement,le=L.Node,Ie=L.Element,Oe=L.NodeFilter,re=L.NamedNodeMap;re===void 0&&(L.NamedNodeMap||L.MozNamedAttrMap),L.HTMLFormElement;const ne=L.DOMParser,he=L.trustedTypes,Me=Ie.prototype,Ue=we(Me,"cloneNode"),Gt=we(Me,"remove"),Zn=we(Me,"nextSibling"),Vt=we(Me,"childNodes"),ln=we(Me,"parentNode"),An=we(Me,"shadowRoot"),Xn=we(Me,"attributes"),it=le&&le.prototype?we(le.prototype,"nodeType"):null,Mt=le&&le.prototype?we(le.prototype,"nodeName"):null;if(typeof D=="function"){const G=Q.createElement("template");G.content&&G.content.ownerDocument&&(Q=G.content.ownerDocument)}let Ge,bt="",Yn,Or=!1,cn=0;const kt=function(){if(cn>0)throw B('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.')},Wt=function(b){kt(),cn++;try{return Ge.createHTML(b)}finally{cn--}},kr=function(b){kt(),cn++;try{return Ge.createScriptURL(b)}finally{cn--}},ii=function(){return Or||(Yn=F(he,A),Or=!0),Yn},Tn=Q,$n=Tn.implementation,un=Tn.createNodeIterator,si=Tn.createDocumentFragment,W=Tn.getElementsByTagName,fe=v.importNode;let ue=V();z.isSupported=typeof o=="function"&&typeof ln=="function"&&$n&&$n.createHTMLDocument!==void 0;const Se=En,Je=Hn,dt=Vn,Ct=an,Nn=Et,st=Ot,pt=It,Ar=Qt;let Kn=Qe,Le=null;const Tr=X({},[...Fe,...yt,...rt,...Rt,...Ht]);let Pe=null;const Nr=X({},[...Ve,...Be,...xt,...Xe]);let De=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}})),Lt=null,Qn=null;const Ye=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let jr=!0,fn=!0,me=!1,Gn=!0,Ce=!1,Te=!0,vt=!1,At=!1,dn=null,pn=null,te=!1,se=!1,be=!1,ke=!1,$e=!0,wt=!1;const Sr="user-content-";let er=!0,oi=!1,jn={},Pt=null;const ai=X({},["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 fo=null;const po=X({},["audio","video","img","source","image","track"]);let li=null;const ho=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Rr="http://www.w3.org/1998/Math/MathML",Ir="http://www.w3.org/2000/svg",Dt="http://www.w3.org/1999/xhtml";let Sn=Dt,ci=!1,ui=null;const Fc=X({},[Rr,Ir,Dt],Z),mo=f(["mi","mo","mn","ms","mtext"]);let fi=X({},mo);const go=f(["annotation-xml"]);let di=X({},go);const Bc=X({},["title","style","font","a","script"]);let tr=null;const zc=["application/xhtml+xml","text/html"],qc="text/html";let He=null,Rn=null;const Uc=Q.createElement("form"),yo=function(b){return b instanceof RegExp||b instanceof Function},pi=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Rn&&Rn===b)return;(!b||typeof b!="object")&&(b={}),b=ve(b),tr=zc.indexOf(b.PARSER_MEDIA_TYPE)===-1?qc:b.PARSER_MEDIA_TYPE,He=tr==="application/xhtml+xml"?Z:R,Le=oe(b,"ALLOWED_TAGS",Tr,{transform:He}),Pe=oe(b,"ALLOWED_ATTR",Nr,{transform:He}),ui=oe(b,"ALLOWED_NAMESPACES",Fc,{transform:Z}),li=oe(b,"ADD_URI_SAFE_ATTR",ho,{transform:He,base:ho}),fo=oe(b,"ADD_DATA_URI_TAGS",po,{transform:He,base:po}),Pt=oe(b,"FORBID_CONTENTS",ai,{transform:He}),Lt=oe(b,"FORBID_TAGS",ve({}),{transform:He}),Qn=oe(b,"FORBID_ATTR",ve({}),{transform:He}),jn=q(b,"USE_PROFILES")?b.USE_PROFILES&&typeof b.USE_PROFILES=="object"?ve(b.USE_PROFILES):b.USE_PROFILES:!1,jr=b.ALLOW_ARIA_ATTR!==!1,fn=b.ALLOW_DATA_ATTR!==!1,me=b.ALLOW_UNKNOWN_PROTOCOLS||!1,Gn=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ce=b.SAFE_FOR_TEMPLATES||!1,Te=b.SAFE_FOR_XML!==!1,vt=b.WHOLE_DOCUMENT||!1,se=b.RETURN_DOM||!1,be=b.RETURN_DOM_FRAGMENT||!1,ke=b.RETURN_TRUSTED_TYPE||!1,te=b.FORCE_BODY||!1,$e=b.SANITIZE_DOM!==!1,wt=b.SANITIZE_NAMED_PROPS||!1,er=b.KEEP_CONTENT!==!1,oi=b.IN_PLACE||!1,Kn=qe(b.ALLOWED_URI_REGEXP)?b.ALLOWED_URI_REGEXP:Qe,Sn=typeof b.NAMESPACE=="string"?b.NAMESPACE:Dt,fi=q(b,"MATHML_TEXT_INTEGRATION_POINTS")&&b.MATHML_TEXT_INTEGRATION_POINTS&&typeof b.MATHML_TEXT_INTEGRATION_POINTS=="object"?ve(b.MATHML_TEXT_INTEGRATION_POINTS):X({},mo),di=q(b,"HTML_INTEGRATION_POINTS")&&b.HTML_INTEGRATION_POINTS&&typeof b.HTML_INTEGRATION_POINTS=="object"?ve(b.HTML_INTEGRATION_POINTS):X({},go);const T=q(b,"CUSTOM_ELEMENT_HANDLING")&&b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING=="object"?ve(b.CUSTOM_ELEMENT_HANDLING):h(null);if(De=h(null),q(T,"tagNameCheck")&&yo(T.tagNameCheck)&&(De.tagNameCheck=T.tagNameCheck),q(T,"attributeNameCheck")&&yo(T.attributeNameCheck)&&(De.attributeNameCheck=T.attributeNameCheck),q(T,"allowCustomizedBuiltInElements")&&typeof T.allowCustomizedBuiltInElements=="boolean"&&(De.allowCustomizedBuiltInElements=T.allowCustomizedBuiltInElements),p(De),Ce&&(fn=!1),be&&(se=!0),jn&&(Le=X({},Ht),Pe=h(null),jn.html===!0&&(X(Le,Fe),X(Pe,Ve)),jn.svg===!0&&(X(Le,yt),X(Pe,Be),X(Pe,Xe)),jn.svgFilters===!0&&(X(Le,rt),X(Pe,Be),X(Pe,Xe)),jn.mathMl===!0&&(X(Le,Rt),X(Pe,xt),X(Pe,Xe))),Ye.tagCheck=null,Ye.attributeCheck=null,q(b,"ADD_TAGS")&&(typeof b.ADD_TAGS=="function"?Ye.tagCheck=b.ADD_TAGS:N(b.ADD_TAGS)&&(Le===Tr&&(Le=ve(Le)),X(Le,b.ADD_TAGS,He))),q(b,"ADD_ATTR")&&(typeof b.ADD_ATTR=="function"?Ye.attributeCheck=b.ADD_ATTR:N(b.ADD_ATTR)&&(Pe===Nr&&(Pe=ve(Pe)),X(Pe,b.ADD_ATTR,He))),q(b,"ADD_URI_SAFE_ATTR")&&N(b.ADD_URI_SAFE_ATTR)&&X(li,b.ADD_URI_SAFE_ATTR,He),q(b,"FORBID_CONTENTS")&&N(b.FORBID_CONTENTS)&&(Pt===ai&&(Pt=ve(Pt)),X(Pt,b.FORBID_CONTENTS,He)),q(b,"ADD_FORBID_CONTENTS")&&N(b.ADD_FORBID_CONTENTS)&&(Pt===ai&&(Pt=ve(Pt)),X(Pt,b.ADD_FORBID_CONTENTS,He)),er&&(Le["#text"]=!0),vt&&X(Le,["html","head","body"]),Le.table&&(X(Le,["tbody"]),delete Lt.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw B('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw B('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const $=Ge;Ge=b.TRUSTED_TYPES_POLICY;try{bt=Wt("")}catch(ce){throw Ge=$,ce}}else b.TRUSTED_TYPES_POLICY===null?(Ge=void 0,bt=""):(Ge===void 0&&(Ge=ii()),Ge&&typeof bt=="string"&&(bt=Wt("")));f&&f(b),Rn=b},xo=X({},[...yt,...rt,...Kt]),bo=X({},[...Rt,...on]),Hc=function(b,T,$){return T.namespaceURI===Dt?b==="svg":T.namespaceURI===Rr?b==="svg"&&($==="annotation-xml"||fi[$]):!!xo[b]},Vc=function(b,T,$){return T.namespaceURI===Dt?b==="math":T.namespaceURI===Ir?b==="math"&&di[$]:!!bo[b]},Wc=function(b,T,$){return T.namespaceURI===Ir&&!di[$]||T.namespaceURI===Rr&&!fi[$]?!1:!bo[b]&&(Bc[b]||!xo[b])},Jc=function(b){let T=ln(b);(!T||!T.tagName)&&(T={namespaceURI:Sn,tagName:"template"});const $=R(b.tagName),ce=R(T.tagName);return ui[b.namespaceURI]?b.namespaceURI===Ir?Hc($,T,ce):b.namespaceURI===Rr?Vc($,T,ce):b.namespaceURI===Dt?Wc($,T,ce):!!(tr==="application/xhtml+xml"&&ui[b.namespaceURI]):!1},en=function(b){E(z.removed,{element:b});try{ln(b).removeChild(b)}catch{if(Gt(b),!ln(b))throw B("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},vo=function(b){const T=Vt(b);if(T){const ce=[];y(T,_e=>{E(ce,_e)}),y(ce,_e=>{try{Gt(_e)}catch{}})}const $=Xn(b);if($)for(let ce=$.length-1;ce>=0;--ce){const _e=$[ce],Ae=_e&&_e.name;if(typeof Ae=="string")try{b.removeAttribute(Ae)}catch{}}},hn=function(b,T){try{E(z.removed,{attribute:T.getAttributeNode(b),from:T})}catch{E(z.removed,{attribute:null,from:T})}if(T.removeAttribute(b),b==="is")if(se||be)try{en(T)}catch{}else try{T.setAttribute(b,"")}catch{}},Zc=function(b){const T=Xn(b);if(T)for(let $=T.length-1;$>=0;--$){const ce=T[$],_e=ce&&ce.name;if(!(typeof _e!="string"||Pe[He(_e)]))try{b.removeAttribute(_e)}catch{}}},Xc=function(b){const T=[b];for(;T.length>0;){const $=T.pop();(it?it($):$.nodeType)===I.element&&Zc($);const _e=Vt($);if(_e)for(let Ae=_e.length-1;Ae>=0;--Ae)T.push(_e[Ae])}},wo=function(b){let T=null,$=null;if(te)b="<remove></remove>"+b;else{const Ae=H(b,/^[\r\n\t ]+/);$=Ae&&Ae[0]}tr==="application/xhtml+xml"&&Sn===Dt&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const ce=Ge?Wt(b):b;if(Sn===Dt)try{T=new ne().parseFromString(ce,tr)}catch{}if(!T||!T.documentElement){T=$n.createDocument(Sn,"template",null);try{T.documentElement.innerHTML=ci?bt:ce}catch{}}const _e=T.body||T.documentElement;return b&&$&&_e.insertBefore(Q.createTextNode($),_e.childNodes[0]||null),Sn===Dt?W.call(T,vt?"html":"body")[0]:vt?T.documentElement:_e},_o=function(b){return un.call(b.ownerDocument||b,b,Oe.SHOW_ELEMENT|Oe.SHOW_COMMENT|Oe.SHOW_TEXT|Oe.SHOW_PROCESSING_INSTRUCTION|Oe.SHOW_CDATA_SECTION,null)},Mr=function(b){return b=K(b,Se," "),b=K(b,Je," "),b=K(b,dt," "),b},hi=function(b){var T;b.normalize();const $=un.call(b.ownerDocument||b,b,Oe.SHOW_TEXT|Oe.SHOW_COMMENT|Oe.SHOW_CDATA_SECTION|Oe.SHOW_PROCESSING_INSTRUCTION,null);let ce=$.nextNode();for(;ce;)ce.data=Mr(ce.data),ce=$.nextNode();const _e=(T=b.querySelectorAll)===null||T===void 0?void 0:T.call(b,"template");_e&&y(_e,Ae=>{In(Ae.content)&&hi(Ae.content)})},Cr=function(b){const T=Mt?Mt(b):null;return typeof T!="string"||He(T)!=="form"?!1:typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||b.attributes!==Xn(b)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function"||b.nodeType!==it(b)||b.childNodes!==Vt(b)},In=function(b){if(!it||typeof b!="object"||b===null)return!1;try{return it(b)===I.documentFragment}catch{return!1}},nr=function(b){if(!it||typeof b!="object"||b===null)return!1;try{return typeof it(b)=="number"}catch{return!1}};function Jt(G,b,T){G.length!==0&&y(G,$=>{$.call(z,b,T,Rn)})}const Yc=function(b,T){return!!(Te&&b.hasChildNodes()&&!nr(b.firstElementChild)&&U(kn,b.textContent)&&U(kn,b.innerHTML)||Te&&b.namespaceURI===Dt&&T==="style"&&nr(b.firstElementChild)||b.nodeType===I.processingInstruction||Te&&b.nodeType===I.comment&&U(Wn,b.data))},$c=function(b,T){if(!Lt[T]&&ko(T)&&(De.tagNameCheck instanceof RegExp&&U(De.tagNameCheck,T)||De.tagNameCheck instanceof Function&&De.tagNameCheck(T)))return!1;if(er&&!Pt[T]){const $=ln(b),ce=Vt(b);if(ce&&$){const _e=ce.length;for(let Ae=_e-1;Ae>=0;--Ae){const Ke=oi?ce[Ae]:Ue(ce[Ae],!0);$.insertBefore(Ke,Zn(b))}}}return en(b),!0},Eo=function(b){if(Jt(ue.beforeSanitizeElements,b,null),Cr(b))return en(b),!0;const T=He(Mt?Mt(b):b.nodeName);if(Jt(ue.uponSanitizeElement,b,{tagName:T,allowedTags:Le}),Yc(b,T))return en(b),!0;if(Lt[T]||!(Ye.tagCheck instanceof Function&&Ye.tagCheck(T))&&!Le[T])return $c(b,T);if((it?it(b):b.nodeType)===I.element&&!Jc(b)||(T==="noscript"||T==="noembed"||T==="noframes")&&U(Jn,b.innerHTML))return en(b),!0;if(Ce&&b.nodeType===I.text){const ce=Mr(b.textContent);b.textContent!==ce&&(E(z.removed,{element:b.cloneNode()}),b.textContent=ce)}return Jt(ue.afterSanitizeElements,b,null),!1},Oo=function(b,T,$){if(Qn[T]||$e&&(T==="id"||T==="name")&&($ in Q||$ in Uc))return!1;const ce=Pe[T]||Ye.attributeCheck instanceof Function&&Ye.attributeCheck(T,b);if(!(fn&&U(Ct,T))){if(!(jr&&U(Nn,T))){if(ce){if(!li[T]){if(!U(Kn,K($,pt,""))){if(!((T==="src"||T==="xlink:href"||T==="href")&&b!=="script"&&Y($,"data:")===0&&fo[b])){if(!(me&&!U(st,K($,pt,"")))){if($)return!1}}}}}else if(!(ko(b)&&(De.tagNameCheck instanceof RegExp&&U(De.tagNameCheck,b)||De.tagNameCheck instanceof Function&&De.tagNameCheck(b))&&(De.attributeNameCheck instanceof RegExp&&U(De.attributeNameCheck,T)||De.attributeNameCheck instanceof Function&&De.attributeNameCheck(T,b))||T==="is"&&De.allowCustomizedBuiltInElements&&(De.tagNameCheck instanceof RegExp&&U(De.tagNameCheck,$)||De.tagNameCheck instanceof Function&&De.tagNameCheck($))))return!1}}return!0},Kc=X({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ko=function(b){return!Kc[R(b)]&&U(Ar,b)},Qc=function(b,T,$,ce){if(Ge&&typeof he=="object"&&typeof he.getAttributeType=="function"&&!$)switch(he.getAttributeType(b,T)){case"TrustedHTML":return Wt(ce);case"TrustedScriptURL":return kr(ce)}return ce},Gc=function(b,T,$,ce){try{$?b.setAttributeNS($,T,ce):b.setAttribute(T,ce),Cr(b)?en(b):w(z.removed)}catch{hn(T,b)}},Ao=function(b){Jt(ue.beforeSanitizeAttributes,b,null);const T=b.attributes;if(!T||Cr(b))return;const $={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Pe,forceKeepAttr:void 0};let ce=T.length;const _e=He(b.nodeName);for(;ce--;){const Ae=T[ce],Ke=Ae.name,Ze=Ae.namespaceURI,_t=Ae.value,Tt=He(Ke),gi=_t;let ot=Ke==="value"?gi:pe(gi);if($.attrName=Tt,$.attrValue=ot,$.keepAttr=!0,$.forceKeepAttr=void 0,Jt(ue.uponSanitizeAttribute,b,$),ot=$.attrValue,wt&&(Tt==="id"||Tt==="name")&&Y(ot,Sr)!==0&&(hn(Ke,b),ot=Sr+ot),Te&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ot)){hn(Ke,b);continue}if(Tt==="attributename"&&H(ot,"href")){hn(Ke,b);continue}if(!$.forceKeepAttr){if(!$.keepAttr){hn(Ke,b);continue}if(!Gn&&U(We,ot)){hn(Ke,b);continue}if(Ce&&(ot=Mr(ot)),!Oo(_e,Tt,ot)){hn(Ke,b);continue}ot=Qc(_e,Tt,Ze,ot),ot!==gi&&Gc(b,Ke,Ze,ot)}}Jt(ue.afterSanitizeAttributes,b,null)},Lr=function(b){let T=null;const $=_o(b);for(Jt(ue.beforeSanitizeShadowDOM,b,null);T=$.nextNode();)if(Jt(ue.uponSanitizeShadowNode,T,null),Eo(T),Ao(T),In(T.content)&&Lr(T.content),(it?it(T):T.nodeType)===I.element){const _e=An(T);In(_e)&&(mi(_e),Lr(_e))}Jt(ue.afterSanitizeShadowDOM,b,null)},mi=function(b){const T=[{node:b,shadow:null}];for(;T.length>0;){const $=T.pop();if($.shadow){Lr($.shadow);continue}const ce=$.node,Ae=(it?it(ce):ce.nodeType)===I.element,Ke=Vt(ce);if(Ke)for(let Ze=Ke.length-1;Ze>=0;--Ze)T.push({node:Ke[Ze],shadow:null});if(Ae){const Ze=Mt?Mt(ce):null;if(typeof Ze=="string"&&He(Ze)==="template"){const _t=ce.content;In(_t)&&T.push({node:_t,shadow:null})}}if(Ae){const Ze=An(ce);In(Ze)&&T.push({node:null,shadow:Ze},{node:Ze,shadow:null})}}};return z.sanitize=function(G){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},T=null,$=null,ce=null,_e=null;if(ci=!G,ci&&(G="<!-->"),typeof G!="string"&&!nr(G)&&(G=ee(G),typeof G!="string"))throw B("dirty is not a string, aborting");if(!z.isSupported)return G;At?(Le=dn,Pe=pn):pi(b),(ue.uponSanitizeElement.length>0||ue.uponSanitizeAttribute.length>0)&&(Le=ve(Le)),ue.uponSanitizeAttribute.length>0&&(Pe=ve(Pe)),z.removed=[];const Ae=oi&&typeof G!="string"&&nr(G);if(Ae){const _t=Mt?Mt(G):G.nodeName;if(typeof _t=="string"){const Tt=He(_t);if(!Le[Tt]||Lt[Tt])throw B("root node is forbidden and cannot be sanitized in-place")}if(Cr(G))throw B("root node is clobbered and cannot be sanitized in-place");try{mi(G)}catch(Tt){throw vo(G),Tt}}else if(nr(G))T=wo("<!---->"),$=T.ownerDocument.importNode(G,!0),$.nodeType===I.element&&$.nodeName==="BODY"||$.nodeName==="HTML"?T=$:T.appendChild($),mi($);else{if(!se&&!Ce&&!vt&&G.indexOf("<")===-1)return Ge&&ke?Wt(G):G;if(T=wo(G),!T)return se?null:ke?bt:""}T&&te&&en(T.firstChild);const Ke=_o(Ae?G:T);try{for(;ce=Ke.nextNode();)Eo(ce),Ao(ce),In(ce.content)&&Lr(ce.content)}catch(_t){throw Ae&&vo(G),_t}if(Ae)return y(z.removed,_t=>{_t.element&&Xc(_t.element)}),Ce&&hi(G),G;if(se){if(Ce&&hi(T),be)for(_e=si.call(T.ownerDocument);T.firstChild;)_e.appendChild(T.firstChild);else _e=T;return(Pe.shadowroot||Pe.shadowrootmode)&&(_e=fe.call(v,_e,!0)),_e}let Ze=vt?T.outerHTML:T.innerHTML;return vt&&Le["!doctype"]&&T.ownerDocument&&T.ownerDocument.doctype&&T.ownerDocument.doctype.name&&U(On,T.ownerDocument.doctype.name)&&(Ze="<!DOCTYPE "+T.ownerDocument.doctype.name+`>
5
5
  `+Ze),Ce&&(Ze=Mr(Ze)),Ge&&ke?Wt(Ze):Ze},z.setConfig=function(){let G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pi(G),At=!0,dn=Le,pn=Pe},z.clearConfig=function(){Rn=null,At=!1,dn=null,pn=null,Ge=Yn,bt=""},z.isValidAttribute=function(G,b,T){Rn||pi({});const $=He(G),ce=He(b);return Oo($,ce,T)},z.addHook=function(G,b){typeof b=="function"&&q(ue,G)&&E(ue[G],b)},z.removeHook=function(G,b){if(q(ue,G)){if(b!==void 0){const T=x(ue[G],b);return T===-1?void 0:j(ue[G],T,1)[0]}return w(ue[G])}},z.removeHooks=function(G){q(ue,G)&&(ue[G]=[])},z.removeAllHooks=function(){ue=V()},z}var ye=ae();return xi=ye,xi}var bi,Io;function Cu(){return Io||(Io=1,bi=self.DOMPurify||(self.DOMPurify=Ro().default||Ro())),bi}var Lu=Cu();const Al=Ls(Lu);function Ps(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var bn=Ps();function Tl(e){bn=e}var cr={exec:()=>null};function je(e,t=""){let n=typeof e=="string"?e:e.source;const i={replace:(r,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(lt.caret,"$1"),n=n.replace(r,o),i},getRegex:()=>new RegExp(n,t)};return i}var lt={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")},Pu=/^(?:[ \t]*(?:\n|$))+/,Du=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Fu=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gr=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Bu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ds=/(?:[*+-]|\d{1,9}[.)])/,Nl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,jl=je(Nl).replace(/bull/g,Ds).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(),zu=je(Nl).replace(/bull/g,Ds).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(),Fs=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,qu=/^[^\n]+/,Bs=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Uu=je(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Bs).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Hu=je(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ds).getRegex(),Gr="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",zs=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vu=je("^ {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",zs).replace("tag",Gr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Sl=je(Fs).replace("hr",gr).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",Gr).getRegex(),Wu=je(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Sl).getRegex(),qs={blockquote:Wu,code:Du,def:Uu,fences:Fu,heading:Bu,hr:gr,html:Vu,lheading:jl,list:Hu,newline:Pu,paragraph:Sl,table:cr,text:qu},Mo=je("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gr).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",Gr).getRegex(),Ju={...qs,lheading:zu,table:Mo,paragraph:je(Fs).replace("hr",gr).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Mo).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",Gr).getRegex()},Zu={...qs,html:je(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zs).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:cr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:je(Fs).replace("hr",gr).replace("heading",` *#{1,6} *[^
6
6
  ]`).replace("lheading",jl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Xu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Yu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Rl=/^( {2,}|\\)\n(?!\s*$)/,$u=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ei=/[\p{P}\p{S}]/u,Us=/[\s\p{P}\p{S}]/u,Il=/[^\s\p{P}\p{S}]/u,Ku=je(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Us).getRegex(),Ml=/(?!~)[\p{P}\p{S}]/u,Qu=/(?!~)[\s\p{P}\p{S}]/u,Gu=/(?:[^\s\p{P}\p{S}]|~)/u,ef=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Cl=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,tf=je(Cl,"u").replace(/punct/g,ei).getRegex(),nf=je(Cl,"u").replace(/punct/g,Ml).getRegex(),Ll="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",rf=je(Ll,"gu").replace(/notPunctSpace/g,Il).replace(/punctSpace/g,Us).replace(/punct/g,ei).getRegex(),sf=je(Ll,"gu").replace(/notPunctSpace/g,Gu).replace(/punctSpace/g,Qu).replace(/punct/g,Ml).getRegex(),of=je("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Il).replace(/punctSpace/g,Us).replace(/punct/g,ei).getRegex(),af=je(/\\(punct)/,"gu").replace(/punct/g,ei).getRegex(),lf=je(/^<(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(),cf=je(zs).replace("(?:-->|$)","-->").getRegex(),uf=je("^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",cf).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Zr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ff=je(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Zr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Pl=je(/^!?\[(label)\]\[(ref)\]/).replace("label",Zr).replace("ref",Bs).getRegex(),Dl=je(/^!?\[(ref)\](?:\[\])?/).replace("ref",Bs).getRegex(),df=je("reflink|nolink(?!\\()","g").replace("reflink",Pl).replace("nolink",Dl).getRegex(),Hs={_backpedal:cr,anyPunctuation:af,autolink:lf,blockSkip:ef,br:Rl,code:Yu,del:cr,emStrongLDelim:tf,emStrongRDelimAst:rf,emStrongRDelimUnd:of,escape:Xu,link:ff,nolink:Dl,punctuation:Ku,reflink:Pl,reflinkSearch:df,tag:uf,text:$u,url:cr},pf={...Hs,link:je(/^!?\[(label)\]\((.*?)\)/).replace("label",Zr).getRegex(),reflink:je(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Zr).getRegex()},xs={...Hs,emStrongRDelimAst:sf,emStrongLDelim:nf,url:je(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},hf={...xs,br:je(Rl).replace("{2,}","*").getRegex(),text:je(xs.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Pr={normal:qs,gfm:Ju,pedantic:Zu},rr={normal:Hs,gfm:xs,breaks:hf,pedantic:pf},mf={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Co=e=>mf[e];function Ft(e,t){if(t){if(lt.escapeTest.test(e))return e.replace(lt.escapeReplace,Co)}else if(lt.escapeTestNoEncode.test(e))return e.replace(lt.escapeReplaceNoEncode,Co);return e}function Lo(e){try{e=encodeURI(e).replace(lt.percentDecode,"%")}catch{return null}return e}function Po(e,t){var s;const n=e.replace(lt.findPipe,(o,a,l)=>{let c=!1,d=a;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),i=n.split(lt.splitPipe);let r=0;if(i[0].trim()||i.shift(),i.length>0&&!((s=i.at(-1))!=null&&s.trim())&&i.pop(),t)if(i.length>t)i.splice(t);else for(;i.length<t;)i.push("");for(;r<i.length;r++)i[r]=i[r].trim().replace(lt.slashPipe,"|");return i}function ir(e,t,n){const i=e.length;if(i===0)return"";let r=0;for(;r<i&&e.charAt(i-r-1)===t;)r++;return e.slice(0,i-r)}function gf(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let i=0;i<e.length;i++)if(e[i]==="\\")i++;else if(e[i]===t[0])n++;else if(e[i]===t[1]&&(n--,n<0))return i;return n>0?-2:-1}function Do(e,t,n,i,r){const s=t.href,o=t.title||null,a=e[1].replace(r.other.outputLinkReplace,"$1");i.state.inLink=!0;const l={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:a,tokens:i.inlineTokens(a)};return i.state.inLink=!1,l}function yf(e,t,n){const i=e.match(n.other.indentCodeCompensation);if(i===null)return t;const r=i[1];return t.split(`
@@ -144,12 +144,12 @@ https://github.com/highlightjs/highlight.js/issues/2277`),Je=W,Se=fe),ue===void
144
144
  ${r.description}`.trim():r.description=s);const o=this.extractExamples(t.comment);return o!==null&&(r.examples=o),r}extractDescription(t){return!t||(t==null?void 0:t.length)<1||(t=t.replace(new RegExp(`\\s{0,15}${Wa}\\s{0,15}(.+)`,"ig"),"").replace(new RegExp(`\\s{0,15}${Ja}\\s{0,15}(.+)`,"ig"),"").replace(new RegExp(`\\s{0,15}${kd}\\s{0,15}(.+)`,"ig"),"").replace(new RegExp(`\\s{0,15}${Va}`,"ig"),"").replace(/\s{0,15}@Required/gi,"").replace(/\s{0,15}@Pattern\s{0,15}[^\r\n]{1,200}/gi,"").replace(/\s{0,15}@(Min|Max|Minimum|Maximum|ExclusiveMinimum|ExclusiveMaximum|MultipleOf|MaxLength|MinLength|MaxItems|MinItems)\s{0,15}[\d.]{1,20}/gi,"").trim(),t.length<1)?null:t}extractExamples(t){if(!t)return null;const n=[];let i;const r=new RegExp(`\\s*${Wa}\\s(.+)$`,"i");for(const s of t.split(`
145
145
  `))(i=r.exec(s))!==null&&n.push(Xa(i[1].trim()));return n.length<1?null:n}addValidatorFromCommentAnnotations(t,n){if(n===null||(n==null?void 0:n.length)<1)return;const i=/@Min\s([+-]?\d+(\.\d+)?)/i,r=/@Max\s([+-]?\d+(\.\d+)?)/i,s=/@Pattern\s([^\n]+)/i,o=new Map([["minimum",/@Minimum\s([+-]?\d+(\.\d+)?)/i],["maximum",/@Maximum\s([+-]?\d+(\.\d+)?)/i],["exclusiveMinimum",/@ExclusiveMinimum\s([+-]?\d+(\.\d+)?)/i],["exclusiveMaximum",/@ExclusiveMaximum\s([+-]?\d+(\.\d+)?)/i],["multipleOf",/@MultipleOf\s(\d+(\.\d+)?)/i],["maxLength",/@MaxLength\s(\d+)/i],["minLength",/@MinLength\s(\d+)/i]]);let a;(a=i.exec(n))!==null&&(t.minimum=parseFloat(a[1])),(a=r.exec(n))!==null&&(t.maximum=parseFloat(a[1])),(a=s.exec(n))!==null&&(t.pattern=a[1].trim());for(const l of o.entries())(a=l[1].exec(n))!==null&&(t[l[0]]=parseFloat(a[1]))}addDefaultFromCommentAnnotations(t,n){if(n===null||(n==null?void 0:n.length)<1)return;const i=new RegExp(`\\s*${Ja}\\s(.+)$`,"i");let r;(r=i.exec(n))!==null&&(t.default=Xa(r[1]))}}function so(e){return new Ad(e).compile()}function Xa(e){if(e.charAt(0)==="{")try{const t=JSON.parse(e);if(t)return t}catch{}return e}function Td(e){if(typeof e!="string")return["Protobuf schema must be a string of .proto source"];try{return so(e),[]}catch(t){return[t instanceof Error?t.message:"Failed to parse protobuf schema"]}}const Nd="x-parser-original-payload",mr="x-lib-conversion-error",jd=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,Sd=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function xr(e){return typeof e=="string"&&jd.test(e)}function br(e){return typeof e=="string"&&Sd.test(e)}function nc(e){return ge(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function rc(e){var t,n;if(typeof e!="string")return null;if(xr(e)){const i=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return i?`avro ${i}`:"avro"}if(br(e)){const i=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return i?`protobuf ${i}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function ic(e){return xr(e)?"Avro":br(e)?"Protobuf":null}function Rd(e,t){return t?!1:!e||xr(e)||br(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Id=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Md=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Cd(e){return typeof e=="string"||Array.isArray(e)?!0:ge(e)?typeof e.type=="string"&&Md.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Id.some(t=>t in e):!1}function $r(e,t){let n=e;if(t&&ge(n)&&typeof n.$ref=="string"){const o=t(n.$ref);o!==void 0&&(n=o)}const i=Ld(n),r=i.schema.description;if(typeof r=="string")return{...i,description:r};const s=nc(n)?n.description:void 0;return typeof s=="string"?{...i,description:s}:i}function Ld(e){var o;if(!nc(e))return{schema:Zt(e)??e};const{schemaFormat:t}=e,n=e.schema,i=e[Nd],r=(o=Zt(n))==null?void 0:o[mr];if(typeof r=="string")return{schema:Zt(i)??{},schemaFormat:t,originalSchema:i,conversionError:r};if(i!==void 0)return{schema:Zt(n)??{},schemaFormat:t,originalSchema:i};if(xr(t)&&Cd(n)){const a=Xs(n);if(a.length>0)return{schema:Zt(n)??{},schemaFormat:t,originalSchema:n,conversionError:a[0]};try{return{schema:ks(n),schemaFormat:t,originalSchema:n}}catch(l){return{schema:Zt(n)??{},schemaFormat:t,originalSchema:n,conversionError:l instanceof Error?l.message:"Failed to convert Avro schema"}}}if(br(t)&&typeof n=="string")try{return{schema:so(n),schemaFormat:t,originalSchema:n}}catch(a){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:a instanceof Error?a.message:"Failed to convert Protobuf schema"}}const s=Zt(n);return s?{schema:s,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const Ya=new Set,oo=e=>e.replace(/^#\//,"").split("/").pop()??e,As=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Pd={objects:new Set,refs:new Set},Xt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:As(e)};const i=e.$ref,r=oo(i);if(n.has(i))return{schema:e,refLabel:r,circular:!0};const s=Zt(t(i));if(!s)return{schema:e,refLabel:r};const{schema:o}=$r(s);n.add(i);try{const a=Xt(o,t,n);return{schema:a.schema,refLabel:a.circular?void 0:r,circular:a.circular}}finally{n.delete(i)}},xn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return ge(n)?n:null},sc=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(i=>ge(i));return n.length>0?n:null},Dd=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ge(e.additionalItems)?e.additionalItems:null,Fd=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ge(e.contains)?e.contains:null,oc=e=>e.contains!==void 0,Kr=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
146
146
 
147
- ${t}`:t},Bd=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),rn=(e,t,n,i)=>{if(e===t)return e;const r={...e};if(t.description&&(r.description=Kr(typeof r.description=="string"?r.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(r.required=Array.from(new Set([...r.required??[],...t.required]))),t.properties){r.properties={...r.properties??{}};for(const[s,o]of Object.entries(t.properties)){if(!ge(o))continue;const a=r.properties[s];ge(a)?r.properties[s]=rn(a,o):r.properties[s]=o}}if(t.items)if(Array.isArray(t.items))Array.isArray(r.items)?r.items=t.items.map((s,o)=>{const a=r.items[o];return ge(s)&&ge(a)?rn(a,s):ge(s)?s:a}):r.items=t.items;else{const s=xn(t),o=xn(r);s&&o?r.items=rn(o,s):s&&(r.items=t.items)}if(t.patternProperties&&ge(t.patternProperties)){const s={...ge(r.patternProperties)?r.patternProperties:{}};for(const[o,a]of Object.entries(t.patternProperties)){if(!ge(a)){s[o]=a;continue}const l=s[o];ge(l)?s[o]=rn(l,a):s[o]=a}r.patternProperties=s}if(t.propertyNames!==void 0)if(ge(t.propertyNames)){const s=r.propertyNames;r.propertyNames=ge(s)?rn(s,t.propertyNames):t.propertyNames}else r.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ge(t.additionalProperties)){const s=r.additionalProperties;r.additionalProperties=ge(s)?rn(s,t.additionalProperties):t.additionalProperties}else r.additionalProperties=t.additionalProperties;for(const[s,o]of Object.entries(t))Bd.has(s)||o===void 0||(r[s]=o);return r},$a=(e,t,n,i)=>{const r={...e};delete r.allOf,r.properties&&(r.properties=Object.fromEntries(Object.entries(r.properties).map(([c,d])=>ge(d)?[c,at(d,t,n,i)]:[c,d])));const s=xn(r);s&&(r.items=at(s,t,n,i));const o=_r(r);o!==null&&ge(o)&&(r.propertyNames=at(o,t,n,i));const a=Un(r);a!==null&&ge(a)&&(r.additionalProperties=at(a,t,n,i));const l=ao(r);return l.length>0&&(r.patternProperties=Object.fromEntries(l.map(([c,d])=>[c,at(d,t,n,i)]))),r},at=(e,t,n,i=new Set)=>{if(i.has(e))return e;i.add(e);try{const r=e.allOf;if(Array.isArray(r)&&r.length>0){const s=[];let o={};for(const d of r){if(!ge(d))continue;const{schema:f,circular:p}=Xt(d,t,n);if(p)continue;const h=at(f,t,n,i);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),s.push(g)}s.push(...cc(h)),o=rn(o,h,t,n)}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),s.push(d)}const a={...e};delete a.allOf;const l=Object.keys(a).length>0?rn(o,a,t,n):o,c=$a(l,t,n,i);if(s.length===1){const d=s[0];c.if=d.if,d.then!==void 0&&(c.then=d.then),d.else!==void 0&&(c.else=d.else)}else s.length>1&&(c._allOfConditionals=s);return c}return $a(e,t,n,i)}finally{i.delete(e)}},vr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(i=>ge(i));return n.length>0?n:null},wr=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(i=>ge(i));return n.length>0?n:null},ac=e=>e.not===void 0?null:typeof e.not=="boolean"||ge(e.not)?e.not:null,ft=e=>ac(e)!==null,lc=e=>{const{not:t,...n}=e;return n},zd=e=>{const{if:t,then:n,else:i,...r}=e;return r},ht=e=>e.if!==void 0,ps=e=>e===void 0?null:typeof e=="boolean"||ge(e)?e:null,cc=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ge(t)):[],mt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,_r=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ge(e.propertyNames)?e.propertyNames:null,Un=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ge(e.additionalProperties)?e.additionalProperties:null,ao=e=>{const t=e.patternProperties;return ge(t)?Object.entries(t).flatMap(([n,i])=>ge(i)?[[n,i]]:[]):[]},qd=(e,t)=>`${e}.[pattern:${t}]`,Er=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,ni=e=>{const t=_r(e);if(t!==null&&ge(t))return!0;const n=Un(e);return n!==null&&ge(n)?!0:ao(e).length>0},uc=e=>!!(vr(e)||wr(e)||Er(e)||ni(e)||e.type==="array"||e.items||e.type!==void 0),jt=e=>!(ft(e)||ht(e)||mt(e)||vr(e)||wr(e)||Er(e)||ni(e)||e.items||oc(e)||e.type==="array"||e.type==="object");function Ud(e){if(typeof Un(e)=="boolean")return!0;const n=_r(e);return!!(typeof n=="boolean"||n!==null&&ge(n)&&jt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function Ka(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||Ud(e)}const fc=(e,t)=>Ka(e)?!0:t?Ka(t):!1,Hd=(e,t)=>{if(ft(e)||ht(e)||mt(e)||vr(e)||wr(e)||Er(e)||ni(e))return!0;if(e.type==="array"||e.items){if(oc(e)||sc(e)!==null)return!0;const n=xn(e);if(!n)return!1;if(n.$ref&&t){const{schema:i}=Xt(n,t,Ya),r=at(i,t,Ya);return!jt(r)}return!jt(n)}return!1};function dc(e){return JSON.stringify(e)}function Qa(e){return typeof e=="string"?e:JSON.stringify(e)}function gt({children:e}){return u.jsx("span",{className:"text-xs text-gray-500",children:e})}function pc({children:e,mono:t=!1,title:n}){return u.jsx("span",{className:"inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600",title:n,children:t?u.jsx("span",{className:"font-mono text-gray-700",children:e}):e})}function Vd(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Wd(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Jd(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Zd(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function Ga(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function el(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function Br({name:e,lower:t,upper:n,suffix:i}){return!t&&!n?null:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{children:String(t.value)}),u.jsx(gt,{children:t.op})]}),u.jsx(gt,{children:e}),n&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{children:n.op}),u.jsx(gt,{children:String(n.value)})]}),i&&u.jsx(gt,{children:i})]})}function Jr({value:e,displayValue:t}){const n=()=>{var s;(s=window.getSelection())!=null&&s.toString()||navigator.clipboard.writeText(Qa(e))},i=r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),navigator.clipboard.writeText(Qa(e)))};return u.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-gray-100 px-2 py-1 font-mono text-xs font-medium text-gray-700 hover:bg-gray-200",title:"Click to copy",onClick:n,onKeyDown:i,children:t??dc(e)})}function Xd({schema:e}){const t=Un(e);return typeof t!="boolean"?null:u.jsx(gt,{children:t?"additional properties allowed":"additional properties not allowed"})}function Yd({schema:e}){const t=_r(e);return typeof t=="boolean"?u.jsx(pc,{children:t?"any property name":"no property names"}):t!==null&&ge(t)&&jt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"property name pattern:"}),u.jsx(Jr,{value:t.pattern,displayValue:t.pattern})]}):null}function tl({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,i=Vd(e),r=Wd(e),s=Jd(e),o=Zd(e),a=Ga(e,"minItems"),l=el(e,"maxItems"),c=Ga(e,"minProperties"),d=el(e,"maxProperties");return u.jsxs(u.Fragment,{children:[typeof e.multipleOf=="number"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"multiple of :"}),u.jsx(pc,{children:String(e.multipleOf)})]}),(i||r)&&u.jsx(Br,{name:t,lower:i,upper:r}),(s||o)&&u.jsx(Br,{name:t,lower:s,upper:o,suffix:"chars"}),(a||l)&&u.jsx(Br,{name:t,lower:a,upper:l,suffix:"items"}),(c||d)&&u.jsx(Br,{name:t,lower:c,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"regex pattern:"}),u.jsx(Jr,{value:e.pattern,displayValue:e.pattern})]}),n&&u.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[u.jsx(gt,{children:"enum values:"}),n.map((f,p)=>u.jsx(Jr,{value:f},`${p}-${dc(f)}`))]}),e.const!==void 0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"const value:"}),u.jsx(Jr,{value:e.const})]}),e.uniqueItems===!0&&u.jsx(gt,{children:"unique"}),u.jsx(Xd,{schema:e}),u.jsx(Yd,{schema:e})]})}function hc({schema:e,itemSchema:t,fieldName:n,className:i="flex flex-col gap-1"}){const r=t!=null&&jt(t),s=n??"value";return u.jsxs("div",{className:i,children:[u.jsx(tl,{schema:e,rangeName:s}),r&&u.jsx(tl,{schema:t,rangeName:"item"})]})}const mc=(e,t)=>{const n=vr(e);if(n)return{text:`one of (${n.length})`};const i=wr(e);if(i)return{text:`any of (${i.length})`};if(ft(e)&&!uc(lc(e)))return{text:"not"};if(e.type==="array"||e.items){const c=xn(e);if(c){const d=c.type;if(d==="object"){const f=c.$ref?oo(c.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof c.format=="string"?c.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const r=Array.isArray(e.type)?e.type.join(" | "):e.type;let s=r?`${r}`:"type: unknown";const o=Un(e);!Er(e)&&o!==null&&ge(o)&&(r==="object"||s==="type: unknown")&&(s=r==="object"?"object (map)":"map");const a=typeof e.format=="string"?e.format:void 0,l=t&&(r==="object"||s.startsWith("object"))?t:void 0;return{text:s,format:a,refHint:l}},$d=(e,t)=>{if(!t)return!1;const n=mc(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function gc({schema:e,refLabel:t,className:n="text-xs text-gray-500"}){const{text:i,format:r,refHint:s}=mc(e,t);return u.jsxs("span",{className:n,children:[r??i,s&&!i.includes(`(${s})`)&&u.jsxs("span",{className:"text-gray-400",children:[" (",s,")"]})]})}const nl="ml-6";function zr({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return u.jsxs("div",{className:`py-2 ${t?"border-b border-gray-200 last:border-b-0":""}`,children:[u.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[u.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),u.jsx(gc,{schema:e})]}),fc(e)&&u.jsx(hc,{schema:e,className:`flex flex-col gap-1 mt-1 ${nl}`}),n&&n.split(`
147
+ ${t}`:t},Bd=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),rn=(e,t,n,i)=>{if(e===t)return e;const r={...e};if(t.description&&(r.description=Kr(typeof r.description=="string"?r.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(r.required=Array.from(new Set([...r.required??[],...t.required]))),t.properties){r.properties={...r.properties??{}};for(const[s,o]of Object.entries(t.properties)){if(!ge(o))continue;const a=r.properties[s];ge(a)?r.properties[s]=rn(a,o):r.properties[s]=o}}if(t.items)if(Array.isArray(t.items))Array.isArray(r.items)?r.items=t.items.map((s,o)=>{const a=r.items[o];return ge(s)&&ge(a)?rn(a,s):ge(s)?s:a}):r.items=t.items;else{const s=xn(t),o=xn(r);s&&o?r.items=rn(o,s):s&&(r.items=t.items)}if(t.patternProperties&&ge(t.patternProperties)){const s={...ge(r.patternProperties)?r.patternProperties:{}};for(const[o,a]of Object.entries(t.patternProperties)){if(!ge(a)){s[o]=a;continue}const l=s[o];ge(l)?s[o]=rn(l,a):s[o]=a}r.patternProperties=s}if(t.propertyNames!==void 0)if(ge(t.propertyNames)){const s=r.propertyNames;r.propertyNames=ge(s)?rn(s,t.propertyNames):t.propertyNames}else r.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ge(t.additionalProperties)){const s=r.additionalProperties;r.additionalProperties=ge(s)?rn(s,t.additionalProperties):t.additionalProperties}else r.additionalProperties=t.additionalProperties;for(const[s,o]of Object.entries(t))Bd.has(s)||o===void 0||(r[s]=o);return r},$a=(e,t,n,i)=>{const r={...e};delete r.allOf,r.properties&&(r.properties=Object.fromEntries(Object.entries(r.properties).map(([c,d])=>ge(d)?[c,at(d,t,n,i)]:[c,d])));const s=xn(r);s&&(r.items=at(s,t,n,i));const o=_r(r);o!==null&&ge(o)&&(r.propertyNames=at(o,t,n,i));const a=Un(r);a!==null&&ge(a)&&(r.additionalProperties=at(a,t,n,i));const l=ao(r);return l.length>0&&(r.patternProperties=Object.fromEntries(l.map(([c,d])=>[c,at(d,t,n,i)]))),r},at=(e,t,n,i=new Set)=>{if(i.has(e))return e;i.add(e);try{const r=e.allOf;if(Array.isArray(r)&&r.length>0){const s=[];let o={};for(const d of r){if(!ge(d))continue;const{schema:f,circular:p}=Xt(d,t,n);if(p)continue;const h=at(f,t,n,i);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),s.push(g)}s.push(...cc(h)),o=rn(o,h,t,n)}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),s.push(d)}const a={...e};delete a.allOf;const l=Object.keys(a).length>0?rn(o,a,t,n):o,c=$a(l,t,n,i);if(s.length===1){const d=s[0];c.if=d.if,d.then!==void 0&&(c.then=d.then),d.else!==void 0&&(c.else=d.else)}else s.length>1&&(c._allOfConditionals=s);return c}return $a(e,t,n,i)}finally{i.delete(e)}},vr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(i=>ge(i));return n.length>0?n:null},wr=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(i=>ge(i));return n.length>0?n:null},ac=e=>e.not===void 0?null:typeof e.not=="boolean"||ge(e.not)?e.not:null,ft=e=>ac(e)!==null,lc=e=>{const{not:t,...n}=e;return n},zd=e=>{const{if:t,then:n,else:i,...r}=e;return r},ht=e=>e.if!==void 0,ps=e=>e===void 0?null:typeof e=="boolean"||ge(e)?e:null,cc=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ge(t)):[],mt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,_r=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ge(e.propertyNames)?e.propertyNames:null,Un=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ge(e.additionalProperties)?e.additionalProperties:null,ao=e=>{const t=e.patternProperties;return ge(t)?Object.entries(t).flatMap(([n,i])=>ge(i)?[[n,i]]:[]):[]},qd=(e,t)=>`${e}.[pattern:${t}]`,Er=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,ni=e=>{const t=_r(e);if(t!==null&&ge(t))return!0;const n=Un(e);return n!==null&&ge(n)?!0:ao(e).length>0},uc=e=>!!(vr(e)||wr(e)||Er(e)||ni(e)||e.type==="array"||e.items||e.type!==void 0),jt=e=>!(ft(e)||ht(e)||mt(e)||vr(e)||wr(e)||Er(e)||ni(e)||e.items||oc(e)||e.type==="array"||e.type==="object");function Ud(e){if(typeof Un(e)=="boolean")return!0;const n=_r(e);return!!(typeof n=="boolean"||n!==null&&ge(n)&&jt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function Ka(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||Ud(e)}const fc=(e,t)=>Ka(e)?!0:t?Ka(t):!1,Hd=(e,t)=>{if(ft(e)||ht(e)||mt(e)||vr(e)||wr(e)||Er(e)||ni(e))return!0;if(e.type==="array"||e.items){if(oc(e)||sc(e)!==null)return!0;const n=xn(e);if(!n)return!1;if(n.$ref&&t){const{schema:i}=Xt(n,t,Ya),r=at(i,t,Ya);return!jt(r)}return!jt(n)}return!1};function dc(e){return JSON.stringify(e)}function Qa(e){return typeof e=="string"?e:JSON.stringify(e)}function gt({children:e}){return u.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function pc({children:e,mono:t=!1,title:n}){return u.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:n,children:t?u.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function Vd(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Wd(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Jd(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function Zd(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function Ga(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function el(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function Br({name:e,lower:t,upper:n,suffix:i}){return!t&&!n?null:u.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{children:String(t.value)}),u.jsx(gt,{children:t.op})]}),u.jsx(gt,{children:e}),n&&u.jsxs(u.Fragment,{children:[u.jsx(gt,{children:n.op}),u.jsx(gt,{children:String(n.value)})]}),i&&u.jsx(gt,{children:i})]})}function Jr({value:e,displayValue:t}){const n=()=>{var s;(s=window.getSelection())!=null&&s.toString()||navigator.clipboard.writeText(Qa(e))},i=r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),navigator.clipboard.writeText(Qa(e)))};return u.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:n,onKeyDown:i,children:t??dc(e)})}function Xd({schema:e}){const t=Un(e);return typeof t!="boolean"?null:u.jsx(gt,{children:t?"additional properties allowed":"additional properties not allowed"})}function Yd({schema:e}){const t=_r(e);return typeof t=="boolean"?u.jsx(pc,{children:t?"any property name":"no property names"}):t!==null&&ge(t)&&jt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"property name pattern:"}),u.jsx(Jr,{value:t.pattern,displayValue:t.pattern})]}):null}function tl({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,i=Vd(e),r=Wd(e),s=Jd(e),o=Zd(e),a=Ga(e,"minItems"),l=el(e,"maxItems"),c=Ga(e,"minProperties"),d=el(e,"maxProperties");return u.jsxs(u.Fragment,{children:[typeof e.multipleOf=="number"&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"multiple of :"}),u.jsx(pc,{children:String(e.multipleOf)})]}),(i||r)&&u.jsx(Br,{name:t,lower:i,upper:r}),(s||o)&&u.jsx(Br,{name:t,lower:s,upper:o,suffix:"chars"}),(a||l)&&u.jsx(Br,{name:t,lower:a,upper:l,suffix:"items"}),(c||d)&&u.jsx(Br,{name:t,lower:c,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"regex pattern:"}),u.jsx(Jr,{value:e.pattern,displayValue:e.pattern})]}),n&&u.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[u.jsx(gt,{children:"enum values:"}),n.map((f,p)=>u.jsx(Jr,{value:f},`${p}-${dc(f)}`))]}),e.const!==void 0&&u.jsxs("span",{className:"inline-flex items-center gap-1",children:[u.jsx(gt,{children:"const value:"}),u.jsx(Jr,{value:e.const})]}),e.uniqueItems===!0&&u.jsx(gt,{children:"unique"}),u.jsx(Xd,{schema:e}),u.jsx(Yd,{schema:e})]})}function hc({schema:e,itemSchema:t,fieldName:n,className:i="flex flex-col gap-1"}){const r=t!=null&&jt(t),s=n??"value";return u.jsxs("div",{className:i,children:[u.jsx(tl,{schema:e,rangeName:s}),r&&u.jsx(tl,{schema:t,rangeName:"item"})]})}const mc=(e,t)=>{const n=vr(e);if(n)return{text:`one of (${n.length})`};const i=wr(e);if(i)return{text:`any of (${i.length})`};if(ft(e)&&!uc(lc(e)))return{text:"not"};if(e.type==="array"||e.items){const c=xn(e);if(c){const d=c.type;if(d==="object"){const f=c.$ref?oo(c.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof c.format=="string"?c.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const r=Array.isArray(e.type)?e.type.join(" | "):e.type;let s=r?`${r}`:"type: unknown";const o=Un(e);!Er(e)&&o!==null&&ge(o)&&(r==="object"||s==="type: unknown")&&(s=r==="object"?"object (map)":"map");const a=typeof e.format=="string"?e.format:void 0,l=t&&(r==="object"||s.startsWith("object"))?t:void 0;return{text:s,format:a,refHint:l}},$d=(e,t)=>{if(!t)return!1;const n=mc(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function gc({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:i,format:r,refHint:s}=mc(e,t);return u.jsxs("span",{className:n,children:[r??i,s&&!i.includes(`(${s})`)&&u.jsxs("span",{className:"text-foreground-muted",children:[" (",s,")"]})]})}const nl="ml-6";function zr({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return u.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[u.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[u.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),u.jsx(gc,{schema:e})]}),fc(e)&&u.jsx(hc,{schema:e,className:`flex flex-col gap-1 mt-1 ${nl}`}),n&&n.split(`
148
148
 
149
- `).map((i,r)=>u.jsx("p",{className:`text-xs text-gray-500 mt-1 ${nl} leading-relaxed`,children:i},r))]})}function hs({children:e}){return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-gray-700 border border-gray-300 rounded-md bg-white",children:"Should Not match:"}),u.jsx("div",{className:"w-px h-3 bg-gray-300 ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Kd({value:e}){const t=e?"any value":"false schema";return u.jsx("span",{className:"inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600",children:t})}function yc({tabs:e,selected:t,onChange:n,ariaLabel:i}){return u.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-gray-100 rounded-md border border-gray-200",role:"tablist","aria-label":i,children:e.map(({id:r,label:s})=>{const o=r===t;return u.jsx("button",{type:"button",role:"tab","aria-selected":o,onClick:()=>n(r),className:o?"px-3 py-1 text-xs font-semibold text-gray-900 bg-white rounded-md shadow-sm border border-gray-200":"px-3 py-1 text-xs font-medium text-gray-400 hover:text-gray-600 rounded-md",children:s},r)})})}function Qd({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:i,onSelectCase:r,children:s}){if(t===0)return null;const o=(n==null?void 0:n.length)===t?n:Array.from({length:t},(c,d)=>`case ${d+1}`),a=e==="anyOf"?"Any of:":"One of:",l=e==="anyOf"?"Any of cases":"One of cases";return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-gray-700 border border-gray-300 rounded-md bg-white",children:a}),u.jsx("div",{className:"w-px h-3 bg-gray-300 ml-[1.125rem]","aria-hidden":"true"})]}),u.jsx(yc,{tabs:o.map((c,d)=>({id:String(d),label:c})),selected:String(i),onChange:c=>r(Number(c)),ariaLabel:l}),u.jsx("div",{role:"tabpanel",className:"mt-2",children:s})]})}const Gd="ml-0 border-dashed border-gray-300";function mn({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:i}=zt();return n==="none"?u.jsx("div",{children:t}):n==="muted"?u.jsx("div",{className:`pl-3 border-l-2 ${Gd}`,children:t}):u.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Ms(e,i)},children:t})}function ep({depth:e,expanded:t,onToggle:n}){const{depthColors:i}=zt(),r=Ms(e,i);return u.jsxs("button",{type:"button",onClick:n,"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:[u.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-gray-50",style:{borderColor:r,color:r},children:t?"−":"+"}),!t&&u.jsx("span",{className:"text-xs text-gray-500",children:"Show details"})]})}const tp="ml-6";function ct({path:e,depth:t,schema:n,refLabel:i,itemSchema:r,typeLabelOverride:s,required:o,description:a,expandable:l,expanded:c,onToggle:d,showBorder:f=!0}){const{depthColors:p}=zt(),h=Ms(t,p),g=n&&$d(n,i),_=l?tp:"";let k="",y=e;if(e.endsWith("[]")){const x=e.slice(0,-2),w=x.lastIndexOf(".");w>=0?(k=x.slice(0,w+1),y=`${x.slice(w+1)}[]`):y=e}else{const x=e.lastIndexOf("."),w=e.lastIndexOf("[]"),E=Math.max(x,w);E>=0&&(k=e.slice(0,E+(e[E]==="."?1:2)),y=e.slice(E+(e[E]==="."?1:2)))}return f=f&&!c,u.jsxs("div",{className:`py-2 ${f?"border-b border-gray-200 last:border-b-0":""}`,children:[u.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[u.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[u.jsxs("span",{className:"truncate min-w-0",children:[k&&u.jsx("span",{className:"text-gray-400",children:k}),u.jsx("span",{className:"font-semibold",style:{color:h},children:y})]}),o&&u.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(n==null?void 0:n.readOnly)===!0&&u.jsx("span",{className:"shrink-0 text-gray-500 ml-2 text-[10px]",children:"readOnly"}),(n==null?void 0:n.writeOnly)===!0&&u.jsx("span",{className:"shrink-0 text-gray-500 ml-2 text-[10px]",children:"writeOnly"}),(n==null?void 0:n.deprecated)===!0&&u.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),n?u.jsxs("div",{className:"shrink-0 text-right",children:[u.jsx(gc,{schema:n,refLabel:i}),g&&u.jsxs("span",{className:"text-xs text-gray-400",children:[" (ref: ",i,")"]})]}):s&&u.jsx("span",{className:"text-xs text-gray-500 shrink-0",children:s})]}),n&&fc(n,r)&&u.jsx(hc,{schema:n,itemSchema:r,fieldName:y,className:`flex flex-col gap-1 mt-1 ${_}`}),a&&a.split(`
149
+ `).map((i,r)=>u.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${nl} leading-relaxed`,children:i},r))]})}function hs({children:e}){return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.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:"}),u.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Kd({value:e}){const t=e?"any value":"false schema";return u.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 yc({tabs:e,selected:t,onChange:n,ariaLabel:i}){return u.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":i,children:e.map(({id:r,label:s})=>{const o=r===t;return u.jsx("button",{type:"button",role:"tab","aria-selected":o,onClick:()=>n(r),className:o?"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:s},r)})})}function Qd({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:i,onSelectCase:r,children:s}){if(t===0)return null;const o=(n==null?void 0:n.length)===t?n:Array.from({length:t},(c,d)=>`case ${d+1}`),a=e==="anyOf"?"Any of:":"One of:",l=e==="anyOf"?"Any of cases":"One of cases";return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.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:a}),u.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),u.jsx(yc,{tabs:o.map((c,d)=>({id:String(d),label:c})),selected:String(i),onChange:c=>r(Number(c)),ariaLabel:l}),u.jsx("div",{role:"tabpanel",className:"mt-2",children:s})]})}const Gd="ml-0 border-dashed border-border";function mn({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:i}=zt();return n==="none"?u.jsx("div",{children:t}):n==="muted"?u.jsx("div",{className:`pl-3 border-l-2 ${Gd}`,children:t}):u.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Ms(e,i)},children:t})}function ep({depth:e,expanded:t,onToggle:n}){const{depthColors:i}=zt(),r=Ms(e,i);return u.jsxs("button",{type:"button",onClick:n,"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:[u.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:r,color:r},children:t?"−":"+"}),!t&&u.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const tp="ml-6";function ct({path:e,depth:t,schema:n,refLabel:i,itemSchema:r,typeLabelOverride:s,required:o,description:a,expandable:l,expanded:c,onToggle:d,showBorder:f=!0}){const{depthColors:p}=zt(),h=Ms(t,p),g=n&&$d(n,i),_=l?tp:"";let k="",y=e;if(e.endsWith("[]")){const x=e.slice(0,-2),w=x.lastIndexOf(".");w>=0?(k=x.slice(0,w+1),y=`${x.slice(w+1)}[]`):y=e}else{const x=e.lastIndexOf("."),w=e.lastIndexOf("[]"),E=Math.max(x,w);E>=0&&(k=e.slice(0,E+(e[E]==="."?1:2)),y=e.slice(E+(e[E]==="."?1:2)))}return f=f&&!c,u.jsxs("div",{className:`py-2 ${f?"border-b border-border last:border-b-0":""}`,children:[u.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[u.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[u.jsxs("span",{className:"truncate min-w-0",children:[k&&u.jsx("span",{className:"text-foreground-muted",children:k}),u.jsx("span",{className:"font-semibold",style:{color:h},children:y})]}),o&&u.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(n==null?void 0:n.readOnly)===!0&&u.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(n==null?void 0:n.writeOnly)===!0&&u.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(n==null?void 0:n.deprecated)===!0&&u.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),n?u.jsxs("div",{className:"shrink-0 text-right",children:[u.jsx(gc,{schema:n,refLabel:i}),g&&u.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",i,")"]})]}):s&&u.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:s})]}),n&&fc(n,r)&&u.jsx(hc,{schema:n,itemSchema:r,fieldName:y,className:`flex flex-col gap-1 mt-1 ${_}`}),a&&a.split(`
150
150
 
151
- `).map((x,w)=>u.jsx("p",{className:`text-xs text-gray-500 mt-1 ${_} leading-relaxed`,children:x},w)),l&&u.jsx(ep,{depth:t,expanded:c,onToggle:d})]})}function ms({label:e,children:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:u.jsx("span",{className:"text-xs font-medium text-gray-700",children:e})}),u.jsx("div",{children:t})]})}function np({ifContent:e,thenContent:t,elseContent:n}){return u.jsxs("div",{className:"py-2 pt-5 px-1",children:[u.jsx("div",{className:"flex flex-col items-start",children:u.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-gray-700 border-2 border-dashed border-gray-300 rounded-md bg-white",children:"Conditions apply:"})}),u.jsx(mn,{depth:0,lineVariant:"muted",children:u.jsxs("div",{className:"divide-y divide-gray-100",children:[u.jsx(ms,{label:"If schema matches:",children:e}),t!=null&&u.jsx(ms,{label:"Then schema should follow:",children:t}),n!=null&&u.jsx(ms,{label:"Else schema should follow:",children:n})]})})]})}function qr({label:e,children:t}){return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-gray-700 border border-gray-300 rounded-md bg-white",children:e}),u.jsx("div",{className:"w-px h-3 bg-gray-300 ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const rp=e=>e==="none"?"depth":e;function Nt({schema:e,path:t,depth:n,required:i,refStack:r,deref:s,suppressRow:o=!1,branchLineVariant:a="depth",defaultExpanded:l=!1,ancestors:c=Pd}){const d=rp(a),[f,p]=ie.useState(l),[h,g]=ie.useState(l);h!==l&&(g(l),p(l));const[_,k]=ie.useState(0),{schema:y,refLabel:x,circular:w}=ie.useMemo(()=>{if(c.objects.has(e)||typeof e.$ref=="string"&&c.refs.has(e.$ref))return{schema:e,refLabel:As(e),circular:!0};const P=Xt(e,s,r);return P.circular?P:{...P,schema:at(P.schema,s,r)}},[e,s,r,c]),E=ie.useMemo(()=>({objects:new Set(c.objects).add(e),refs:typeof e.$ref=="string"?new Set(c.refs).add(e.$ref):c.refs}),[c,e]),j=lc(zd(y)),N=!uc(j)&&(ft(y)||ht(y)||mt(y)),R=()=>{const P=ac(y);if(P===null)return null;if(typeof P=="boolean")return u.jsx(hs,{children:u.jsx(Kd,{value:P})});const U=Xt(P,s,r);if(U.circular)return u.jsx(hs,{children:u.jsx(ct,{path:t,depth:n+1,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const B=at(U.schema,s,r),J=jt(B);return u.jsx(hs,{children:J?u.jsx(zr,{schema:B,showBorder:!1}):u.jsx(Nt,{schema:P,path:t,depth:n+1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:d,defaultExpanded:l})})},Z=(P,U)=>{if(typeof P=="boolean")return u.jsx("span",{className:"inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600",children:P?"any value":"false schema"});const B=Xt(P,s,r);if(B.circular)return u.jsx(ct,{path:U,depth:n+1,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const J=at(B.schema,s,r);return jt(J)?u.jsx(zr,{schema:J,showBorder:!1}):u.jsx(Nt,{schema:P,path:U,depth:n+1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l})},H=P=>{const U=ps(P.if);if(U===null)return null;const B=ps(P.then),J=ps(P.else);return u.jsx(np,{ifContent:Z(U,t),thenContent:B!==null?Z(B,t):void 0,elseContent:J!==null?Z(J,t):void 0})},K=()=>{const P=cc(y);return P.length===0?null:u.jsx(u.Fragment,{children:P.map((U,B)=>u.jsx("div",{children:H(U)},B))})};if(w)return u.jsx(ct,{path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??x??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(N){const P=u.jsxs(u.Fragment,{children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?P:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(U=>!U)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:P})]})}const Y=vr(j),pe=wr(j),S=Y??pe,O=Y?"oneOf":"anyOf";if(S){const P=S.map((we,qe)=>typeof we.title=="string"?we.title:`case ${qe+1}`),U=o?1:n+1,B=S[_],J=Xt(B,s,r),de=J.circular?J.schema:at(J.schema,s,r),xe=!J.circular&&jt(de)?u.jsx(zr,{schema:de,showBorder:!1}):u.jsx(Nt,{schema:B,path:t,depth:U-1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l},_),ve=u.jsx(Qd,{variant:O,caseCount:S.length,caseLabels:P,selectedCase:_,onSelectCase:k,children:xe}),ee=u.jsxs(u.Fragment,{children:[ve,ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?ee:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(we=>!we)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:ee})]})}const m=(P,U,B)=>{const J=Xt(P,s,r);if(J.circular)return u.jsx(ct,{path:U,depth:B,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const de=at(J.schema,s,r);return jt(de)?u.jsx(zr,{schema:de,showBorder:!1}):u.jsx(Nt,{schema:P,path:U,depth:B,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l})},M=P=>{const U=j.properties??{},B=new Set(j.required??[]),J=_r(j),de=Un(j),X=ao(j);return u.jsxs(u.Fragment,{children:[Object.entries(U).map(([xe,ve])=>ge(ve)?u.jsx(Nt,{schema:ve,path:`${t}.${xe}`,depth:P,required:B.has(xe),refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xe):null),J!==null&&ge(J)&&u.jsx(qr,{label:"Property names must adhere to:",children:m(J,`${t}.[propertyName]`,P)}),X.map(([xe,ve])=>u.jsx(Nt,{schema:ve,path:qd(t,xe),depth:P,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xe)),de!==null&&ge(de)&&u.jsx(qr,{label:"Additional properties must adhere to:",children:m(de,`${t}.[additionalProperty]`,P)}),ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]})};if(Er(j)||ni(j))return o?M(n+1):u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(P=>!P)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:M(n+1)})]});if(j.type==="array"||j.items){const P=sc(j),U=P!==null,B=U?Dd(j):null,J=Fd(j),de=J!==null,X=U?null:xn(j),xe=X!==null,ve=U||xe||de||ft(y)||ht(y)||mt(y),ee=`${t}[]`,we=xe?Xt(X,s,r):null,qe=(we==null?void 0:we.schema)??null,Fe=qe?at(qe,s,r):null,yt=qe!==null&&(E.objects.has(qe)||typeof(X==null?void 0:X.$ref)=="string"&&E.refs.has(X.$ref)),rt=qe!==null?{objects:new Set(E.objects).add(qe),refs:typeof(X==null?void 0:X.$ref)=="string"?new Set(E.refs).add(X.$ref):E.refs}:E,Kt=!U&&!de&&Fe!==null&&jt(Fe),Rt=Fe!=null&&Fe.properties?Object.entries(Fe.properties).filter(([,Ve])=>ge(Ve)):[],on=new Set(Fe&&Array.isArray(Fe.required)?Fe.required:[]),Ht=Ve=>u.jsxs(u.Fragment,{children:[U?u.jsxs(u.Fragment,{children:[P.map((Be,xt)=>u.jsx(Nt,{schema:Be,path:`${t}[${xt}]`,depth:Ve,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xt)),B!==null&&typeof B!="boolean"&&u.jsx(qr,{label:"Additional items:",children:m(B,`${t}[*]`,Ve)}),B===!1&&u.jsx("div",{className:"py-1 pl-6 text-xs text-gray-400",children:"no additional items allowed"})]}):xe&&(yt?u.jsx(ct,{path:ee,depth:Ve,typeLabelOverride:`↩ ${X.$ref??As(qe)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Rt.length>0?Rt.map(([Be,xt])=>u.jsx(Nt,{schema:xt,path:`${t}[].${Be}`,depth:Ve,required:on.has(Be),refStack:r,deref:s,ancestors:rt,branchLineVariant:d,defaultExpanded:l},Be)):u.jsx(Nt,{schema:X,path:ee,depth:Ve,refStack:r,deref:s,ancestors:rt,branchLineVariant:d,defaultExpanded:l})),de&&u.jsx(qr,{label:"Contains at least one:",children:typeof J=="boolean"?u.jsx("span",{className:"inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600",children:J?"any item":"impossible constraint"}):m(J,`${t}[contains]`,Ve)}),ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return Kt&&!ft(y)&&!ht(y)&&!mt(y)?u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:Kr(y.description,Fe.description),expandable:!1,expanded:!1,onToggle:()=>{}}):Kt?u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:Kr(y.description,Fe.description),expandable:!0,expanded:f,onToggle:()=>p(Ve=>!Ve)}),f&&u.jsxs(mn,{depth:n,lineVariant:a,children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]})]}):o?ve?Ht(n+1):null:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:y.description,expandable:U||xe||de||ft(y)||ht(y)||mt(y),expanded:f,onToggle:()=>p(Ve=>!Ve)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:Ht(n+1)})]})}if(ft(y)||ht(y)||mt(y)){const P=u.jsxs(u.Fragment,{children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?P:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(U=>!U)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:P})]})}return o?null:u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function lo({schema:e,rootName:t,className:n=""}){const{deref:i,defaultSchemaExpanded:r=!1}=zt(),s=ie.useMemo(()=>new Set,[]),o=Zt(e),a=ie.useMemo(()=>o?at(o,i,s):null,[o,i,s]);if(!o||!a)return u.jsx("p",{className:"text-xs text-gray-400 italic",children:"No schema details available."});const l=t??(o.$ref?oo(o.$ref):void 0)??"schema",c=!!t;if(!Hd(a,i)&&!o.$ref){if(c)return a.type==="array"||a.items?u.jsx("div",{className:n,children:u.jsx(Nt,{schema:o,path:l,depth:0,refStack:s,deref:i,defaultExpanded:r})}):null;const f=a.type==="array"||a.items?`${l}[]`:l,p=xn(a),h=p?at(p,i,s):null,g=h!==null&&jt(h);return u.jsx("div",{className:n,children:u.jsx(ct,{path:f,depth:0,schema:a,itemSchema:g?h:void 0,description:a.type==="array"||a.items?Kr(a.description,p==null?void 0:p.description):a.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return u.jsx("div",{className:n,children:u.jsx(Nt,{schema:o,path:l,depth:c?-1:0,refStack:s,deref:i,suppressRow:c,defaultExpanded:r})})}function ip(e){let t=e|0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function xc(e){let t=ip(e),n={next(){return t()},int(i,r){return i+Math.floor(n.next()*(r-i+1))},bool(i=.5){return n.next()<i},pick(i){return i[n.int(0,i.length-1)]},shuffle(i){let r=[...i];for(let s=r.length-1;s>0;s--){let o=n.int(0,s);[r[s],r[o]]=[r[o],r[s]]}return r},fork(){let i=Math.floor(n.next()*4294967296);return xc(i)}};return n}function sp(e){return null}function op(e){return e.random.bool()}function bc(e,t,n=!1){let i=-1e3,r=1e3,s=!1,o=!1;if(e.minimum!==void 0&&(i=e.minimum),e.maximum!==void 0&&(r=e.maximum),e.exclusiveMinimum!==void 0&&(i=e.exclusiveMinimum,s=!0),e.exclusiveMaximum!==void 0&&(r=e.exclusiveMaximum,o=!0),e.multipleOf!==void 0)return ap(e.multipleOf,i,r,s,o,t);if(n){let c=s?Math.floor(i)+1:Math.ceil(i),d=o?Math.ceil(r)-1:Math.floor(r);return t.random.int(c,d)}let a=s?i+Number.EPSILON:i,l=o?r-Number.EPSILON:r;return a+t.random.next()*(l-a)}function ap(e,t,n,i,r,s){let o=Math.ceil(t/e),a=Math.floor(n/e);return i&&o*e===t&&o++,r&&a*e===n&&a--,o>a?o*e:s.random.int(o,a)*e}function lp(e,t){if(e.autoIncrement){let n=e.initialOffset??1,i=cp(t.path),r=t.autoIncrementCounters??new Map,s=(r.get(i)??n-1)+1;return r.set(i,s),t.autoIncrementCounters&&t.autoIncrementCounters.set(i,s),s}return bc(e,t,!0)}function cp(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function rl(e,t){let n=vc(e,0);return lr(n.node,t)}function lr(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return up(e,t);case"sequence":return e.nodes.map(n=>lr(n,t)).join("");case"alternation":return lr(t.pick(e.branches),t);case"quantifier":{let n=t.int(e.min,Math.min(e.max,e.min+5));return Array.from({length:n},()=>lr(e.node,t)).join("")}case"group":return lr(e.node,t)}}function up(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),i=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(r=>!n.has(r));return i.length>0?t.pick(i):"a"}function vc(e,t){let n=[],i=[];for(;t<e.length;){let r=e[t];if(r===")")break;if(r==="|"){n.push(il(i)),i=[],t++;continue}if(r==="("){let a=t+1;if(e[a]==="?")if(e[a+1]===":")a+=2;else if(e[a+1]==="="||e[a+1]==="!"){let f=1,p=a;for(;p<e.length&&f>0;)p++,e[p]==="("&&f++,e[p]===")"&&f--;t=p+1;continue}else{for(a+=2;a<e.length&&e[a]!==">";)a++;a++}let l=vc(e,a),c={type:"group",node:l.node};t=l.pos+1;let d=or(e,t,c);i.push(d.node),t=d.pos;continue}if(r==="["){let a=dp(e,t),l=or(e,a.pos,a.node);i.push(l.node),t=l.pos;continue}if(r==="."){let a={type:"dot"};t++;let l=or(e,t,a);i.push(l.node),t=l.pos;continue}if(r==="^"||r==="$"){i.push({type:"anchor"}),t++;continue}if(r==="\\"){t++;let a=fp(e,t);t=a.pos;let l=or(e,t,a.node);i.push(l.node),t=l.pos;continue}let s={type:"literal",value:r};t++;let o=or(e,t,s);i.push(o.node),t=o.pos}return n.push(il(i)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function il(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function fp(e,t){let n=e[t];switch(t++,n){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:t};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:t};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:t};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:t};case"s":return{node:{type:"charClass",chars:[...`
151
+ `).map((x,w)=>u.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${_} leading-relaxed`,children:x},w)),l&&u.jsx(ep,{depth:t,expanded:c,onToggle:d})]})}function ms({label:e,children:t}){return u.jsxs("div",{children:[u.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:u.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),u.jsx("div",{children:t})]})}function np({ifContent:e,thenContent:t,elseContent:n}){return u.jsxs("div",{className:"py-2 pt-5 px-1",children:[u.jsx("div",{className:"flex flex-col items-start",children:u.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:"})}),u.jsx(mn,{depth:0,lineVariant:"muted",children:u.jsxs("div",{className:"divide-y divide-border",children:[u.jsx(ms,{label:"If schema matches:",children:e}),t!=null&&u.jsx(ms,{label:"Then schema should follow:",children:t}),n!=null&&u.jsx(ms,{label:"Else schema should follow:",children:n})]})})]})}function qr({label:e,children:t}){return u.jsxs("div",{className:"py-2",children:[u.jsxs("div",{className:"flex flex-col items-start",children:[u.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}),u.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const rp=e=>e==="none"?"depth":e;function Nt({schema:e,path:t,depth:n,required:i,refStack:r,deref:s,suppressRow:o=!1,branchLineVariant:a="depth",defaultExpanded:l=!1,ancestors:c=Pd}){const d=rp(a),[f,p]=ie.useState(l),[h,g]=ie.useState(l);h!==l&&(g(l),p(l));const[_,k]=ie.useState(0),{schema:y,refLabel:x,circular:w}=ie.useMemo(()=>{if(c.objects.has(e)||typeof e.$ref=="string"&&c.refs.has(e.$ref))return{schema:e,refLabel:As(e),circular:!0};const P=Xt(e,s,r);return P.circular?P:{...P,schema:at(P.schema,s,r)}},[e,s,r,c]),E=ie.useMemo(()=>({objects:new Set(c.objects).add(e),refs:typeof e.$ref=="string"?new Set(c.refs).add(e.$ref):c.refs}),[c,e]),j=lc(zd(y)),N=!uc(j)&&(ft(y)||ht(y)||mt(y)),R=()=>{const P=ac(y);if(P===null)return null;if(typeof P=="boolean")return u.jsx(hs,{children:u.jsx(Kd,{value:P})});const U=Xt(P,s,r);if(U.circular)return u.jsx(hs,{children:u.jsx(ct,{path:t,depth:n+1,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const B=at(U.schema,s,r),J=jt(B);return u.jsx(hs,{children:J?u.jsx(zr,{schema:B,showBorder:!1}):u.jsx(Nt,{schema:P,path:t,depth:n+1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:d,defaultExpanded:l})})},Z=(P,U)=>{if(typeof P=="boolean")return u.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:P?"any value":"false schema"});const B=Xt(P,s,r);if(B.circular)return u.jsx(ct,{path:U,depth:n+1,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const J=at(B.schema,s,r);return jt(J)?u.jsx(zr,{schema:J,showBorder:!1}):u.jsx(Nt,{schema:P,path:U,depth:n+1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l})},H=P=>{const U=ps(P.if);if(U===null)return null;const B=ps(P.then),J=ps(P.else);return u.jsx(np,{ifContent:Z(U,t),thenContent:B!==null?Z(B,t):void 0,elseContent:J!==null?Z(J,t):void 0})},K=()=>{const P=cc(y);return P.length===0?null:u.jsx(u.Fragment,{children:P.map((U,B)=>u.jsx("div",{children:H(U)},B))})};if(w)return u.jsx(ct,{path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??x??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(N){const P=u.jsxs(u.Fragment,{children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?P:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(U=>!U)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:P})]})}const Y=vr(j),pe=wr(j),S=Y??pe,O=Y?"oneOf":"anyOf";if(S){const P=S.map((we,qe)=>typeof we.title=="string"?we.title:`case ${qe+1}`),U=o?1:n+1,B=S[_],J=Xt(B,s,r),de=J.circular?J.schema:at(J.schema,s,r),xe=!J.circular&&jt(de)?u.jsx(zr,{schema:de,showBorder:!1}):u.jsx(Nt,{schema:B,path:t,depth:U-1,refStack:r,deref:s,ancestors:E,suppressRow:!0,branchLineVariant:"none",defaultExpanded:l},_),ve=u.jsx(Qd,{variant:O,caseCount:S.length,caseLabels:P,selectedCase:_,onSelectCase:k,children:xe}),ee=u.jsxs(u.Fragment,{children:[ve,ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?ee:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(we=>!we)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:ee})]})}const m=(P,U,B)=>{const J=Xt(P,s,r);if(J.circular)return u.jsx(ct,{path:U,depth:B,typeLabelOverride:`↩ ${P.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const de=at(J.schema,s,r);return jt(de)?u.jsx(zr,{schema:de,showBorder:!1}):u.jsx(Nt,{schema:P,path:U,depth:B,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l})},M=P=>{const U=j.properties??{},B=new Set(j.required??[]),J=_r(j),de=Un(j),X=ao(j);return u.jsxs(u.Fragment,{children:[Object.entries(U).map(([xe,ve])=>ge(ve)?u.jsx(Nt,{schema:ve,path:`${t}.${xe}`,depth:P,required:B.has(xe),refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xe):null),J!==null&&ge(J)&&u.jsx(qr,{label:"Property names must adhere to:",children:m(J,`${t}.[propertyName]`,P)}),X.map(([xe,ve])=>u.jsx(Nt,{schema:ve,path:qd(t,xe),depth:P,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xe)),de!==null&&ge(de)&&u.jsx(qr,{label:"Additional properties must adhere to:",children:m(de,`${t}.[additionalProperty]`,P)}),ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]})};if(Er(j)||ni(j))return o?M(n+1):u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(P=>!P)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:M(n+1)})]});if(j.type==="array"||j.items){const P=sc(j),U=P!==null,B=U?Dd(j):null,J=Fd(j),de=J!==null,X=U?null:xn(j),xe=X!==null,ve=U||xe||de||ft(y)||ht(y)||mt(y),ee=`${t}[]`,we=xe?Xt(X,s,r):null,qe=(we==null?void 0:we.schema)??null,Fe=qe?at(qe,s,r):null,yt=qe!==null&&(E.objects.has(qe)||typeof(X==null?void 0:X.$ref)=="string"&&E.refs.has(X.$ref)),rt=qe!==null?{objects:new Set(E.objects).add(qe),refs:typeof(X==null?void 0:X.$ref)=="string"?new Set(E.refs).add(X.$ref):E.refs}:E,Kt=!U&&!de&&Fe!==null&&jt(Fe),Rt=Fe!=null&&Fe.properties?Object.entries(Fe.properties).filter(([,Ve])=>ge(Ve)):[],on=new Set(Fe&&Array.isArray(Fe.required)?Fe.required:[]),Ht=Ve=>u.jsxs(u.Fragment,{children:[U?u.jsxs(u.Fragment,{children:[P.map((Be,xt)=>u.jsx(Nt,{schema:Be,path:`${t}[${xt}]`,depth:Ve,refStack:r,deref:s,ancestors:E,branchLineVariant:d,defaultExpanded:l},xt)),B!==null&&typeof B!="boolean"&&u.jsx(qr,{label:"Additional items:",children:m(B,`${t}[*]`,Ve)}),B===!1&&u.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):xe&&(yt?u.jsx(ct,{path:ee,depth:Ve,typeLabelOverride:`↩ ${X.$ref??As(qe)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):Rt.length>0?Rt.map(([Be,xt])=>u.jsx(Nt,{schema:xt,path:`${t}[].${Be}`,depth:Ve,required:on.has(Be),refStack:r,deref:s,ancestors:rt,branchLineVariant:d,defaultExpanded:l},Be)):u.jsx(Nt,{schema:X,path:ee,depth:Ve,refStack:r,deref:s,ancestors:rt,branchLineVariant:d,defaultExpanded:l})),de&&u.jsx(qr,{label:"Contains at least one:",children:typeof J=="boolean"?u.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:J?"any item":"impossible constraint"}):m(J,`${t}[contains]`,Ve)}),ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return Kt&&!ft(y)&&!ht(y)&&!mt(y)?u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:Kr(y.description,Fe.description),expandable:!1,expanded:!1,onToggle:()=>{}}):Kt?u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:Kr(y.description,Fe.description),expandable:!0,expanded:f,onToggle:()=>p(Ve=>!Ve)}),f&&u.jsxs(mn,{depth:n,lineVariant:a,children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]})]}):o?ve?Ht(n+1):null:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:ee,depth:n,schema:y,itemSchema:Fe,refLabel:x,required:i,description:y.description,expandable:U||xe||de||ft(y)||ht(y)||mt(y),expanded:f,onToggle:()=>p(Ve=>!Ve)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:Ht(n+1)})]})}if(ft(y)||ht(y)||mt(y)){const P=u.jsxs(u.Fragment,{children:[ft(y)&&R(),ht(y)&&H(y),mt(y)&&K()]});return o?P:u.jsxs(u.Fragment,{children:[u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!0,expanded:f,onToggle:()=>p(U=>!U)}),f&&u.jsx(mn,{depth:n,lineVariant:a,children:P})]})}return o?null:u.jsx(ct,{path:t,depth:n,schema:y,refLabel:x,required:i,description:y.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function lo({schema:e,rootName:t,className:n=""}){const{deref:i,defaultSchemaExpanded:r=!1}=zt(),s=ie.useMemo(()=>new Set,[]),o=Zt(e),a=ie.useMemo(()=>o?at(o,i,s):null,[o,i,s]);if(!o||!a)return u.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const l=t??(o.$ref?oo(o.$ref):void 0)??"schema",c=!!t;if(!Hd(a,i)&&!o.$ref){if(c)return a.type==="array"||a.items?u.jsx("div",{className:n,children:u.jsx(Nt,{schema:o,path:l,depth:0,refStack:s,deref:i,defaultExpanded:r})}):null;const f=a.type==="array"||a.items?`${l}[]`:l,p=xn(a),h=p?at(p,i,s):null,g=h!==null&&jt(h);return u.jsx("div",{className:n,children:u.jsx(ct,{path:f,depth:0,schema:a,itemSchema:g?h:void 0,description:a.type==="array"||a.items?Kr(a.description,p==null?void 0:p.description):a.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return u.jsx("div",{className:n,children:u.jsx(Nt,{schema:o,path:l,depth:c?-1:0,refStack:s,deref:i,suppressRow:c,defaultExpanded:r})})}function ip(e){let t=e|0;return()=>{t=t+1831565813|0;let n=Math.imul(t^t>>>15,1|t);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function xc(e){let t=ip(e),n={next(){return t()},int(i,r){return i+Math.floor(n.next()*(r-i+1))},bool(i=.5){return n.next()<i},pick(i){return i[n.int(0,i.length-1)]},shuffle(i){let r=[...i];for(let s=r.length-1;s>0;s--){let o=n.int(0,s);[r[s],r[o]]=[r[o],r[s]]}return r},fork(){let i=Math.floor(n.next()*4294967296);return xc(i)}};return n}function sp(e){return null}function op(e){return e.random.bool()}function bc(e,t,n=!1){let i=-1e3,r=1e3,s=!1,o=!1;if(e.minimum!==void 0&&(i=e.minimum),e.maximum!==void 0&&(r=e.maximum),e.exclusiveMinimum!==void 0&&(i=e.exclusiveMinimum,s=!0),e.exclusiveMaximum!==void 0&&(r=e.exclusiveMaximum,o=!0),e.multipleOf!==void 0)return ap(e.multipleOf,i,r,s,o,t);if(n){let c=s?Math.floor(i)+1:Math.ceil(i),d=o?Math.ceil(r)-1:Math.floor(r);return t.random.int(c,d)}let a=s?i+Number.EPSILON:i,l=o?r-Number.EPSILON:r;return a+t.random.next()*(l-a)}function ap(e,t,n,i,r,s){let o=Math.ceil(t/e),a=Math.floor(n/e);return i&&o*e===t&&o++,r&&a*e===n&&a--,o>a?o*e:s.random.int(o,a)*e}function lp(e,t){if(e.autoIncrement){let n=e.initialOffset??1,i=cp(t.path),r=t.autoIncrementCounters??new Map,s=(r.get(i)??n-1)+1;return r.set(i,s),t.autoIncrementCounters&&t.autoIncrementCounters.set(i,s),s}return bc(e,t,!0)}function cp(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function rl(e,t){let n=vc(e,0);return lr(n.node,t)}function lr(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return up(e,t);case"sequence":return e.nodes.map(n=>lr(n,t)).join("");case"alternation":return lr(t.pick(e.branches),t);case"quantifier":{let n=t.int(e.min,Math.min(e.max,e.min+5));return Array.from({length:n},()=>lr(e.node,t)).join("")}case"group":return lr(e.node,t)}}function up(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),i=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(r=>!n.has(r));return i.length>0?t.pick(i):"a"}function vc(e,t){let n=[],i=[];for(;t<e.length;){let r=e[t];if(r===")")break;if(r==="|"){n.push(il(i)),i=[],t++;continue}if(r==="("){let a=t+1;if(e[a]==="?")if(e[a+1]===":")a+=2;else if(e[a+1]==="="||e[a+1]==="!"){let f=1,p=a;for(;p<e.length&&f>0;)p++,e[p]==="("&&f++,e[p]===")"&&f--;t=p+1;continue}else{for(a+=2;a<e.length&&e[a]!==">";)a++;a++}let l=vc(e,a),c={type:"group",node:l.node};t=l.pos+1;let d=or(e,t,c);i.push(d.node),t=d.pos;continue}if(r==="["){let a=dp(e,t),l=or(e,a.pos,a.node);i.push(l.node),t=l.pos;continue}if(r==="."){let a={type:"dot"};t++;let l=or(e,t,a);i.push(l.node),t=l.pos;continue}if(r==="^"||r==="$"){i.push({type:"anchor"}),t++;continue}if(r==="\\"){t++;let a=fp(e,t);t=a.pos;let l=or(e,t,a.node);i.push(l.node),t=l.pos;continue}let s={type:"literal",value:r};t++;let o=or(e,t,s);i.push(o.node),t=o.pos}return n.push(il(i)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function il(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function fp(e,t){let n=e[t];switch(t++,n){case"d":return{node:{type:"charClass",chars:[..."0123456789"],negated:!1},pos:t};case"D":return{node:{type:"charClass",chars:[..."0123456789"],negated:!0},pos:t};case"w":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!1},pos:t};case"W":return{node:{type:"charClass",chars:[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"],negated:!0},pos:t};case"s":return{node:{type:"charClass",chars:[...`
152
152
  `],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
153
153
  `],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function dp(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let i=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let r=e[t];switch(r){case"d":i.push(..."0123456789");break;case"w":i.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":i.push(...`
154
- `);break;default:i.push(r)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let r=e.charCodeAt(t),s=e.charCodeAt(t+2);for(let o=r;o<=s;o++)i.push(String.fromCharCode(o));t+=3;continue}i.push(e[t]),t++}return t++,{node:{type:"charClass",chars:i,negated:n},pos:t}}function or(e,t,n){if(t>=e.length)return{node:n,pos:t};let i=e[t],r,s;switch(i){case"*":r=0,s=5,t++;break;case"+":r=1,s=5,t++;break;case"?":r=0,s=1,t++;break;case"{":{let o=pp(e,t);if(o)r=o.min,s=o.max,t=o.pos;else return{node:n,pos:t};break}default:return{node:n,pos:t}}return t<e.length&&(e[t]==="?"||e[t]==="+")&&t++,{node:{type:"quantifier",node:n,min:r,max:s},pos:t}}function pp(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let i=parseInt(n[1],10),r;return n[2]===void 0?r=i:n[2]===""?r=i+5:r=parseInt(n[2],10),{min:i,max:r,pos:t+n[0].length}}function St(e){return e<10?`0${e}`:`${e}`}function hp(e,t){return new Date(e,t,0).getDate()}var wc="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function mp(e){return!(e==="^"||e==="$"||e==="^$")}function gp(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return yp(t);let o=t.formatRegistry.get(e.format);if(o){let a=o(t.random),l=t.minLength??e.minLength,c=t.maxLength??e.maxLength;return l!==void 0&&a.length<l?gs(a,l,t):c!==void 0&&a.length>c?a.slice(0,c):a}}if(e.pattern){let o=t.minLength??e.minLength,a=t.maxLength??e.maxLength;for(let d=0;d<50;d++){let f=rl(e.pattern,t.random);if(!(o!==void 0&&f.length<o)&&!(a!==void 0&&f.length>a))return f}let l=rl(e.pattern,t.random),c=mp(e.pattern);return o!==void 0&&l.length<o&&c?gs(l,o,t):a!==void 0&&l.length>a?l.slice(0,a):l}let n=e.minLength??0,i=e.maxLength??Math.max(n+10,10),r=t.random.int(n,i),s="";for(let o=0;o<r;o++)s+=t.random.pick([...wc]);return t.maxLength!==void 0&&s.length>t.maxLength&&(s=s.slice(0,t.maxLength)),t.minLength!==void 0&&s.length<t.minLength&&(s=gs(s,t.minLength,t)),s}function gs(e,t,n){for(;e.length<t;)e+=n.random.pick([...wc]);return e}function yp(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,i=t.getTime(),r=n.getTime(),s=i+e.random.next()*(r-i),o=new Date(s),a=o.getFullYear(),l=St(o.getMonth()+1),c=St(o.getDate());return`${a}-${l}-${c}T01:01:01.0Z`}function sl(e,t){if(e.const!==void 0)return structuredClone(e.const);if(e.enum!==void 0&&e.enum.length>0){let n=e.enum;if(e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0){let r=e.exclusiveMinimum??e.minimum??-1/0,s=e.exclusiveMaximum??e.maximum??1/0,o=e.exclusiveMinimum!==void 0,a=e.exclusiveMaximum!==void 0;n=n.filter(l=>{if(typeof l!="number")return!0;let c=o?l>r:l>=r,d=a?l<s:l<=s;if(!c||!d)return!1;if(e.multipleOf!==void 0){let f=e.multipleOf,p=f.toString().includes(".")?f.toString().split(".")[1].length:0,h=Math.pow(10,p),g=Math.round(l*h),_=Math.round(f*h);if(g%_!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let r=e.minLength??0,s=e.maxLength??1/0;n=n.filter(o=>typeof o!="string"?!0:o.length>=r&&o.length<=s)}if(e.minItems!==void 0||e.maxItems!==void 0){let r=e.minItems??0,s=e.maxItems??1/0;n=n.filter(o=>Array.isArray(o)?o.length>=r&&o.length<=s:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let r=e.minProperties??0,s=e.maxProperties??1/0;n=n.filter(o=>typeof o!="object"||o===null||Array.isArray(o)?!0:Object.keys(o).length>=r&&Object.keys(o).length<=s)}if(n.length===0){let r=[];throw e.minLength!==void 0&&r.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&r.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&r.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&r.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&r.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&r.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&r.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&r.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&r.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&r.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&r.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${r.join(", ")}] at ${t.path}`)}let i=t.random.pick(n);return typeof i=="object"&&i!==null?structuredClone(i):i}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Bt(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}Ec(t,n)}return t}function _c(e,t){if(typeof e=="boolean"||typeof t=="boolean")return{};if(typeof e!="object"||e===null)return typeof t=="object"&&t!==null?t:{};if(typeof t!="object"||t===null)return e;let n={...e};return Ec(n,t),n}function Ec(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=xp(e.type,t.type)),t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.max(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.min(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=e.exclusiveMinimum!==void 0?Math.max(e.exclusiveMinimum,t.exclusiveMinimum):t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=e.exclusiveMaximum!==void 0?Math.min(e.exclusiveMaximum,t.exclusiveMaximum):t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.max(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.min(e.maxLength,t.maxLength):t.maxLength),t.pattern!==void 0&&(e.pattern=t.pattern),t.format!==void 0&&(e.format=t.format),t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.max(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.min(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.items!==void 0&&(e.items=t.items),t.prefixItems!==void 0)if(e.prefixItems===void 0)e.prefixItems=t.prefixItems;else{let n=[],i=Math.max(e.prefixItems.length,t.prefixItems.length);for(let r=0;r<i;r++){let s=e.prefixItems[r],o=t.prefixItems[r];s!==void 0&&o!==void 0?n.push(_c(s,o)):s!==void 0?n.push(s):o!==void 0&&n.push(o)}e.prefixItems=n}if(t.contains!==void 0&&(e.containsAll!==void 0?e.containsAll=[...e.containsAll,t.contains]:e.contains!==void 0?(e.containsAll=[e.contains,t.contains],delete e.contains):e.contains=t.contains),t.properties&&(e.properties=bp(e.properties??{},t.properties)),t.required&&(e.required=[...new Set([...e.required??[],...t.required])]),t.additionalProperties!==void 0&&(e.additionalProperties=t.additionalProperties),t.patternProperties&&(e.patternProperties={...e.patternProperties??{},...t.patternProperties}),t.minProperties!==void 0&&(e.minProperties=e.minProperties!==void 0?Math.max(e.minProperties,t.minProperties):t.minProperties),t.maxProperties!==void 0&&(e.maxProperties=e.maxProperties!==void 0?Math.min(e.maxProperties,t.maxProperties):t.maxProperties),t.const!==void 0&&(e.const=t.const),t.enum!==void 0)if(e.enum!==void 0){let n=new Set(t.enum.map(i=>JSON.stringify(i)));e.enum=e.enum.filter(i=>n.has(JSON.stringify(i)))}else e.enum=t.enum;t.$ref&&(e.$ref=t.$ref),t.$defs&&(e.$defs={...e.$defs??{},...t.$defs}),t.allOf&&(e.allOf=[...e.allOf??[],...t.allOf]),t.anyOf&&(e.anyOf=t.anyOf),t.oneOf&&(e.oneOf=t.oneOf)}function xp(e,t){let n=Array.isArray(e)?e:[e],i=Array.isArray(t)?t:[t],r=n.filter(s=>i.includes(s));return r.length===0?n[0]:r.length===1?r[0]:r}function bp(e,t){let n={...e};for(let[i,r]of Object.entries(t)){let s=e[i];s===void 0?n[i]=r:typeof s=="object"&&typeof r=="object"?n[i]=_c(s,r):n[i]=r}return n}var ri=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function Oc(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>ri.has(t))}function ol(e,t){if(typeof t!="object"||t===null)return!1;let n=t;return n.const!==void 0?e===n.const:n.enum!==void 0?n.enum.some(i=>i===e):!1}function vp(e){return typeof e=="boolean"?!e:typeof e!="object"||e===null?!1:e.not===!0||typeof e.not=="object"&&e.not!==null&&Object.keys(e.not).length===0}function wp(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[i,r]of Object.entries(e))ri.has(i)||(Oc(r)?(t[i]=r,n=!0):(t[i]={const:r},n=!0));if(n)return t}return{}}function _p(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function Ep(e,t){var x;let n=wp(e),i=_p(e,n);if(t.depth>=t.maxDepth){if(i.length===0)return{};let w={};for(let E of i){let j=n[E];if(j&&typeof j=="object"&&j!==null){let N=j;N.const!==void 0?w[E]=N.const:N.default!==void 0?w[E]=N.default:N.enum!==void 0&&N.enum.length>0?w[E]=N.enum[0]:w[E]=Tp(N.type)}else w[E]=null}return w}if(e.additionalProperties===!1){let w=Object.keys(n).length>0,E=e.patternProperties&&Object.keys(e.patternProperties).length>0,j=new Set(Object.keys(n)),N=[...new Set(i)].filter(R=>!j.has(R));if((e.minProperties??0)>0&&!w&&!E)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(N.length>0&&!E&&!w)throw Error(`missing properties for ${N.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let r=t.path==="/"?"/properties":`${t.path}/properties`,s={...t,depth:t.depth+1,path:r},o={},a=new Set,l=new Set(i),c=t.alwaysFakeOptionals??!1,d=t.fillProperties??!0,f=t.fixedProbabilities??!1,p=t.optionalsProbability??.5,h=Object.keys(n).filter(w=>!l.has(w)),g;if(f&&!c&&h.length>0){let w=Math.round(h.length*p);g=new Set(h.slice(0,w))}let _=w=>c?!0:g?g.has(w):t.random.bool(p);if(Object.keys(n).length>0)for(let[w,E]of Object.entries(n)){if(vp(E))continue;a.add(w);let j=tn(s,w),N=l.has(w),R=typeof E=="object"&&E!==null&&E.type==="object",Z=E;if(e.patternProperties&&typeof E=="object"&&E!==null){let H=[];for(let[K,Y]of Object.entries(e.patternProperties))try{new RegExp(K).test(w)&&H.push(Y)}catch{}H.length>0&&(Z=Bt([E,...H]))}if(N){let H=await Ne(Z,j);H!==void 0&&(o[w]=H)}else if(_(w)){let H=await Ne(Z,j);H!==void 0&&(o[w]=H)}else if(R&&!d){let H=E.required??[];if(H.length>0){let K={};for(let Y of H){let pe=(E.properties??{})[Y]??{},S=tn(j,Y),O=await Ne(pe,S);O!==void 0&&(K[Y]=O)}o[w]=K}}}for(let w of l)if(!(o[w]!==void 0||a.has(w))){if(e.patternProperties){let E=[];for(let[j,N]of Object.entries(e.patternProperties))new RegExp(j).test(w)&&E.push(N);if(E.length>0){let j=E.length===1?E[0]:Bt(E),N=tn(s,w),R=await Ne(j,N);R!==void 0&&(o[w]=R),a.add(w)}}if(!a.has(w)){let E=e.additionalProperties??!0;if(E!==!1){let j=tn(s,w),N=await Ne(E===!0?{}:E,j);N!==void 0&&(o[w]=N),a.add(w)}}}if(e.dependencies){for(let[w,E]of Object.entries(e.dependencies))if(!(typeof E!="object"||E===null||Array.isArray(E))&&o[w]!==void 0&&!a.has(w+"_dep")){a.add(w+"_dep");let j=E.oneOf??E.anyOf??E.allOf??[E],N=null;for(let R of j){if(typeof R!="object"||R===null)continue;let{properties:Z,not:H}=R;if(Z&&Z[w]){let K=Z[w],Y=o[w];if(ol(Y,K)){N=R;break}}if(H!=null&&H.properties){let K=H.properties[w];if(K){let Y=o[w];if(!ol(Y,K)){N=R;break}}}}if(!N&&j.length>0&&typeof j[0]=="object"&&(N=j[0]),N!=null&&N.not){let R=N.not;if(R.required&&Array.isArray(R.required))for(let Z of R.required)delete o[Z]}if(N!=null&&N.required)for(let R of N.required){if(R===w||o[R]!==void 0)continue;let Z=((x=N.properties)==null?void 0:x[R])??{type:"object"},H=tn(s,R),K=await Ne(Z,H);K!==void 0&&(o[R]=K)}if(N&&N.properties)for(let[R,Z]of Object.entries(N.properties)){if(R===w)continue;let H=tn(s,R),K=await Ne(Z,H);K!==void 0&&(o[R]=K)}}}let k=e.minProperties??0,y=e.maxProperties;if(Object.keys(o).length<k){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let w=Object.entries(e.patternProperties),E=0,j=1e3;for(;Object.keys(o).length<k&&E<j;){E++;let[N,R]=t.random.pick(w),Z=Ap(N,t);if(Z&&!o[Z]){let H=tn(s,Z),K=await Ne(R,H);K!==void 0&&(o[Z]=K),a.add(Z)}}}if(Object.keys(o).length<k){let w=e.additionalProperties,E=w===void 0||w===!0?{type:"string"}:w;if(E!==!1){let j=0,N=1e3;for(;Object.keys(o).length<k&&j<N;){j++;let R=`prop${t.random.int(0,99999)}`;if(!o[R]){let Z=tn(s,R),H=await Ne(E,Z);H!==void 0&&(o[R]=H),a.add(R)}}}}if(Object.keys(o).length<k){let w=Object.keys(n).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${t.path}`)}}if(y!==void 0&&Object.keys(o).length>y){let w=Object.keys(o).filter(E=>!l.has(E));for(t.random.shuffle(w);Object.keys(o).length>y&&w.length>0;){let E=w.pop();delete o[E]}}return t.pruneProperties&&t.pruneProperties.length>0&&Ts(o,t.pruneProperties),kp(o,n),o}function tn(e,t){let n=Op(t),i=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:i}}function Op(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function kp(e,t){for(let[n,i]of Object.entries(t)){if(typeof i!="object"||i===null)continue;let r=i;if(r.template===void 0)continue;let s=r.template;if(typeof s!="string")continue;let o=s.replace(/#\{(\w+)\}/g,(a,l)=>{let c=e[l];return c!==void 0?String(c):""});e[n]=o}}function Ap(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let l=n[1],c=n[2];if(c===".*"||c!=null&&c.includes("?:")){let d=t.random.int(0,10),f="";for(let p=0;p<d;p++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return l+f}return l}let i=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(i){let l=i[2],c=t.random.int(1,10),d="";for(let f=0;f<c;f++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return d+l}let r=e.match(/^\^([a-zA-Z]+)\$$/);if(r)return r[1];let s=t.random.int(3,10),o="abcdefghijklmnopqrstuvwxyz",a="";for(let l=0;l<s;l++)a+=t.random.pick(o.split(""));try{if(new RegExp(e).test(a))return a}catch{}return null}function Ts(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let i of e)Ts(i,t);return}let n=e;for(let i of Object.keys(n))t.includes(i)?delete n[i]:Ts(n[i],t)}function Tp(e){switch(Array.isArray(e)?e[0]:e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function Np(e,t){var y;if(t.depth>=t.maxDepth){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}if(t.refDepthReached){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let x=((y=e.prefixItems)==null?void 0:y.length)??0;if((e.minItems??0)>x)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${x})`)}let n=t.path==="/"?"/items":`${t.path}/items`,i={...t,depth:t.depth+1,path:n},r=[],s=t.refDepthMax,o=t.minItems??e.minItems??0,a=t.maxItems??e.maxItems??Math.max(o,t.maxDefaultItems);e.maxItems!==void 0&&a>e.maxItems&&(a=e.maxItems),e.minItems!==void 0&&o<e.minItems&&(o=e.minItems),a<o&&(e.maxItems!==void 0?o=a:a=o),t.alwaysFakeOptionals&&(a=Math.max(o,a));let l=e.uniqueItems?new Set:null,c=async(x,w)=>{let E=await Ne(x,w);if(E===void 0)return"omitted";if(l){let j=JSON.stringify(E);if(l.has(j)){for(let N=0;N<50;N++){if(E=await Ne(x,nn(i,r.length)),E===void 0)continue;let R=JSON.stringify(E);if(!l.has(R))return l.add(R),r.push(E),"added"}return"failed"}l.add(j)}return r.push(E),"added"};if(e.prefixItems)for(let x=0;x<e.prefixItems.length&&r.length<a;x++){let w=nn(i,x);if(await c(e.prefixItems[x],w)==="failed")break}let d;if(s!==void 0&&t.refDepth>=s-1){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}let f=t.alwaysFakeOptionals??!1,p=t.fixedProbabilities??!1,h=t.optionalsProbability??.5;if(f)d=a;else if(p){let x=a-Math.max(o,r.length),w=Math.round(x*h);d=Math.max(o,r.length)+w}else d=t.random.int(Math.max(o,r.length),a);e.items;let g=e.prefixItems!==void 0,_=e.additionalItems!==void 0,k;if(g?_?k=e.additionalItems:e.items!==void 0&&(k=e.items):k=e.items,k!==!1&&k!==void 0){let x=k??{},w=0,E=Math.max(d*20,50);for(;r.length<d;){let j=await c(x,nn(i,r.length));if(j==="added"){w=0;continue}if(w++,j==="failed"||w>=E)break}}if(e.contains){let x=e.minContains??1,w=e.maxContains??Math.max(x,1),E=t.random.int(x,w);for(let j=0;j<E;j++){let N=await Ne(e.contains,nn(i,r.length));if(N!==void 0){if(l){let R=JSON.stringify(N);if(l.has(R)){let Z=!1;for(let H=0;H<50;H++){if(N=await Ne(e.contains,nn(i,r.length)),N===void 0)continue;let K=JSON.stringify(N);if(!l.has(K)){l.add(K),Z=!0;break}}if(!Z)continue}else l.add(R)}if(r.length<a){let R=t.random.int(0,r.length);r.splice(R,0,N)}else if(r.length>0){let R=t.random.int(0,r.length-1);r[R]=N}}}for(;r.length>a;)r.pop()}if(e.containsAll){let x=new Set;for(let w of e.containsAll){let E=await Ne(w,nn(i,r.length));if(E!==void 0){if(l){let j=JSON.stringify(E);if(l.has(j)){let N=!1;for(let R=0;R<50;R++){if(E=await Ne(w,nn(i,r.length)),E===void 0)continue;let Z=JSON.stringify(E);if(!l.has(Z)){l.add(Z),N=!0;break}}if(!N)continue}else l.add(j)}if(r.length<a){let j=t.random.int(0,r.length);r.splice(j,0,E);let N=new Set;for(let R of x)N.add(R>=j?R+1:R);x.clear();for(let R of N)x.add(R);x.add(j)}else if(r.length>0){let j=Array.from({length:r.length},(N,R)=>R).filter(N=>!x.has(N));if(j.length>0){let N=j[t.random.int(0,j.length-1)];r[N]=E,x.add(N)}else r.push(E),x.add(r.length-1)}}}for(;r.length>a;)r.pop()}return e.uniqueItems&&r.length>0?jp(r,e,i,o,a,l):r}async function jp(e,t,n,i,r,s){let o=t.items??{},a=0,l=100;for(;e.length<i&&a<l;){a++;let c=await Ne(o,nn(n,e.length));if(c===void 0)continue;let d=JSON.stringify(c);s.has(d)||(s.add(d),e.push(c))}for(;e.length>r;)e.pop();return e}function nn(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function al(e,t){if(!t||t==="")return e;if(typeof e!="object"||e===null)throw Error(`Cannot resolve fragment "${t}" in non-object schema`);if(t.startsWith("/"))return Sp(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function Sp(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),i=e;for(let r of n){let s=r.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof i!="object"||i===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${s}"`);if(Array.isArray(i)){let o=parseInt(s,10);if(isNaN(o)||o<0||o>=i.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${s}"`);i=i[o]}else{if(!(s in i))throw Error(`Cannot resolve JSON pointer "${t}": property "${s}" not found`);i=i[s]}}return i}function Rp(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,i=n.$id,{$id:r,...s}=n;t.set(i,s)}if(e.$defs)for(let[n,i]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,i);return t}async function Qr(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let i=t.refDepth+1;if(t.refDepthMax!==void 0&&i>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}};if(t.refStack.has(n)){if(t.refDepthMax!==void 0){if(t.refDepth>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}}}else if(t.depth>=t.maxDepth)return{schema:{type:"null"},ctx:t}}let r,s;if(n.startsWith("#/")){if(r=t.refRegistry.get(n),r===void 0&&n.length>2){let f=t.refRegistry.get("#");if(f!==void 0&&typeof f=="object")try{r=al(f,n.slice(1))}catch{}}r===void 0&&t.refResolver&&(r=await t.refResolver(n),r!==void 0&&t.refRegistry.set(n,r))}else if(n==="#")r=t.refRegistry.get("#")??{};else if(r=t.refRegistry.get(n),r===void 0&&t.refResolver){s=await t.refResolver(n);let f=n.indexOf("#");if(f!==-1){let p=n.slice(f+1);p?r=al(s,p):r=s}else r=s;if(s&&typeof s=="object"&&s!==null){let p=s;if(p.$defs)for(let[h,g]of Object.entries(p.$defs))t.refRegistry.set(`#/$defs/${h}`,g)}}if(r===void 0)throw Error(`Unresolved $ref: ${n}`);let o=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:a,...l}=e,c=Object.fromEntries(Object.entries(l).filter(([f])=>!o.has(f)));Object.keys(c).length>0&&typeof r=="object"&&r!==null&&(r={...r,...c});let d={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:r,ctx:d}}function Ip(e,t){typeof e!="boolean"&&(t.set("#",e),Ns(e,"#",t))}function Ns(e,t,n){if(e.$id){let{$id:i,...r}=e;n.set(i,r)}if(e.$defs)for(let[i,r]of Object.entries(e.$defs)){let s=`${t}/$defs/${i}`;n.set(s,r),typeof r=="object"&&r!==null&&Ns(r,s,n)}if(e.properties)for(let[i,r]of Object.entries(e.properties))typeof r=="object"&&r!==null&&Ns(r,`${t}/properties/${i}`,n)}async function Mp(e,t){return e.$ref?(await Qr(e,t)).schema:e}async function Cp(e,t){let n=[];for(let i of e)if(typeof i=="object"&&i!==null&&"$ref"in i){let r=await Mp(i,t);n.push(r)}else typeof i=="object"&&i!==null&&n.push(i);return n}async function Lp(e,t){let{allOf:n,anyOf:i,oneOf:r,not:s,if:o,then:a,else:l,...c}=e;if(n){let d=await Cp(n,t),f=Bt([c,...d]);return Ne(f,t)}if(r){let d=t.random.shuffle([...r]),f=c.required??[];for(let w of d){let E=typeof w=="object"&&w!==null?w:{};E.$ref&&(E=(await Qr(E,t)).schema);let j=E.required??[],N=[...new Set([...f,...j])],R={...c,required:N},Z=Bt([R,E]),H={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await Ne(Z,H)}catch{}}let p=r[0],h=typeof p=="object"&&p!==null?p:{};h.$ref&&(h=(await Qr(h,t)).schema);let g=h.required??[],_=[...new Set([...f,...g])],k={...c,required:_},y=Bt([k,h]),x={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return Ne(y,x)}if(i){let d=t.random.shuffle([...i]);for(let h of d){let g=Bt([c,h]);try{return await Ne(g,t)}catch{}}let f=i[0],p=Bt([c,f]);return Ne(p,t)}return o!==void 0?Pp(c,o,a,l,t):s?Dp(c,s,t):Ne(c,t)}async function Pp(e,t,n,i,r){if(n!==void 0){let s=Bt([e,t,n]);try{return await Ne(s,r)}catch{}}if(i!==void 0){let s=Bt([e,i]);try{return await Ne(s,r)}catch{}}return Ne(e,r)}async function Dp(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return Ne(e,n)}if(t.type&&!t.enum&&!t.const){let i=Array.isArray(t.type)?t.type:[t.type],r=["string","number","integer","boolean","null","object","array"].filter(s=>!i.includes(s));if(r.length>0){let s=n.random.pick(r),o=Bt([e,{type:s}]);return Ne(o,n)}}if(t.const!==void 0||t.enum!==void 0){let i=t.enum??[t.const],r=new Set(i.map(s=>JSON.stringify(s)));for(let s=0;s<20;s++){let o=await Ne(e,n);if(!r.has(JSON.stringify(o)))return o}}return Ne(e,n)}class Fp{constructor(){Ee(this,"extensions",new Map)}define(t,n){this.extensions.set(t,{callback:n,context:{}})}has(t){return this.extensions.has(t)}reset(t){if(t){let n=this.extensions.get(t);n&&(n.context={},this.extensions.delete(t))}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(t,n){let i=Object.keys(t);for(let r=i.length-1;r>=0;r--){let s=i[r],o=s.startsWith("x-")?s.slice(2):s,a=this.extensions.get(o);if(a){let l=t[s],c=a.callback.call(a.context,l,t,n);if(c!==void 0)return c}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var Bp=new Fp;function zp(e,t){return Bp.generate(e,t)}var qp=["string","number","integer","boolean","null","object","array"];function ll(e,t,n){if(e.faker!==void 0&&e.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${t.path}`);if(e.faker!==void 0)try{let i=Up(e.faker,t),r=ul(i,n??e.type,t.path);return typeof r=="string"&&e.format?cl(r,e.format,t):r}catch{}if(e.chance!==void 0)try{let i=Hp(e.chance,t),r=ul(i,n??e.type,t.path);return typeof r=="string"&&e.format?cl(r,e.format,t):r}catch{}}function cl(e,t,n){if(t==="date"){let i=typeof e=="string"?new Date(e):e;if(i instanceof Date&&!isNaN(i.getTime())){let r=i.getFullYear(),s=St(i.getMonth()+1),o=St(i.getDate());return`${r}-${s}-${o}`}if(typeof e=="string"){let r=Date.parse(e);if(!isNaN(r)){let s=new Date(r),o=s.getFullYear(),a=St(s.getMonth()+1),l=St(s.getDate());return`${o}-${a}-${l}`}}}if(t==="date-time"){let i=typeof e=="string"?new Date(e):e;if(i instanceof Date&&!isNaN(i.getTime()))return i.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function ul(e,t,n){if(t===void 0)return e;let i=Array.isArray(t)?t[0]:t;switch(i){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let r=Number(e);return i==="integer"?Math.floor(r):r;case"boolean":return!!e;case"null":return null;default:return e}}function Up(e,t){var o;if(!((o=t.extensions)!=null&&o.faker)){let a=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${a} in ${t.path}`)}let n,i;if(typeof e=="object"&&e!==null){let a=e,l=Object.keys(a);if(l.length>0)n=l[0],i=a[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let r=n.split("."),s=t.extensions.faker;for(let a of r)try{s=s[a]}catch{throw Error(`failed to resolve .${a} (${n})`)}if(typeof s=="function")return i?s(...i):s();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function Hp(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let i=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${i} in ${t.path}`)}if(typeof e=="string"){let i=t.extensions.chance[e];if(typeof i=="function")return i.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let i=e,r=Object.keys(i)[0],s=i[r],o=t.extensions.chance[r];if(typeof o=="function")return s?o.call(t.extensions.chance,s):o.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function Vp(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function tt(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function Ne(e,t){if(e===!0)return Ne({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let s=e,o=null;for(let[a,l]of Object.entries(t.propAliases))a in s&&!(l in s)&&(o||(o={...s}),o[l]=o[a],delete o[a]);o&&(e=o)}let n;if(Array.isArray(e.type)){let s=e.type;n=t.random.pick(s);let o={...t,resolvedType:n},a=ll(e,o,n);if(a!==void 0)return typeof a=="string"&&o.maxLength!==void 0&&a.length>o.maxLength?tt(a.slice(0,o.maxLength),e,o):tt(a,e,o)}else{let s=ll(e,t,n);if(s!==void 0)return typeof s=="string"&&t.maxLength!==void 0&&s.length>t.maxLength?tt(s.slice(0,t.maxLength),e,t):tt(s,e,t)}let i=zp(e,t);if(i!==void 0)return tt(i,e,t);if(e.$ref){let s=await Qr(e,t);return Ne(s.schema,Vp(s.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return Lp(e,t);if(e.const!==void 0)return tt(sl(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return tt(e.default,e,t);if(e.enum!==void 0)return tt(sl(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return tt(t.random.pick(e.examples),e,t);if(e.example!==void 0)return tt(e.example,e,t)}let r=Wp(e,t);if(r===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let s=t.defaultInvalidTypeProduct;return typeof s=="string"?Zp(s):s}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(r){case"null":return tt(sp(),e,t);case"boolean":return tt(op(t),e,t);case"number":return tt(bc(e,t),e,t);case"integer":return tt(lp(e,t),e,t);case"string":return tt(gp(e,t),e,t);case"object":return tt(await Ep(e,t),e,t);case"array":return tt(await Np(e,t),e,t);default:throw Error(`Unknown type: ${r} at ${t.path}`)}}function Wp(e,t){return t.resolvedType!==void 0?t.resolvedType:typeof e.type=="string"?["string","number","integer","boolean","null","object","array"].includes(e.type)?e.type:null:Array.isArray(e.type)?t.random.pick(e.type):e.properties||e.required||e.additionalProperties!==void 0||e.patternProperties||e.minProperties!==void 0||e.maxProperties!==void 0||Jp(e)?"object":e.items||e.prefixItems||e.contains||e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"number":e.minLength!==void 0||e.maxLength!==void 0||e.pattern||e.format||e.faker!==void 0||e.chance!==void 0?"string":t.random.pick(qp)}function Jp(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(ri.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function Zp(e,t){switch(e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function Xp(e){let t=kc(e),n=Ac(e);return`${t}T${n}`}function kc(e){let t=e.int(2e3,2030),n=e.int(1,12),i=hp(t,n),r=e.int(1,i);return`${t}-${St(n)}-${St(r)}`}function Ac(e){let t=e.int(0,23),n=e.int(0,59),i=e.int(0,59);return`${St(t)}:${St(n)}:${St(i)}Z`}var Yp=["alice","bob","charlie","dave","eve","frank","grace","heidi"],$p=["example.com","test.org","demo.net","sample.io"];function fl(e){let t=e.pick(Yp),n=e.int(1,999),i=e.pick($p);return`${t}${n}@${i}`}var Kp=["https"],Qp=["example.com","test.org","demo.net"],Gp=["api","v1","users","items","data","resource"];function Ur(e){let t=e.pick(Kp),n=e.pick(Qp),i=e.int(1,3),r=[];for(let s=0;s<i;s++)r.push(e.pick(Gp));return`${t}://${n}/${r.join("/")}`}var eh=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],th=["com","org","net","io","dev"];function dl(e){let t=e.int(1,3),n=[];for(let i=0;i<t;i++)n.push(e.pick(eh));return n.push(e.pick(th)),n.join(".")}function nh(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function rh(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function ih(e){let t=n=>{let i="";for(let r=0;r<n;r++)i+=e.int(0,15).toString(16);return i};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var sh=["foo","bar","baz","items","0","1","2","name","value"];function pl(e){let t=e.int(1,4),n=[];for(let i=0;i<t;i++)n.push(e.pick(sh));return"/"+n.join("/")}function oh(e){let t=["P"],n=e.bool(),i=e.bool();return n&&(e.bool()&&t.push(`${e.int(0,100)}Y`),e.bool()&&t.push(`${e.int(0,12)}M`),e.bool()&&t.push(`${e.int(0,30)}D`)),i&&(t.push("T"),e.bool()&&t.push(`${e.int(0,23)}H`),e.bool()&&t.push(`${e.int(0,59)}M`),e.bool()&&t.push(`${e.int(0,59)}S`)),(t.length===1||t.length===2&&t[1]==="T")&&t.push("0D"),t.join("")}var ah=new Map([["date-time",Xp],["date",kc],["time",Ac],["duration",oh],["email",fl],["idn-email",fl],["uri",Ur],["uri-reference",Ur],["iri",Ur],["iri-reference",Ur],["hostname",dl],["idn-hostname",dl],["ipv4",nh],["ipv6",rh],["uuid",ih],["json-pointer",pl],["relative-json-pointer",e=>`${e.int(0,5)}${pl(e)}`]]);function Tc(e){let t=new Map(ah);if(e)for(let[n,i]of Object.entries(e))t.set(n,i);return t}function lh(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),i=[t];for(let r of n){if(r==="")continue;let s=[];for(let o of i)if(o!=null)if(r==="*")Array.isArray(o)&&s.push(...o);else if(/^\d+$/.test(r)){let a=parseInt(r,10);Array.isArray(o)&&a<o.length&&s.push(o[a])}else r===""?js(o,s):typeof o=="object"&&o!==null&&r in o&&s.push(o[r]);i=s}return i}function js(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),js(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),js(n,t)}}function ch(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[i,r]of Object.entries(e))ri.has(i)||(Oc(r)?(t[i]=r,n=!0):(t[i]={const:r},n=!0));if(n)return t}return{}}async function Ss(e,t,n,i){if(!n.resolveJsonPath)return e;let r=i??e;if(t===!0||t===!1||t.$ref)return e;let s=t;if(s.allOf||s.anyOf||s.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let o={...e},a=ch(s);for(let[l,c]of Object.entries(a))if(l in o){let d=o[l];if(typeof c=="object"&&c!==null&&"jsonPath"in c&&typeof c.jsonPath=="string"){let f=lh(c.jsonPath,r);f.length>0&&(o[l]=n.random.pick(f))}else{let f=await Ss(d,c,n,r);o[l]=f}}return o}if(Array.isArray(e)&&s.items){let o=[];for(let a of e){let l=await Ss(a,s.items,n,r);o.push(l)}return o}return e}var uh=Tc(),hl=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function fh(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let f=e.$schema;if(typeof f=="string"&&!hl.has(f))throw Error(`Unsupported JSON Schema version: ${f}. Supported versions: ${[...hl].join(", ")}`)}let n=ph(t),i=xc((t==null?void 0:t.seed)??1),r=n.propAliases?dh(e,n.propAliases):e,s=Rp(r);Ip(r,s);let o=n.formats?Tc(n.formats):new Map(uh),a=n.refDepthMin??n.refDepth,l=n.refDepthMax??n.refDepth;if(a!==void 0&&l!==void 0&&a>l)throw Error(`refDepthMin (${a}) cannot be greater than refDepthMax (${l})`);let c={random:i,maxDepth:n.maxDepth??(l?l+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:s,refStack:new Set,formatRegistry:o,refResolver:n.refResolver,minItems:n.minItems,maxItems:n.maxItems,minLength:n.minLength,maxLength:n.maxLength,useDefaultValue:n.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:n.alwaysFakeOptionals,fixedProbabilities:n.fixedProbabilities,fillProperties:n.fillProperties,extensions:n.extensions,resolveJsonPath:n.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:a,refDepthMax:l,useExamplesValue:n.useExamplesValue,pruneProperties:n.pruneProperties,failOnInvalidTypes:n.failOnInvalidTypes,defaultInvalidTypeProduct:n.defaultInvalidTypeProduct,minDateTime:n.minDateTime,maxDateTime:n.maxDateTime,propAliases:n.propAliases,outputTransform:n.outputTransform},d=await Ne(r,c);return n.resolveJsonPath?Ss(d,e,c,d):d}function dh(e,t){if(typeof e!="object"||e===null)return e;let n=e,i=null;for(let[r,s]of Object.entries(t))r in n&&!(s in n)&&(i||(i={...n}),i[s]=i[r],delete i[r]);return i??e}function ph(e){if(!e)return{};let t=e,n={...e};return t.requiredOnly===!0&&n.optionalsProbability===void 0&&(n={...n,optionalsProbability:0,alwaysFakeOptionals:!1}),t.ignoreProperties&&t.ignoreProperties.length>0&&(n={...n,outputTransform:hh(n.outputTransform,mh(t.ignoreProperties))}),n}function hh(e,t){return e?t?async(n,i,r)=>{let s=await e(n,i,r);return t(s,i,r)}:e:t}function mh(e){return(t,n,i)=>{if(i==="/")return t;let r=gh(i.slice(i.lastIndexOf("/")+1));return e.some(s=>typeof s=="string"?s===r:s instanceof RegExp?s.test(r):s(n))?void 0:t}}function gh(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Nc(e,t=new Set){if(t.has(e))return e;if(e.type==="object"&&e.properties&&typeof e.properties=="object"){t.add(e);try{const n={};for(const[i,r]of Object.entries(e.properties)){const s=/id$/i.test(i)&&r.type==="string"&&!r.format&&!r.examples,o=r.type==="string"&&!r.format&&!r.examples&&!r.enum;n[i]=s?{...r,format:"uuid"}:o?{...r,examples:["string"]}:Nc(r,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}function yh({schema:e}){const[t,n]=ie.useState(null);if(ie.useEffect(()=>{let r=!1;try{fh(Nc(e),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(s=>{r||n(s)}).catch(()=>{})}catch{}return()=>{r=!0}},[e]),t===null)return null;const i=JSON.stringify(t,null,2);return u.jsxs("div",{children:[u.jsx(Hl,{code:i}),u.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function Rs({schema:e,label:t,description:n,schemaFormat:i,originalSchema:r,conversionError:s}){const o=rc(i),a=Rd(i,s),[l,c]=ie.useState(a?"example":"schema");return ie.useEffect(()=>{!a&&l==="example"&&c("schema")},[a,l]),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider",children:t}),o&&u.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:i,children:o})]}),n&&u.jsx("p",{className:"text-sm text-gray-600 leading-relaxed mt-2 mb-2",children:n})]}),u.jsx(yc,{tabs:[...a?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:l,onChange:d=>c(d),ariaLabel:"Schema view toggle"})]}),s&&u.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 ",ic(i)??"the"," schema — showing raw definition. ",s]}),l==="schema"&&u.jsx(lo,{schema:e,rootName:t}),l==="json"&&u.jsx(Vl,{schema:r??e}),l==="example"&&a&&u.jsx(yh,{schema:e})]})}function jc({message:e,expanded:t,onToggleExpanded:n,paddingX:i="px-4"}){const[r,s]=ie.useState("payload"),{deref:o}=zt(),a=ie.useMemo(()=>e.payload?$r(e.payload,o):null,[e.payload,o]),l=ie.useMemo(()=>e.headers?$r(e.headers,o):null,[e.headers,o]),c=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:u.jsx("div",{className:"overflow-hidden",children:u.jsxs("div",{className:`${i} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&u.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&u.jsxs("div",{children:[e.payload&&e.headers&&u.jsx(Cs,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:r,onChange:d=>s(d)}),u.jsxs("div",{className:"mt-4",children:[(r==="payload"||!e.headers)&&a&&u.jsx(Rs,{schema:a.schema,label:"Payload",description:a.description,schemaFormat:a.schemaFormat,originalSchema:a.originalSchema,conversionError:a.conversionError}),(r==="headers"||!e.payload)&&l&&u.jsx(Rs,{schema:l.schema,label:"Headers",description:l.description,schemaFormat:l.schemaFormat,originalSchema:l.originalSchema,conversionError:l.conversionError})]})]}),e.tags&&e.tags.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((d,f)=>u.jsx(Ws,{name:`#${d.name}`},f))})]})})}),c&&u.jsxs("button",{onClick:n,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:[u.jsx("span",{children:t?"Show less":"Show more"}),u.jsx(ti,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function xh({messageKey:e,message:t,first:n,isSelected:i}){const[r,s]=ie.useState(!1);return ie.useEffect(()=>{i&&s(!0)},[i]),u.jsxs("tbody",{className:`${n?"":"border-t border-border"} ${i?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[u.jsxs("tr",{id:`message-${e}`,className:"",children:[u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),u.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})]})}),u.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx("div",{}),u.jsx("div",{children:t.contentType&&u.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&&u.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx("div",{}),u.jsx("div",{children:t.correlationId&&u.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})})]})]})})]}),u.jsx("tr",{children:u.jsx("td",{colSpan:3,className:"p-0",children:u.jsx(jc,{message:t,expanded:r,onToggleExpanded:()=>s(o=>!o),paddingX:"px-6"})})})]})}function bh({messages:e,selectedKey:t}){const n=Object.entries(e),i=n.length?u.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{className:"bg-neutral-100",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),n.map(([r,s],o)=>u.jsx(xh,{messageKey:r,message:s,first:o===0,isSelected:t===r},r))]})}):u.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 u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{content:i,stickySideContent:!1})})}function vh({serverNames:e=[],current:t,setCurrent:n}){return u.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(i=>u.jsx("a",{onClick:()=>n(i),className:Cn(t===i?"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 capitalize cursor-pointer"),children:u.jsx("span",{className:"truncate",children:i})},i))})}function Sc({className:e,children:t,...n}){return u.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...n,children:t})}function wh(e){return u.jsx(Sc,{...e,children:u.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 _h(e){return u.jsx(Sc,{...e,children:u.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 co({className:e}){return u.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,children:u.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"})})}const Eh=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"openIdConnect",name:"OpenID"},{id:"X509",name:"X.509 certificate"},{id:"scramSha256",name:"SASL"},{id:"scramSha512",name:"SASL"},{id:"plain",name:"SASL"},{id:"gssapi",name:"SASL"}];function Rc({securities:e}){var o;const t=ie.useMemo(()=>Eh.filter(a=>{const l=a.id;return e==null?void 0:e.some(c=>c.type.toLowerCase()===l.toLowerCase())}),[e]),[n,i]=ie.useState(t.length>0?t[0].id:null);ie.useEffect(()=>{t.length>0&&i(t[0].id)},[t]);function r(a){return e.find(l=>l.type===a)}const s=n?(o=r(n))==null?void 0:o.description:void 0;return u.jsxs("div",{children:[u.jsx(Cs,{tabs:t,current:n,onChange:i}),u.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[n==="userPassword"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),n&&["scramSha256","scramSha512","plain"].includes(n)&&u.jsxs(Hr,{description:s,children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),n==="gssapi"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),n==="X509"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),n==="apiKey"&&u.jsx(Oh,{security:r("apiKey")}),n==="openIdConnect"&&u.jsx(kh,{security:r("openIdConnect")}),n==="oauth2"&&u.jsx(Ah,{security:r("oauth2")})]})]})}const Hr=({description:e,children:t})=>e?u.jsx(u.Fragment,{children:u.jsx(vn,{children:e})}):u.jsx("span",{children:t}),Oh=({security:e})=>e!=null&&e.description?u.jsx(vn,{children:e.description}):(e==null?void 0:e.in)==="password"?u.jsxs("span",{children:["You have to"," ",u.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."]}):u.jsxs("span",{children:["You have to"," ",u.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."]}),kh=({security:e})=>u.jsxs(u.Fragment,{children:[e!=null&&e.description?u.jsx(vn,{children:e.description}):u.jsx("p",{children:"You can use OpenID to connect to this server."}),u.jsxs("p",{children:["The OpenID Connect URL is"," ",u.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),(e==null?void 0:e.scopes)&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("code",{children:Tu(e.scopes)})})]})]}),Ah=({security:e})=>{const t=e==null?void 0:e.flows;return u.jsxs(u.Fragment,{children:[(e==null?void 0:e.description)&&u.jsx(vn,{children:e.description}),t&&Object.entries(t).map(([n,i])=>{let r="",s="";switch(n){case"clientCredentials":r=gu,s=yu;break;case"implicit":r=hu,s=mu;break;case"password":r=xu,s=bu;break;case"authorizationCode":r=vu,s=wu;break}return u.jsxs("div",{children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:r}),u.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:s})]}),u.jsx("div",{className:"mt-5 border-t border-border",children:u.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[i.authorizationUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.authorizationUrl})})]}),i.tokenUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.tokenUrl})})]}),i.refreshUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.refreshUrl})})]}),i.availableScopes&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(i.availableScopes)?i.availableScopes:Object.keys(i.availableScopes)).map(o=>u.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:o},o))})})]})]})})]},n)})]})};function Th({className:e}){return u.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),u.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"}),u.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"})]})}function Nh(e){return e.startsWith("http://")||e.startsWith("https://")}function Ic(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Mc({value:e}){if(e==null)return null;if(typeof e=="string"&&Nh(e))return u.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 u.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return u.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)?u.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,i)=>u.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},i))}):u.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,i])=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:Ic(n)}),u.jsx(Mc,{value:i})]},n))})}return u.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Cc({bindings:e,expand:t=!1,protocol:n}){const[i,r]=ie.useState(t),s=ku[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},o=Object.entries(e??{}).filter(([a,l])=>a!=="bindingVersion"&&l!==void 0&&l!==null);return o.length===0?null:u.jsxs("div",{className:"mt-2 rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>r(a=>!a),children:[u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label})}),i?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted"})]}),i&&u.jsx("div",{className:"divide-y divide-neutral-100",children:o.length===0?u.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):o.map(([a,l])=>u.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[u.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:Ic(a)}),u.jsx("div",{className:"flex-1 min-w-0",children:u.jsx(Mc,{value:l})})]},a))})]})}function jh({host:e,protocol:t,description:n,tags:i,variables:r,security:s,bindings:o}){const a=r,[l,c]=ie.useState(!1);return u.jsxs("div",{children:[u.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[u.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[u.jsx(wh,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&u.jsx(dr,{address:e,parameters:a,className:"font-bold leading-tight tracking-tight px-0"})]}),u.jsx("div",{className:"mt-2",children:i&&i.map((d,f)=>{const p=d,h=p.externalDocs;return u.jsx(Ws,{href:h&&h.url,title:p.description||(h&&h.description?h.description:void 0),name:p.name},f)})})]}),u.jsx(vn,{children:n}),s&&s.length>0&&u.jsxs("div",{children:[u.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[u.jsx(_h,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),u.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following authorization mechanisms:"}),u.jsxs("div",{className:"mt-4 rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>c(d=>!d),children:[u.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:s.length}),l?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted shrink-0"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),l&&u.jsx("div",{className:"px-4 py-2 border-t border-border",children:u.jsx(Rc,{securities:s})})]})]}),(()=>{const d=o==null?void 0:o[t];return d&&Object.keys(d).some(p=>p!=="bindingVersion")?u.jsxs("div",{children:[u.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[u.jsx(Th,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),u.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),u.jsx(Cc,{bindings:d,protocol:t})]}):null})()]})}function Sh({servers:e}){const t=[...Object.keys(e)],[n,i]=ie.useState(void 0),r=n&&t.includes(n)?n:t[0],s=u.jsx(jh,{...e[r]});return u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{title:_u,content:s,sideContent:u.jsx(vh,{serverNames:t,current:r,setCurrent:i}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function Lc({message:e,messageId:t,i:n}){const[i,r]=ie.useState(!1);return u.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&u.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&&u.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),u.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&u.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&&u.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&&u.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),u.jsx(jc,{message:e,expanded:i,onToggleExpanded:()=>r(s=>!s)})]})}function Rh({requestMessages:e,reply:t,isSend:n,operationId:i}){const[r,s]=ie.useState("request"),o=t.messages??[],a=t.channel,l=t.address,c=r==="request"?e:o,d=r==="request"?n?"accepts":"expects":u.jsxs(u.Fragment,{children:["replies to"," ",l?u.jsxs(u.Fragment,{children:["a channel in"," ",u.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:l.location})]}):(a==null?void 0:a.address)&&u.jsx(dr,{address:a.address,parameters:a.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 u.jsxs("div",{children:[u.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>u.jsx("button",{onClick:()=>s(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
155
- ${r===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),u.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:c.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[u.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:i})," ",d,c.length>1?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):u.jsxs("span",{children:[" "," with the following message:"]})]}),u.jsx("div",{className:"space-y-2",children:c.map((f,p)=>u.jsx(Lc,{message:f,messageId:f.name,i:p},p))})]}):u.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function Ih({op:e,id:t}){var g;const[n,i]=ie.useState(!1),r=e.messages??[],s=e.tags??[],o=e.bindings,a=e.traits,l=e.reply,c=e.externalDocs,d=e.security,f=o??(Array.isArray(a)?(g=a.find(_=>_.bindings))==null?void 0:g.bindings:void 0),p=e.action===sn.SEND,h=u.jsx("div",{className:"space-y-2",children:r.map((_,k)=>u.jsx(Lc,{message:_,messageId:_.name,i:k},k))});return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.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]}),(c==null?void 0:c.url)&&u.jsxs("a",{href:c.url,target:"_blank",rel:"noreferrer",title:c.description||c.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",u.jsx(Ul,{className:"w-3.5 h-3.5"})]})]}),e.description&&u.jsx("div",{children:u.jsx(vn,{children:e.description})}),e.summary&&u.jsx("div",{children:u.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),d&&d.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),u.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>i(_=>!_),children:[u.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:d.length}),n?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted shrink-0"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),n&&u.jsx("div",{className:"px-4 py-2 border-t border-border",children:u.jsx(Rc,{securities:d})})]})]}),f&&Object.entries(f).map(([_,k])=>k?u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),u.jsx(Cc,{protocol:_,bindings:k},_)]}):null),l?u.jsx(Rh,{requestMessages:r,reply:l,isSend:p,operationId:t}):r.length>0&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[u.jsx("span",{className:"font-bold",children:t})," ",p?"accepts":"expects",r.length>1?u.jsxs(u.Fragment,{children:[u.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:"]}),h]}),s.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map((_,k)=>u.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:_.name},k))})]})]})}function Mh({operations:e,selectedKey:t=null,onSelectKey:n}){const i=f=>n==null?void 0:n(f);if(!Object.keys(e).length)return null;const r=t?e[t]:null,s=Object.keys(e).map(f=>{var E;const p=e[f],h=p.channel,g=h==null?void 0:h.address,_=h==null?void 0:h.parameters,k=p.action===sn.SEND,y=((E=p.action)==null?void 0:E.toUpperCase())??"",x=k?"bg-green-100 text-green-800":p.action===sn.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",w=t===f;return u.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),className:`group cursor-pointer ${w?"bg-neutral-50":""}`,children:[u.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:g&&u.jsx(dr,{address:g,parameters:_,truncate:!0})}),u.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:u.jsx("div",{className:`inline-flex w-24 items-center justify-center px-2 py-1 text-center rounded-md text-xs font-medium uppercase ${x}`,children:y})}),u.jsx("td",{className:"group-hover:bg-neutral-50"})]},f)}),o=r?r.channel:null,l=(r==null?void 0:r.action)===sn.SEND?"bg-green-100 text-green-800":(r==null?void 0:r.action)===sn.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",c=r&&(o!=null&&o.address)?u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium uppercase ${l}`,children:r.action}),u.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:u.jsx(dr,{address:o.address,parameters:o.parameters})})]}):t??"Operation",d=u.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{className:"bg-neutral-100 w-full",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),u.jsx("tbody",{className:"bg-surface divide-y divide-border",children:s})]})});return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{title:Eu,content:d,stickySideContent:!1})}),u.jsx(wl,{isOpen:!!r,side:"right",onClose:()=>i(null),title:c,children:r&&u.jsx(Ih,{op:r,id:t})})]})}function Ch({schemas:e,selectedKey:t}){const{deref:n}=zt(),i=ie.useMemo(()=>Object.entries(e).map(([s,o])=>[s,$r(o,n)]),[e,n]),r=i.length?u.jsx("div",{className:"grid gap-6 w-full",children:i.map(([s,o])=>{const a=o.schema,l=rc(o.schemaFormat),c=a.properties?Object.keys(a.properties).length:0;return u.jsxs("article",{id:`schema-${s}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===s?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-foreground",children:s}),o.description&&u.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:o.description})]}),u.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:a.type??"unknown"})]}),(a.format||l||c>0)&&u.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[a.format&&u.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",a.format]}),l&&u.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:o.schemaFormat,children:l}),c>0&&u.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[c," properties"]})]}),o.conversionError&&u.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"," ",ic(o.schemaFormat)??"the"," schema — showing raw definition. ",o.conversionError]}),o.conversionError&&typeof o.originalSchema=="string"?u.jsx("div",{className:"mt-4",children:u.jsx(Vl,{schema:o.originalSchema})}):u.jsx(lo,{schema:a,rootName:s,className:"mt-4"})]},s)})}):u.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 u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{content:r,stickySideContent:!1})})}const Lh=e=>typeof e=="object"&&e!==null,Ph=e=>e==="operations"||e==="messages"||e==="schemas";function Dh({asyncapi:e,config:t}){var pe,S,O,m,M,q,P,U;const n=t.show??{},i=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:_l}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:El}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Ol}]:[]],r=((pe=i[0])==null?void 0:pe.id)??"operations",[s,o]=ie.useState(r),[a,l]=ie.useState(null),[c,d]=ie.useState(null),[f,p]=ie.useState(null),h=i.some(B=>B.id===s)?s:r,g=n.operations!==!1?a:null,_=n.messages!==!1?c:null,k=n.schemas!==!1?f:null,y=ie.useMemo(()=>new Map,[]),[x,w]=ie.useState(null),[E,j]=ie.useState(null);ie.useEffect(()=>{y.clear()},[e,y]);const N=ie.useCallback(B=>{if(y.has(B))return y.get(B);const J=B.replace(/^#\//,"").split("/");let de=e;for(const X of J){if(!Lh(de)){de=void 0;break}const xe=X.replace(/~1/g,"/").replace(/~0/g,"~");if(de=de[xe],de==null)break}return de!==void 0&&y.set(B,de),de},[e,y]),R=((S=t.expand)==null?void 0:S.schemas)===!0,Z=(m=(O=t.theme)==null?void 0:O.depthColors)!=null&&m.length?t.theme.depthColors:Is,H=ie.useMemo(()=>({document:e,deref:N,portalHost:x,rootElement:E,defaultSchemaExpanded:R,depthColors:Z}),[e,N,x,E,R,Z]),K=h==="operations"?u.jsx(Mh,{operations:e.operations??{},selectedKey:g,onSelectKey:l}):h==="messages"?u.jsx(bh,{messages:((M=e.components)==null?void 0:M.messages)??{},selectedKey:_}):u.jsx(Ch,{schemas:((q=e.components)==null?void 0:q.schemas)??{},selectedKey:k}),Y=t.theme?Iu(t.theme):{};return u.jsx(bl.Provider,{value:H,children:u.jsxs("div",{ref:j,style:Y,className:`relative @container bg-background text-foreground p-2 ${n.sidebar!==!1?"pt-14":""}`,children:[u.jsx("div",{ref:w,className:"asyncapi-portal-root"}),n.info!==!1&&u.jsx(Mf,{...e.info}),n.servers!==!1&&e.servers&&Object.keys(e.servers).length>0&&u.jsx(Sh,{servers:e.servers}),n.sidebar!==!1&&u.jsx(ju,{info:e.info,operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(P=e.components)==null?void 0:P.messages:void 0,schemas:n.schemas!==!1?(U=e.components)==null?void 0:U.schemas:void 0,sidebarConfig:t.sidebar,activeTab:h,onTabChange:o,onItemSelect:(B,J)=>{o(B),l(B==="operations"?J:null),d(B==="messages"?J:null),p(B==="schemas"?J:null)},selectedItem:g?{tab:"operations",key:g}:_?{tab:"messages",key:_}:k?{tab:"schemas",key:k}:null}),u.jsx(su,{tabs:i,current:h,onChange:B=>{Ph(B)&&o(B)}}),u.jsx("div",{id:`panel-${h}`,role:"tabpanel","aria-labelledby":`tab-${h}`,children:K})]})})}const uo=e=>{const t=e.asyncapi,n=ie.useMemo(()=>iu(t),[t]),i=e.config??gl;return u.jsx(Dh,{asyncapi:n,config:i})};function Pc(e,t,n){e.registerSchemaParser(t);const i=e.parserRegistry,r=i.get.bind(i);i.get=s=>{const o=r(s);return o!==void 0?o:n(s)?t:void 0}}const Fh=["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 Bh(){return{validate:qh,parse:Uh,getMimeTypes:()=>Fh}}function zh(e){Pc(e,Bh(),xr)}function qh(e){return Xs(e.data).map(t=>({message:t,path:e.path}))}function Uh(e){var n,i;const t=Xs(e.data);if(t.length>0)return{[mr]:t[0]};try{const r=ks(e.data),s=e.meta.message,o=(i=(n=s==null?void 0:s.bindings)==null?void 0:n.kafka)==null?void 0:i.key;return o&&s&&(s["x-parser-original-bindings-kafka-key"]=o,s.bindings.kafka.key=ks(o)),r}catch(r){return{[mr]:r instanceof Error?r.message:"Failed to convert Avro schema"}}}const Hh=["application/vnd.google.protobuf","application/vnd.google.protobuf;version=2","application/vnd.google.protobuf;version=3"];function Vh(){return{validate:Jh,parse:Zh,getMimeTypes:()=>Hh}}function Wh(e){Pc(e,Vh(),br)}function Jh(e){return Td(e.data).map(t=>({message:t,path:e.path}))}function Zh(e){if(typeof e.data!="string")return{[mr]:"Protobuf schema must be a string of .proto source"};try{return so(e.data)}catch(t){return{[mr]:t instanceof Error?t.message:"Failed to convert Protobuf schema"}}}async function Xh(){try{const e=await Promise.resolve().then(()=>require("./index-Bzu7dxXe.cjs")).then(n=>n.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 Dc(e){const t=await Xh(),n=new t;zh(n),Wh(n);try{const{document:i,diagnostics:r}=await n.parse(e);return{diagnostics:r,document:i?$h(i):null}}catch(i){return{diagnostics:[{message:i instanceof Error?i.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Yh(e,t){const{diagnostics:n,document:i}=await Dc(e);return{diagnostics:n,view:i?u.jsx(uo,{kind:"resolved",asyncapi:i,config:t}):null}}function $h(e){return e.json()}function Kh({raw:e,config:t,onDiagnostics:n}){const[i,r]=ie.useState(null),s=ie.useRef(n);return s.current=n,ie.useEffect(()=>{let o=!0;return Dc(e).then(({document:a,diagnostics:l})=>{var c;o&&(r(a),(c=s.current)==null||c.call(s,l))}),()=>{o=!1}},[e]),i?u.jsx(uo,{kind:"resolved",asyncapi:i,config:t}):null}exports.AsyncAPI=uo;exports.AsyncAPIRenderer=Kh;exports.SchemaTabs=Rs;exports.SchemaTree=lo;exports.defaultConfig=gl;exports.getDefaultExportFromCjs=Ls;exports.parseAndRender=Yh;exports.useAsyncAPIDocument=zt;
154
+ `);break;default:i.push(r)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let r=e.charCodeAt(t),s=e.charCodeAt(t+2);for(let o=r;o<=s;o++)i.push(String.fromCharCode(o));t+=3;continue}i.push(e[t]),t++}return t++,{node:{type:"charClass",chars:i,negated:n},pos:t}}function or(e,t,n){if(t>=e.length)return{node:n,pos:t};let i=e[t],r,s;switch(i){case"*":r=0,s=5,t++;break;case"+":r=1,s=5,t++;break;case"?":r=0,s=1,t++;break;case"{":{let o=pp(e,t);if(o)r=o.min,s=o.max,t=o.pos;else return{node:n,pos:t};break}default:return{node:n,pos:t}}return t<e.length&&(e[t]==="?"||e[t]==="+")&&t++,{node:{type:"quantifier",node:n,min:r,max:s},pos:t}}function pp(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let i=parseInt(n[1],10),r;return n[2]===void 0?r=i:n[2]===""?r=i+5:r=parseInt(n[2],10),{min:i,max:r,pos:t+n[0].length}}function St(e){return e<10?`0${e}`:`${e}`}function hp(e,t){return new Date(e,t,0).getDate()}var wc="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function mp(e){return!(e==="^"||e==="$"||e==="^$")}function gp(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return yp(t);let o=t.formatRegistry.get(e.format);if(o){let a=o(t.random),l=t.minLength??e.minLength,c=t.maxLength??e.maxLength;return l!==void 0&&a.length<l?gs(a,l,t):c!==void 0&&a.length>c?a.slice(0,c):a}}if(e.pattern){let o=t.minLength??e.minLength,a=t.maxLength??e.maxLength;for(let d=0;d<50;d++){let f=rl(e.pattern,t.random);if(!(o!==void 0&&f.length<o)&&!(a!==void 0&&f.length>a))return f}let l=rl(e.pattern,t.random),c=mp(e.pattern);return o!==void 0&&l.length<o&&c?gs(l,o,t):a!==void 0&&l.length>a?l.slice(0,a):l}let n=e.minLength??0,i=e.maxLength??Math.max(n+10,10),r=t.random.int(n,i),s="";for(let o=0;o<r;o++)s+=t.random.pick([...wc]);return t.maxLength!==void 0&&s.length>t.maxLength&&(s=s.slice(0,t.maxLength)),t.minLength!==void 0&&s.length<t.minLength&&(s=gs(s,t.minLength,t)),s}function gs(e,t,n){for(;e.length<t;)e+=n.random.pick([...wc]);return e}function yp(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,i=t.getTime(),r=n.getTime(),s=i+e.random.next()*(r-i),o=new Date(s),a=o.getFullYear(),l=St(o.getMonth()+1),c=St(o.getDate());return`${a}-${l}-${c}T01:01:01.0Z`}function sl(e,t){if(e.const!==void 0)return structuredClone(e.const);if(e.enum!==void 0&&e.enum.length>0){let n=e.enum;if(e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0){let r=e.exclusiveMinimum??e.minimum??-1/0,s=e.exclusiveMaximum??e.maximum??1/0,o=e.exclusiveMinimum!==void 0,a=e.exclusiveMaximum!==void 0;n=n.filter(l=>{if(typeof l!="number")return!0;let c=o?l>r:l>=r,d=a?l<s:l<=s;if(!c||!d)return!1;if(e.multipleOf!==void 0){let f=e.multipleOf,p=f.toString().includes(".")?f.toString().split(".")[1].length:0,h=Math.pow(10,p),g=Math.round(l*h),_=Math.round(f*h);if(g%_!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let r=e.minLength??0,s=e.maxLength??1/0;n=n.filter(o=>typeof o!="string"?!0:o.length>=r&&o.length<=s)}if(e.minItems!==void 0||e.maxItems!==void 0){let r=e.minItems??0,s=e.maxItems??1/0;n=n.filter(o=>Array.isArray(o)?o.length>=r&&o.length<=s:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let r=e.minProperties??0,s=e.maxProperties??1/0;n=n.filter(o=>typeof o!="object"||o===null||Array.isArray(o)?!0:Object.keys(o).length>=r&&Object.keys(o).length<=s)}if(n.length===0){let r=[];throw e.minLength!==void 0&&r.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&r.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&r.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&r.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&r.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&r.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&r.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&r.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&r.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&r.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&r.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${r.join(", ")}] at ${t.path}`)}let i=t.random.pick(n);return typeof i=="object"&&i!==null?structuredClone(i):i}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Bt(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}Ec(t,n)}return t}function _c(e,t){if(typeof e=="boolean"||typeof t=="boolean")return{};if(typeof e!="object"||e===null)return typeof t=="object"&&t!==null?t:{};if(typeof t!="object"||t===null)return e;let n={...e};return Ec(n,t),n}function Ec(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=xp(e.type,t.type)),t.minimum!==void 0&&(e.minimum=e.minimum!==void 0?Math.max(e.minimum,t.minimum):t.minimum),t.maximum!==void 0&&(e.maximum=e.maximum!==void 0?Math.min(e.maximum,t.maximum):t.maximum),t.exclusiveMinimum!==void 0&&(e.exclusiveMinimum=e.exclusiveMinimum!==void 0?Math.max(e.exclusiveMinimum,t.exclusiveMinimum):t.exclusiveMinimum),t.exclusiveMaximum!==void 0&&(e.exclusiveMaximum=e.exclusiveMaximum!==void 0?Math.min(e.exclusiveMaximum,t.exclusiveMaximum):t.exclusiveMaximum),t.multipleOf!==void 0&&(e.multipleOf=t.multipleOf),t.minLength!==void 0&&(e.minLength=e.minLength!==void 0?Math.max(e.minLength,t.minLength):t.minLength),t.maxLength!==void 0&&(e.maxLength=e.maxLength!==void 0?Math.min(e.maxLength,t.maxLength):t.maxLength),t.pattern!==void 0&&(e.pattern=t.pattern),t.format!==void 0&&(e.format=t.format),t.minItems!==void 0&&(e.minItems=e.minItems!==void 0?Math.max(e.minItems,t.minItems):t.minItems),t.maxItems!==void 0&&(e.maxItems=e.maxItems!==void 0?Math.min(e.maxItems,t.maxItems):t.maxItems),t.uniqueItems&&(e.uniqueItems=!0),t.items!==void 0&&(e.items=t.items),t.prefixItems!==void 0)if(e.prefixItems===void 0)e.prefixItems=t.prefixItems;else{let n=[],i=Math.max(e.prefixItems.length,t.prefixItems.length);for(let r=0;r<i;r++){let s=e.prefixItems[r],o=t.prefixItems[r];s!==void 0&&o!==void 0?n.push(_c(s,o)):s!==void 0?n.push(s):o!==void 0&&n.push(o)}e.prefixItems=n}if(t.contains!==void 0&&(e.containsAll!==void 0?e.containsAll=[...e.containsAll,t.contains]:e.contains!==void 0?(e.containsAll=[e.contains,t.contains],delete e.contains):e.contains=t.contains),t.properties&&(e.properties=bp(e.properties??{},t.properties)),t.required&&(e.required=[...new Set([...e.required??[],...t.required])]),t.additionalProperties!==void 0&&(e.additionalProperties=t.additionalProperties),t.patternProperties&&(e.patternProperties={...e.patternProperties??{},...t.patternProperties}),t.minProperties!==void 0&&(e.minProperties=e.minProperties!==void 0?Math.max(e.minProperties,t.minProperties):t.minProperties),t.maxProperties!==void 0&&(e.maxProperties=e.maxProperties!==void 0?Math.min(e.maxProperties,t.maxProperties):t.maxProperties),t.const!==void 0&&(e.const=t.const),t.enum!==void 0)if(e.enum!==void 0){let n=new Set(t.enum.map(i=>JSON.stringify(i)));e.enum=e.enum.filter(i=>n.has(JSON.stringify(i)))}else e.enum=t.enum;t.$ref&&(e.$ref=t.$ref),t.$defs&&(e.$defs={...e.$defs??{},...t.$defs}),t.allOf&&(e.allOf=[...e.allOf??[],...t.allOf]),t.anyOf&&(e.anyOf=t.anyOf),t.oneOf&&(e.oneOf=t.oneOf)}function xp(e,t){let n=Array.isArray(e)?e:[e],i=Array.isArray(t)?t:[t],r=n.filter(s=>i.includes(s));return r.length===0?n[0]:r.length===1?r[0]:r}function bp(e,t){let n={...e};for(let[i,r]of Object.entries(t)){let s=e[i];s===void 0?n[i]=r:typeof s=="object"&&typeof r=="object"?n[i]=_c(s,r):n[i]=r}return n}var ri=new Set(["$schema","$id","$ref","$defs","$anchor","$dynamicRef","$dynamicAnchor","$vocabulary","$comment","type","enum","const","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","minLength","maxLength","pattern","format","contentEncoding","contentMediaType","contentSchema","items","prefixItems","contains","minItems","maxItems","uniqueItems","minContains","maxContains","properties","required","additionalProperties","patternProperties","minProperties","maxProperties","propertyNames","dependentRequired","dependentSchemas","allOf","anyOf","oneOf","not","if","then","else","faker","chance","jsonPath","template","default","examples","description","title","readOnly","writeOnly","deprecated"]);function Oc(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>ri.has(t))}function ol(e,t){if(typeof t!="object"||t===null)return!1;let n=t;return n.const!==void 0?e===n.const:n.enum!==void 0?n.enum.some(i=>i===e):!1}function vp(e){return typeof e=="boolean"?!e:typeof e!="object"||e===null?!1:e.not===!0||typeof e.not=="object"&&e.not!==null&&Object.keys(e.not).length===0}function wp(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[i,r]of Object.entries(e))ri.has(i)||(Oc(r)?(t[i]=r,n=!0):(t[i]={const:r},n=!0));if(n)return t}return{}}function _p(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function Ep(e,t){var x;let n=wp(e),i=_p(e,n);if(t.depth>=t.maxDepth){if(i.length===0)return{};let w={};for(let E of i){let j=n[E];if(j&&typeof j=="object"&&j!==null){let N=j;N.const!==void 0?w[E]=N.const:N.default!==void 0?w[E]=N.default:N.enum!==void 0&&N.enum.length>0?w[E]=N.enum[0]:w[E]=Tp(N.type)}else w[E]=null}return w}if(e.additionalProperties===!1){let w=Object.keys(n).length>0,E=e.patternProperties&&Object.keys(e.patternProperties).length>0,j=new Set(Object.keys(n)),N=[...new Set(i)].filter(R=>!j.has(R));if((e.minProperties??0)>0&&!w&&!E)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(N.length>0&&!E&&!w)throw Error(`missing properties for ${N.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let r=t.path==="/"?"/properties":`${t.path}/properties`,s={...t,depth:t.depth+1,path:r},o={},a=new Set,l=new Set(i),c=t.alwaysFakeOptionals??!1,d=t.fillProperties??!0,f=t.fixedProbabilities??!1,p=t.optionalsProbability??.5,h=Object.keys(n).filter(w=>!l.has(w)),g;if(f&&!c&&h.length>0){let w=Math.round(h.length*p);g=new Set(h.slice(0,w))}let _=w=>c?!0:g?g.has(w):t.random.bool(p);if(Object.keys(n).length>0)for(let[w,E]of Object.entries(n)){if(vp(E))continue;a.add(w);let j=tn(s,w),N=l.has(w),R=typeof E=="object"&&E!==null&&E.type==="object",Z=E;if(e.patternProperties&&typeof E=="object"&&E!==null){let H=[];for(let[K,Y]of Object.entries(e.patternProperties))try{new RegExp(K).test(w)&&H.push(Y)}catch{}H.length>0&&(Z=Bt([E,...H]))}if(N){let H=await Ne(Z,j);H!==void 0&&(o[w]=H)}else if(_(w)){let H=await Ne(Z,j);H!==void 0&&(o[w]=H)}else if(R&&!d){let H=E.required??[];if(H.length>0){let K={};for(let Y of H){let pe=(E.properties??{})[Y]??{},S=tn(j,Y),O=await Ne(pe,S);O!==void 0&&(K[Y]=O)}o[w]=K}}}for(let w of l)if(!(o[w]!==void 0||a.has(w))){if(e.patternProperties){let E=[];for(let[j,N]of Object.entries(e.patternProperties))new RegExp(j).test(w)&&E.push(N);if(E.length>0){let j=E.length===1?E[0]:Bt(E),N=tn(s,w),R=await Ne(j,N);R!==void 0&&(o[w]=R),a.add(w)}}if(!a.has(w)){let E=e.additionalProperties??!0;if(E!==!1){let j=tn(s,w),N=await Ne(E===!0?{}:E,j);N!==void 0&&(o[w]=N),a.add(w)}}}if(e.dependencies){for(let[w,E]of Object.entries(e.dependencies))if(!(typeof E!="object"||E===null||Array.isArray(E))&&o[w]!==void 0&&!a.has(w+"_dep")){a.add(w+"_dep");let j=E.oneOf??E.anyOf??E.allOf??[E],N=null;for(let R of j){if(typeof R!="object"||R===null)continue;let{properties:Z,not:H}=R;if(Z&&Z[w]){let K=Z[w],Y=o[w];if(ol(Y,K)){N=R;break}}if(H!=null&&H.properties){let K=H.properties[w];if(K){let Y=o[w];if(!ol(Y,K)){N=R;break}}}}if(!N&&j.length>0&&typeof j[0]=="object"&&(N=j[0]),N!=null&&N.not){let R=N.not;if(R.required&&Array.isArray(R.required))for(let Z of R.required)delete o[Z]}if(N!=null&&N.required)for(let R of N.required){if(R===w||o[R]!==void 0)continue;let Z=((x=N.properties)==null?void 0:x[R])??{type:"object"},H=tn(s,R),K=await Ne(Z,H);K!==void 0&&(o[R]=K)}if(N&&N.properties)for(let[R,Z]of Object.entries(N.properties)){if(R===w)continue;let H=tn(s,R),K=await Ne(Z,H);K!==void 0&&(o[R]=K)}}}let k=e.minProperties??0,y=e.maxProperties;if(Object.keys(o).length<k){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let w=Object.entries(e.patternProperties),E=0,j=1e3;for(;Object.keys(o).length<k&&E<j;){E++;let[N,R]=t.random.pick(w),Z=Ap(N,t);if(Z&&!o[Z]){let H=tn(s,Z),K=await Ne(R,H);K!==void 0&&(o[Z]=K),a.add(Z)}}}if(Object.keys(o).length<k){let w=e.additionalProperties,E=w===void 0||w===!0?{type:"string"}:w;if(E!==!1){let j=0,N=1e3;for(;Object.keys(o).length<k&&j<N;){j++;let R=`prop${t.random.int(0,99999)}`;if(!o[R]){let Z=tn(s,R),H=await Ne(E,Z);H!==void 0&&(o[R]=H),a.add(R)}}}}if(Object.keys(o).length<k){let w=Object.keys(n).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${t.path}`)}}if(y!==void 0&&Object.keys(o).length>y){let w=Object.keys(o).filter(E=>!l.has(E));for(t.random.shuffle(w);Object.keys(o).length>y&&w.length>0;){let E=w.pop();delete o[E]}}return t.pruneProperties&&t.pruneProperties.length>0&&Ts(o,t.pruneProperties),kp(o,n),o}function tn(e,t){let n=Op(t),i=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:i}}function Op(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function kp(e,t){for(let[n,i]of Object.entries(t)){if(typeof i!="object"||i===null)continue;let r=i;if(r.template===void 0)continue;let s=r.template;if(typeof s!="string")continue;let o=s.replace(/#\{(\w+)\}/g,(a,l)=>{let c=e[l];return c!==void 0?String(c):""});e[n]=o}}function Ap(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let l=n[1],c=n[2];if(c===".*"||c!=null&&c.includes("?:")){let d=t.random.int(0,10),f="";for(let p=0;p<d;p++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return l+f}return l}let i=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(i){let l=i[2],c=t.random.int(1,10),d="";for(let f=0;f<c;f++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return d+l}let r=e.match(/^\^([a-zA-Z]+)\$$/);if(r)return r[1];let s=t.random.int(3,10),o="abcdefghijklmnopqrstuvwxyz",a="";for(let l=0;l<s;l++)a+=t.random.pick(o.split(""));try{if(new RegExp(e).test(a))return a}catch{}return null}function Ts(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let i of e)Ts(i,t);return}let n=e;for(let i of Object.keys(n))t.includes(i)?delete n[i]:Ts(n[i],t)}function Tp(e){switch(Array.isArray(e)?e[0]:e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"array":return[];case"object":return{};default:return null}}async function Np(e,t){var y;if(t.depth>=t.maxDepth){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}if(t.refDepthReached){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let x=((y=e.prefixItems)==null?void 0:y.length)??0;if((e.minItems??0)>x)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${x})`)}let n=t.path==="/"?"/items":`${t.path}/items`,i={...t,depth:t.depth+1,path:n},r=[],s=t.refDepthMax,o=t.minItems??e.minItems??0,a=t.maxItems??e.maxItems??Math.max(o,t.maxDefaultItems);e.maxItems!==void 0&&a>e.maxItems&&(a=e.maxItems),e.minItems!==void 0&&o<e.minItems&&(o=e.minItems),a<o&&(e.maxItems!==void 0?o=a:a=o),t.alwaysFakeOptionals&&(a=Math.max(o,a));let l=e.uniqueItems?new Set:null,c=async(x,w)=>{let E=await Ne(x,w);if(E===void 0)return"omitted";if(l){let j=JSON.stringify(E);if(l.has(j)){for(let N=0;N<50;N++){if(E=await Ne(x,nn(i,r.length)),E===void 0)continue;let R=JSON.stringify(E);if(!l.has(R))return l.add(R),r.push(E),"added"}return"failed"}l.add(j)}return r.push(E),"added"};if(e.prefixItems)for(let x=0;x<e.prefixItems.length&&r.length<a;x++){let w=nn(i,x);if(await c(e.prefixItems[x],w)==="failed")break}let d;if(s!==void 0&&t.refDepth>=s-1){let x=e.minItems??0;return x>0?Array.from({length:x},()=>null):[]}let f=t.alwaysFakeOptionals??!1,p=t.fixedProbabilities??!1,h=t.optionalsProbability??.5;if(f)d=a;else if(p){let x=a-Math.max(o,r.length),w=Math.round(x*h);d=Math.max(o,r.length)+w}else d=t.random.int(Math.max(o,r.length),a);e.items;let g=e.prefixItems!==void 0,_=e.additionalItems!==void 0,k;if(g?_?k=e.additionalItems:e.items!==void 0&&(k=e.items):k=e.items,k!==!1&&k!==void 0){let x=k??{},w=0,E=Math.max(d*20,50);for(;r.length<d;){let j=await c(x,nn(i,r.length));if(j==="added"){w=0;continue}if(w++,j==="failed"||w>=E)break}}if(e.contains){let x=e.minContains??1,w=e.maxContains??Math.max(x,1),E=t.random.int(x,w);for(let j=0;j<E;j++){let N=await Ne(e.contains,nn(i,r.length));if(N!==void 0){if(l){let R=JSON.stringify(N);if(l.has(R)){let Z=!1;for(let H=0;H<50;H++){if(N=await Ne(e.contains,nn(i,r.length)),N===void 0)continue;let K=JSON.stringify(N);if(!l.has(K)){l.add(K),Z=!0;break}}if(!Z)continue}else l.add(R)}if(r.length<a){let R=t.random.int(0,r.length);r.splice(R,0,N)}else if(r.length>0){let R=t.random.int(0,r.length-1);r[R]=N}}}for(;r.length>a;)r.pop()}if(e.containsAll){let x=new Set;for(let w of e.containsAll){let E=await Ne(w,nn(i,r.length));if(E!==void 0){if(l){let j=JSON.stringify(E);if(l.has(j)){let N=!1;for(let R=0;R<50;R++){if(E=await Ne(w,nn(i,r.length)),E===void 0)continue;let Z=JSON.stringify(E);if(!l.has(Z)){l.add(Z),N=!0;break}}if(!N)continue}else l.add(j)}if(r.length<a){let j=t.random.int(0,r.length);r.splice(j,0,E);let N=new Set;for(let R of x)N.add(R>=j?R+1:R);x.clear();for(let R of N)x.add(R);x.add(j)}else if(r.length>0){let j=Array.from({length:r.length},(N,R)=>R).filter(N=>!x.has(N));if(j.length>0){let N=j[t.random.int(0,j.length-1)];r[N]=E,x.add(N)}else r.push(E),x.add(r.length-1)}}}for(;r.length>a;)r.pop()}return e.uniqueItems&&r.length>0?jp(r,e,i,o,a,l):r}async function jp(e,t,n,i,r,s){let o=t.items??{},a=0,l=100;for(;e.length<i&&a<l;){a++;let c=await Ne(o,nn(n,e.length));if(c===void 0)continue;let d=JSON.stringify(c);s.has(d)||(s.add(d),e.push(c))}for(;e.length>r;)e.pop();return e}function nn(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function al(e,t){if(!t||t==="")return e;if(typeof e!="object"||e===null)throw Error(`Cannot resolve fragment "${t}" in non-object schema`);if(t.startsWith("/"))return Sp(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function Sp(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),i=e;for(let r of n){let s=r.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof i!="object"||i===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${s}"`);if(Array.isArray(i)){let o=parseInt(s,10);if(isNaN(o)||o<0||o>=i.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${s}"`);i=i[o]}else{if(!(s in i))throw Error(`Cannot resolve JSON pointer "${t}": property "${s}" not found`);i=i[s]}}return i}function Rp(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,i=n.$id,{$id:r,...s}=n;t.set(i,s)}if(e.$defs)for(let[n,i]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,i);return t}async function Qr(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let i=t.refDepth+1;if(t.refDepthMax!==void 0&&i>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}};if(t.refStack.has(n)){if(t.refDepthMax!==void 0){if(t.refDepth>=t.refDepthMax)return{schema:{},ctx:{...t,refDepthReached:!0}}}else if(t.depth>=t.maxDepth)return{schema:{type:"null"},ctx:t}}let r,s;if(n.startsWith("#/")){if(r=t.refRegistry.get(n),r===void 0&&n.length>2){let f=t.refRegistry.get("#");if(f!==void 0&&typeof f=="object")try{r=al(f,n.slice(1))}catch{}}r===void 0&&t.refResolver&&(r=await t.refResolver(n),r!==void 0&&t.refRegistry.set(n,r))}else if(n==="#")r=t.refRegistry.get("#")??{};else if(r=t.refRegistry.get(n),r===void 0&&t.refResolver){s=await t.refResolver(n);let f=n.indexOf("#");if(f!==-1){let p=n.slice(f+1);p?r=al(s,p):r=s}else r=s;if(s&&typeof s=="object"&&s!==null){let p=s;if(p.$defs)for(let[h,g]of Object.entries(p.$defs))t.refRegistry.set(`#/$defs/${h}`,g)}}if(r===void 0)throw Error(`Unresolved $ref: ${n}`);let o=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:a,...l}=e,c=Object.fromEntries(Object.entries(l).filter(([f])=>!o.has(f)));Object.keys(c).length>0&&typeof r=="object"&&r!==null&&(r={...r,...c});let d={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:r,ctx:d}}function Ip(e,t){typeof e!="boolean"&&(t.set("#",e),Ns(e,"#",t))}function Ns(e,t,n){if(e.$id){let{$id:i,...r}=e;n.set(i,r)}if(e.$defs)for(let[i,r]of Object.entries(e.$defs)){let s=`${t}/$defs/${i}`;n.set(s,r),typeof r=="object"&&r!==null&&Ns(r,s,n)}if(e.properties)for(let[i,r]of Object.entries(e.properties))typeof r=="object"&&r!==null&&Ns(r,`${t}/properties/${i}`,n)}async function Mp(e,t){return e.$ref?(await Qr(e,t)).schema:e}async function Cp(e,t){let n=[];for(let i of e)if(typeof i=="object"&&i!==null&&"$ref"in i){let r=await Mp(i,t);n.push(r)}else typeof i=="object"&&i!==null&&n.push(i);return n}async function Lp(e,t){let{allOf:n,anyOf:i,oneOf:r,not:s,if:o,then:a,else:l,...c}=e;if(n){let d=await Cp(n,t),f=Bt([c,...d]);return Ne(f,t)}if(r){let d=t.random.shuffle([...r]),f=c.required??[];for(let w of d){let E=typeof w=="object"&&w!==null?w:{};E.$ref&&(E=(await Qr(E,t)).schema);let j=E.required??[],N=[...new Set([...f,...j])],R={...c,required:N},Z=Bt([R,E]),H={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await Ne(Z,H)}catch{}}let p=r[0],h=typeof p=="object"&&p!==null?p:{};h.$ref&&(h=(await Qr(h,t)).schema);let g=h.required??[],_=[...new Set([...f,...g])],k={...c,required:_},y=Bt([k,h]),x={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return Ne(y,x)}if(i){let d=t.random.shuffle([...i]);for(let h of d){let g=Bt([c,h]);try{return await Ne(g,t)}catch{}}let f=i[0],p=Bt([c,f]);return Ne(p,t)}return o!==void 0?Pp(c,o,a,l,t):s?Dp(c,s,t):Ne(c,t)}async function Pp(e,t,n,i,r){if(n!==void 0){let s=Bt([e,t,n]);try{return await Ne(s,r)}catch{}}if(i!==void 0){let s=Bt([e,i]);try{return await Ne(s,r)}catch{}}return Ne(e,r)}async function Dp(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return Ne(e,n)}if(t.type&&!t.enum&&!t.const){let i=Array.isArray(t.type)?t.type:[t.type],r=["string","number","integer","boolean","null","object","array"].filter(s=>!i.includes(s));if(r.length>0){let s=n.random.pick(r),o=Bt([e,{type:s}]);return Ne(o,n)}}if(t.const!==void 0||t.enum!==void 0){let i=t.enum??[t.const],r=new Set(i.map(s=>JSON.stringify(s)));for(let s=0;s<20;s++){let o=await Ne(e,n);if(!r.has(JSON.stringify(o)))return o}}return Ne(e,n)}class Fp{constructor(){Ee(this,"extensions",new Map)}define(t,n){this.extensions.set(t,{callback:n,context:{}})}has(t){return this.extensions.has(t)}reset(t){if(t){let n=this.extensions.get(t);n&&(n.context={},this.extensions.delete(t))}else this.extensions.clear()}keys(){return this.extensions.keys()}generate(t,n){let i=Object.keys(t);for(let r=i.length-1;r>=0;r--){let s=i[r],o=s.startsWith("x-")?s.slice(2):s,a=this.extensions.get(o);if(a){let l=t[s],c=a.callback.call(a.context,l,t,n);if(c!==void 0)return c}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var Bp=new Fp;function zp(e,t){return Bp.generate(e,t)}var qp=["string","number","integer","boolean","null","object","array"];function ll(e,t,n){if(e.faker!==void 0&&e.chance!==void 0)throw Error(`ambiguous generator: both faker and chance are defined in ${t.path}`);if(e.faker!==void 0)try{let i=Up(e.faker,t),r=ul(i,n??e.type,t.path);return typeof r=="string"&&e.format?cl(r,e.format,t):r}catch{}if(e.chance!==void 0)try{let i=Hp(e.chance,t),r=ul(i,n??e.type,t.path);return typeof r=="string"&&e.format?cl(r,e.format,t):r}catch{}}function cl(e,t,n){if(t==="date"){let i=typeof e=="string"?new Date(e):e;if(i instanceof Date&&!isNaN(i.getTime())){let r=i.getFullYear(),s=St(i.getMonth()+1),o=St(i.getDate());return`${r}-${s}-${o}`}if(typeof e=="string"){let r=Date.parse(e);if(!isNaN(r)){let s=new Date(r),o=s.getFullYear(),a=St(s.getMonth()+1),l=St(s.getDate());return`${o}-${a}-${l}`}}}if(t==="date-time"){let i=typeof e=="string"?new Date(e):e;if(i instanceof Date&&!isNaN(i.getTime()))return i.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function ul(e,t,n){if(t===void 0)return e;let i=Array.isArray(t)?t[0]:t;switch(i){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let r=Number(e);return i==="integer"?Math.floor(r):r;case"boolean":return!!e;case"null":return null;default:return e}}function Up(e,t){var o;if(!((o=t.extensions)!=null&&o.faker)){let a=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${a} in ${t.path}`)}let n,i;if(typeof e=="object"&&e!==null){let a=e,l=Object.keys(a);if(l.length>0)n=l[0],i=a[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let r=n.split("."),s=t.extensions.faker;for(let a of r)try{s=s[a]}catch{throw Error(`failed to resolve .${a} (${n})`)}if(typeof s=="function")return i?s(...i):s();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function Hp(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let i=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${i} in ${t.path}`)}if(typeof e=="string"){let i=t.extensions.chance[e];if(typeof i=="function")return i.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let i=e,r=Object.keys(i)[0],s=i[r],o=t.extensions.chance[r];if(typeof o=="function")return s?o.call(t.extensions.chance,s):o.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function Vp(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function tt(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function Ne(e,t){if(e===!0)return Ne({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let s=e,o=null;for(let[a,l]of Object.entries(t.propAliases))a in s&&!(l in s)&&(o||(o={...s}),o[l]=o[a],delete o[a]);o&&(e=o)}let n;if(Array.isArray(e.type)){let s=e.type;n=t.random.pick(s);let o={...t,resolvedType:n},a=ll(e,o,n);if(a!==void 0)return typeof a=="string"&&o.maxLength!==void 0&&a.length>o.maxLength?tt(a.slice(0,o.maxLength),e,o):tt(a,e,o)}else{let s=ll(e,t,n);if(s!==void 0)return typeof s=="string"&&t.maxLength!==void 0&&s.length>t.maxLength?tt(s.slice(0,t.maxLength),e,t):tt(s,e,t)}let i=zp(e,t);if(i!==void 0)return tt(i,e,t);if(e.$ref){let s=await Qr(e,t);return Ne(s.schema,Vp(s.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return Lp(e,t);if(e.const!==void 0)return tt(sl(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return tt(e.default,e,t);if(e.enum!==void 0)return tt(sl(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return tt(t.random.pick(e.examples),e,t);if(e.example!==void 0)return tt(e.example,e,t)}let r=Wp(e,t);if(r===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let s=t.defaultInvalidTypeProduct;return typeof s=="string"?Zp(s):s}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(r){case"null":return tt(sp(),e,t);case"boolean":return tt(op(t),e,t);case"number":return tt(bc(e,t),e,t);case"integer":return tt(lp(e,t),e,t);case"string":return tt(gp(e,t),e,t);case"object":return tt(await Ep(e,t),e,t);case"array":return tt(await Np(e,t),e,t);default:throw Error(`Unknown type: ${r} at ${t.path}`)}}function Wp(e,t){return t.resolvedType!==void 0?t.resolvedType:typeof e.type=="string"?["string","number","integer","boolean","null","object","array"].includes(e.type)?e.type:null:Array.isArray(e.type)?t.random.pick(e.type):e.properties||e.required||e.additionalProperties!==void 0||e.patternProperties||e.minProperties!==void 0||e.maxProperties!==void 0||Jp(e)?"object":e.items||e.prefixItems||e.contains||e.minItems!==void 0||e.maxItems!==void 0||e.uniqueItems?"array":e.minimum!==void 0||e.maximum!==void 0||e.exclusiveMinimum!==void 0||e.exclusiveMaximum!==void 0||e.multipleOf!==void 0?"number":e.minLength!==void 0||e.maxLength!==void 0||e.pattern||e.format||e.faker!==void 0||e.chance!==void 0?"string":t.random.pick(qp)}function Jp(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(ri.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function Zp(e,t){switch(e){case"string":return"";case"number":case"integer":return 0;case"boolean":return!1;case"null":return null;case"object":return{};case"array":return[];default:return null}}function Xp(e){let t=kc(e),n=Ac(e);return`${t}T${n}`}function kc(e){let t=e.int(2e3,2030),n=e.int(1,12),i=hp(t,n),r=e.int(1,i);return`${t}-${St(n)}-${St(r)}`}function Ac(e){let t=e.int(0,23),n=e.int(0,59),i=e.int(0,59);return`${St(t)}:${St(n)}:${St(i)}Z`}var Yp=["alice","bob","charlie","dave","eve","frank","grace","heidi"],$p=["example.com","test.org","demo.net","sample.io"];function fl(e){let t=e.pick(Yp),n=e.int(1,999),i=e.pick($p);return`${t}${n}@${i}`}var Kp=["https"],Qp=["example.com","test.org","demo.net"],Gp=["api","v1","users","items","data","resource"];function Ur(e){let t=e.pick(Kp),n=e.pick(Qp),i=e.int(1,3),r=[];for(let s=0;s<i;s++)r.push(e.pick(Gp));return`${t}://${n}/${r.join("/")}`}var eh=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],th=["com","org","net","io","dev"];function dl(e){let t=e.int(1,3),n=[];for(let i=0;i<t;i++)n.push(e.pick(eh));return n.push(e.pick(th)),n.join(".")}function nh(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function rh(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function ih(e){let t=n=>{let i="";for(let r=0;r<n;r++)i+=e.int(0,15).toString(16);return i};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var sh=["foo","bar","baz","items","0","1","2","name","value"];function pl(e){let t=e.int(1,4),n=[];for(let i=0;i<t;i++)n.push(e.pick(sh));return"/"+n.join("/")}function oh(e){let t=["P"],n=e.bool(),i=e.bool();return n&&(e.bool()&&t.push(`${e.int(0,100)}Y`),e.bool()&&t.push(`${e.int(0,12)}M`),e.bool()&&t.push(`${e.int(0,30)}D`)),i&&(t.push("T"),e.bool()&&t.push(`${e.int(0,23)}H`),e.bool()&&t.push(`${e.int(0,59)}M`),e.bool()&&t.push(`${e.int(0,59)}S`)),(t.length===1||t.length===2&&t[1]==="T")&&t.push("0D"),t.join("")}var ah=new Map([["date-time",Xp],["date",kc],["time",Ac],["duration",oh],["email",fl],["idn-email",fl],["uri",Ur],["uri-reference",Ur],["iri",Ur],["iri-reference",Ur],["hostname",dl],["idn-hostname",dl],["ipv4",nh],["ipv6",rh],["uuid",ih],["json-pointer",pl],["relative-json-pointer",e=>`${e.int(0,5)}${pl(e)}`]]);function Tc(e){let t=new Map(ah);if(e)for(let[n,i]of Object.entries(e))t.set(n,i);return t}function lh(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),i=[t];for(let r of n){if(r==="")continue;let s=[];for(let o of i)if(o!=null)if(r==="*")Array.isArray(o)&&s.push(...o);else if(/^\d+$/.test(r)){let a=parseInt(r,10);Array.isArray(o)&&a<o.length&&s.push(o[a])}else r===""?js(o,s):typeof o=="object"&&o!==null&&r in o&&s.push(o[r]);i=s}return i}function js(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),js(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),js(n,t)}}function ch(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[i,r]of Object.entries(e))ri.has(i)||(Oc(r)?(t[i]=r,n=!0):(t[i]={const:r},n=!0));if(n)return t}return{}}async function Ss(e,t,n,i){if(!n.resolveJsonPath)return e;let r=i??e;if(t===!0||t===!1||t.$ref)return e;let s=t;if(s.allOf||s.anyOf||s.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let o={...e},a=ch(s);for(let[l,c]of Object.entries(a))if(l in o){let d=o[l];if(typeof c=="object"&&c!==null&&"jsonPath"in c&&typeof c.jsonPath=="string"){let f=lh(c.jsonPath,r);f.length>0&&(o[l]=n.random.pick(f))}else{let f=await Ss(d,c,n,r);o[l]=f}}return o}if(Array.isArray(e)&&s.items){let o=[];for(let a of e){let l=await Ss(a,s.items,n,r);o.push(l)}return o}return e}var uh=Tc(),hl=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function fh(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let f=e.$schema;if(typeof f=="string"&&!hl.has(f))throw Error(`Unsupported JSON Schema version: ${f}. Supported versions: ${[...hl].join(", ")}`)}let n=ph(t),i=xc((t==null?void 0:t.seed)??1),r=n.propAliases?dh(e,n.propAliases):e,s=Rp(r);Ip(r,s);let o=n.formats?Tc(n.formats):new Map(uh),a=n.refDepthMin??n.refDepth,l=n.refDepthMax??n.refDepth;if(a!==void 0&&l!==void 0&&a>l)throw Error(`refDepthMin (${a}) cannot be greater than refDepthMax (${l})`);let c={random:i,maxDepth:n.maxDepth??(l?l+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:s,refStack:new Set,formatRegistry:o,refResolver:n.refResolver,minItems:n.minItems,maxItems:n.maxItems,minLength:n.minLength,maxLength:n.maxLength,useDefaultValue:n.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:n.alwaysFakeOptionals,fixedProbabilities:n.fixedProbabilities,fillProperties:n.fillProperties,extensions:n.extensions,resolveJsonPath:n.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:a,refDepthMax:l,useExamplesValue:n.useExamplesValue,pruneProperties:n.pruneProperties,failOnInvalidTypes:n.failOnInvalidTypes,defaultInvalidTypeProduct:n.defaultInvalidTypeProduct,minDateTime:n.minDateTime,maxDateTime:n.maxDateTime,propAliases:n.propAliases,outputTransform:n.outputTransform},d=await Ne(r,c);return n.resolveJsonPath?Ss(d,e,c,d):d}function dh(e,t){if(typeof e!="object"||e===null)return e;let n=e,i=null;for(let[r,s]of Object.entries(t))r in n&&!(s in n)&&(i||(i={...n}),i[s]=i[r],delete i[r]);return i??e}function ph(e){if(!e)return{};let t=e,n={...e};return t.requiredOnly===!0&&n.optionalsProbability===void 0&&(n={...n,optionalsProbability:0,alwaysFakeOptionals:!1}),t.ignoreProperties&&t.ignoreProperties.length>0&&(n={...n,outputTransform:hh(n.outputTransform,mh(t.ignoreProperties))}),n}function hh(e,t){return e?t?async(n,i,r)=>{let s=await e(n,i,r);return t(s,i,r)}:e:t}function mh(e){return(t,n,i)=>{if(i==="/")return t;let r=gh(i.slice(i.lastIndexOf("/")+1));return e.some(s=>typeof s=="string"?s===r:s instanceof RegExp?s.test(r):s(n))?void 0:t}}function gh(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Nc(e,t=new Set){if(t.has(e))return e;if(e.type==="object"&&e.properties&&typeof e.properties=="object"){t.add(e);try{const n={};for(const[i,r]of Object.entries(e.properties)){const s=/id$/i.test(i)&&r.type==="string"&&!r.format&&!r.examples,o=r.type==="string"&&!r.format&&!r.examples&&!r.enum;n[i]=s?{...r,format:"uuid"}:o?{...r,examples:["string"]}:Nc(r,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}function yh({schema:e}){const[t,n]=ie.useState(null);if(ie.useEffect(()=>{let r=!1;try{fh(Nc(e),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(s=>{r||n(s)}).catch(()=>{})}catch{}return()=>{r=!0}},[e]),t===null)return null;const i=JSON.stringify(t,null,2);return u.jsxs("div",{children:[u.jsx(Hl,{code:i}),u.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function Rs({schema:e,label:t,description:n,schemaFormat:i,originalSchema:r,conversionError:s}){const o=rc(i),a=Rd(i,s),[l,c]=ie.useState(a?"example":"schema");return ie.useEffect(()=>{!a&&l==="example"&&c("schema")},[a,l]),u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsxs("div",{children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),o&&u.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:i,children:o})]}),n&&u.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:n})]}),u.jsx(yc,{tabs:[...a?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:l,onChange:d=>c(d),ariaLabel:"Schema view toggle"})]}),s&&u.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 ",ic(i)??"the"," schema — showing raw definition. ",s]}),l==="schema"&&u.jsx(lo,{schema:e,rootName:t}),l==="json"&&u.jsx(Vl,{schema:r??e}),l==="example"&&a&&u.jsx(yh,{schema:e})]})}function jc({message:e,expanded:t,onToggleExpanded:n,paddingX:i="px-4"}){const[r,s]=ie.useState("payload"),{deref:o}=zt(),a=ie.useMemo(()=>e.payload?$r(e.payload,o):null,[e.payload,o]),l=ie.useMemo(()=>e.headers?$r(e.headers,o):null,[e.headers,o]),c=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:u.jsx("div",{className:"overflow-hidden",children:u.jsxs("div",{className:`${i} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&u.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&u.jsxs("div",{children:[e.payload&&e.headers&&u.jsx(Cs,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:r,onChange:d=>s(d)}),u.jsxs("div",{className:"mt-4",children:[(r==="payload"||!e.headers)&&a&&u.jsx(Rs,{schema:a.schema,label:"Payload",description:a.description,schemaFormat:a.schemaFormat,originalSchema:a.originalSchema,conversionError:a.conversionError}),(r==="headers"||!e.payload)&&l&&u.jsx(Rs,{schema:l.schema,label:"Headers",description:l.description,schemaFormat:l.schemaFormat,originalSchema:l.originalSchema,conversionError:l.conversionError})]})]}),e.tags&&e.tags.length>0&&u.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((d,f)=>u.jsx(Ws,{name:`#${d.name}`},f))})]})})}),c&&u.jsxs("button",{onClick:n,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:[u.jsx("span",{children:t?"Show less":"Show more"}),u.jsx(ti,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function xh({messageKey:e,message:t,first:n,isSelected:i}){const[r,s]=ie.useState(!1);return ie.useEffect(()=>{i&&s(!0)},[i]),u.jsxs("tbody",{className:`${n?"":"border-t border-border"} ${i?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[u.jsxs("tr",{id:`message-${e}`,className:"",children:[u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-col gap-1.5",children:[u.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),u.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})]})}),u.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),u.jsx("td",{className:"px-6 py-4",children:u.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx("div",{}),u.jsx("div",{children:t.contentType&&u.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&&u.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),u.jsxs("div",{className:"flex justify-between w-full",children:[u.jsx("div",{}),u.jsx("div",{children:t.correlationId&&u.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})})]})]})})]}),u.jsx("tr",{children:u.jsx("td",{colSpan:3,className:"p-0",children:u.jsx(jc,{message:t,expanded:r,onToggleExpanded:()=>s(o=>!o),paddingX:"px-6"})})})]})}function bh({messages:e,selectedKey:t}){const n=Object.entries(e),i=n.length?u.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{className:"bg-neutral-100",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),n.map(([r,s],o)=>u.jsx(xh,{messageKey:r,message:s,first:o===0,isSelected:t===r},r))]})}):u.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 u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{content:i,stickySideContent:!1})})}function vh({serverNames:e=[],current:t,setCurrent:n}){return u.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(i=>u.jsx("a",{onClick:()=>n(i),className:Cn(t===i?"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 capitalize cursor-pointer"),children:u.jsx("span",{className:"truncate",children:i})},i))})}function Sc({className:e,children:t,...n}){return u.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...n,children:t})}function wh(e){return u.jsx(Sc,{...e,children:u.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 _h(e){return u.jsx(Sc,{...e,children:u.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 co({className:e}){return u.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,children:u.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"})})}const Eh=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"openIdConnect",name:"OpenID"},{id:"X509",name:"X.509 certificate"},{id:"scramSha256",name:"SASL"},{id:"scramSha512",name:"SASL"},{id:"plain",name:"SASL"},{id:"gssapi",name:"SASL"}];function Rc({securities:e}){var o;const t=ie.useMemo(()=>Eh.filter(a=>{const l=a.id;return e==null?void 0:e.some(c=>c.type.toLowerCase()===l.toLowerCase())}),[e]),[n,i]=ie.useState(t.length>0?t[0].id:null);ie.useEffect(()=>{t.length>0&&i(t[0].id)},[t]);function r(a){return e.find(l=>l.type===a)}const s=n?(o=r(n))==null?void 0:o.description:void 0;return u.jsxs("div",{children:[u.jsx(Cs,{tabs:t,current:n,onChange:i}),u.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[n==="userPassword"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),n&&["scramSha256","scramSha512","plain"].includes(n)&&u.jsxs(Hr,{description:s,children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),n==="gssapi"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),n==="X509"&&u.jsxs(Hr,{children:["You have to"," ",u.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),n==="apiKey"&&u.jsx(Oh,{security:r("apiKey")}),n==="openIdConnect"&&u.jsx(kh,{security:r("openIdConnect")}),n==="oauth2"&&u.jsx(Ah,{security:r("oauth2")})]})]})}const Hr=({description:e,children:t})=>e?u.jsx(u.Fragment,{children:u.jsx(vn,{children:e})}):u.jsx("span",{children:t}),Oh=({security:e})=>e!=null&&e.description?u.jsx(vn,{children:e.description}):(e==null?void 0:e.in)==="password"?u.jsxs("span",{children:["You have to"," ",u.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."]}):u.jsxs("span",{children:["You have to"," ",u.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."]}),kh=({security:e})=>u.jsxs(u.Fragment,{children:[e!=null&&e.description?u.jsx(vn,{children:e.description}):u.jsx("p",{children:"You can use OpenID to connect to this server."}),u.jsxs("p",{children:["The OpenID Connect URL is"," ",u.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),(e==null?void 0:e.scopes)&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("code",{children:Tu(e.scopes)})})]})]}),Ah=({security:e})=>{const t=e==null?void 0:e.flows;return u.jsxs(u.Fragment,{children:[(e==null?void 0:e.description)&&u.jsx(vn,{children:e.description}),t&&Object.entries(t).map(([n,i])=>{let r="",s="";switch(n){case"clientCredentials":r=gu,s=yu;break;case"implicit":r=hu,s=mu;break;case"password":r=xu,s=bu;break;case"authorizationCode":r=vu,s=wu;break}return u.jsxs("div",{children:[u.jsxs("div",{children:[u.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:r}),u.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:s})]}),u.jsx("div",{className:"mt-5 border-t border-border",children:u.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[i.authorizationUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.authorizationUrl})})]}),i.tokenUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.tokenUrl})})]}),i.refreshUrl&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("a",{href:i.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:i.refreshUrl})})]}),i.availableScopes&&u.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[u.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),u.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:u.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(i.availableScopes)?i.availableScopes:Object.keys(i.availableScopes)).map(o=>u.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:o},o))})})]})]})})]},n)})]})};function Th({className:e}){return u.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[u.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),u.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"}),u.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"})]})}function Nh(e){return e.startsWith("http://")||e.startsWith("https://")}function Ic(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function Mc({value:e}){if(e==null)return null;if(typeof e=="string"&&Nh(e))return u.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 u.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return u.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)?u.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,i)=>u.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},i))}):u.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,i])=>u.jsxs("div",{className:"flex items-start gap-2",children:[u.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:Ic(n)}),u.jsx(Mc,{value:i})]},n))})}return u.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function Cc({bindings:e,expand:t=!1,protocol:n}){const[i,r]=ie.useState(t),s=ku[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},o=Object.entries(e??{}).filter(([a,l])=>a!=="bindingVersion"&&l!==void 0&&l!==null);return o.length===0?null:u.jsxs("div",{className:"mt-2 rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>r(a=>!a),children:[u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label})}),i?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted"})]}),i&&u.jsx("div",{className:"divide-y divide-neutral-100",children:o.length===0?u.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):o.map(([a,l])=>u.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[u.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:Ic(a)}),u.jsx("div",{className:"flex-1 min-w-0",children:u.jsx(Mc,{value:l})})]},a))})]})}function jh({host:e,protocol:t,description:n,tags:i,variables:r,security:s,bindings:o}){const a=r,[l,c]=ie.useState(!1);return u.jsxs("div",{children:[u.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[u.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[u.jsx(wh,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&u.jsx(dr,{address:e,parameters:a,className:"font-bold leading-tight tracking-tight px-0"})]}),u.jsx("div",{className:"mt-2",children:i&&i.map((d,f)=>{const p=d,h=p.externalDocs;return u.jsx(Ws,{href:h&&h.url,title:p.description||(h&&h.description?h.description:void 0),name:p.name},f)})})]}),u.jsx(vn,{children:n}),s&&s.length>0&&u.jsxs("div",{children:[u.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[u.jsx(_h,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),u.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following authorization mechanisms:"}),u.jsxs("div",{className:"mt-4 rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>c(d=>!d),children:[u.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:s.length}),l?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted shrink-0"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),l&&u.jsx("div",{className:"px-4 py-2 border-t border-border",children:u.jsx(Rc,{securities:s})})]})]}),(()=>{const d=o==null?void 0:o[t];return d&&Object.keys(d).some(p=>p!=="bindingVersion")?u.jsxs("div",{children:[u.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[u.jsx(Th,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),u.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),u.jsx(Cc,{bindings:d,protocol:t})]}):null})()]})}function Sh({servers:e}){const t=[...Object.keys(e)],[n,i]=ie.useState(void 0),r=n&&t.includes(n)?n:t[0],s=u.jsx(jh,{...e[r]});return u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{title:_u,content:s,sideContent:u.jsx(vh,{serverNames:t,current:r,setCurrent:i}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function Lc({message:e,messageId:t,i:n}){const[i,r]=ie.useState(!1);return u.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[u.jsxs("div",{className:"px-4 py-3",children:[u.jsxs("div",{className:"flex items-start justify-between gap-3",children:[u.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&u.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&&u.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),u.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&u.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&&u.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&&u.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),u.jsx(jc,{message:e,expanded:i,onToggleExpanded:()=>r(s=>!s)})]})}function Rh({requestMessages:e,reply:t,isSend:n,operationId:i}){const[r,s]=ie.useState("request"),o=t.messages??[],a=t.channel,l=t.address,c=r==="request"?e:o,d=r==="request"?n?"accepts":"expects":u.jsxs(u.Fragment,{children:["replies to"," ",l?u.jsxs(u.Fragment,{children:["a channel in"," ",u.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:l.location})]}):(a==null?void 0:a.address)&&u.jsx(dr,{address:a.address,parameters:a.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 u.jsxs("div",{children:[u.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>u.jsx("button",{onClick:()=>s(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
155
+ ${r===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),u.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:c.length>0?u.jsxs(u.Fragment,{children:[u.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[u.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:i})," ",d,c.length>1?u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):u.jsxs("span",{children:[" "," with the following message:"]})]}),u.jsx("div",{className:"space-y-2",children:c.map((f,p)=>u.jsx(Lc,{message:f,messageId:f.name,i:p},p))})]}):u.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function Ih({op:e,id:t}){var g;const[n,i]=ie.useState(!1),r=e.messages??[],s=e.tags??[],o=e.bindings,a=e.traits,l=e.reply,c=e.externalDocs,d=e.security,f=o??(Array.isArray(a)?(g=a.find(_=>_.bindings))==null?void 0:g.bindings:void 0),p=e.action===sn.SEND,h=u.jsx("div",{className:"space-y-2",children:r.map((_,k)=>u.jsx(Lc,{message:_,messageId:_.name,i:k},k))});return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.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]}),(c==null?void 0:c.url)&&u.jsxs("a",{href:c.url,target:"_blank",rel:"noreferrer",title:c.description||c.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",u.jsx(Ul,{className:"w-3.5 h-3.5"})]})]}),e.description&&u.jsx("div",{children:u.jsx(vn,{children:e.description})}),e.summary&&u.jsx("div",{children:u.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),d&&d.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),u.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-neutral-50 cursor-pointer hover:bg-neutral-100 transition-colors",onClick:()=>i(_=>!_),children:[u.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:d.length}),n?u.jsx(ti,{className:"w-4 h-4 text-foreground-muted shrink-0"}):u.jsx(co,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),n&&u.jsx("div",{className:"px-4 py-2 border-t border-border",children:u.jsx(Rc,{securities:d})})]})]}),f&&Object.entries(f).map(([_,k])=>k?u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),u.jsx(Cc,{protocol:_,bindings:k},_)]}):null),l?u.jsx(Rh,{requestMessages:r,reply:l,isSend:p,operationId:t}):r.length>0&&u.jsxs("div",{children:[u.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[u.jsx("span",{className:"font-bold",children:t})," ",p?"accepts":"expects",r.length>1?u.jsxs(u.Fragment,{children:[u.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:"]}),h]}),s.length>0&&u.jsxs("div",{children:[u.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),u.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.map((_,k)=>u.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:_.name},k))})]})]})}function Mh({operations:e,selectedKey:t=null,onSelectKey:n}){const i=f=>n==null?void 0:n(f);if(!Object.keys(e).length)return null;const r=t?e[t]:null,s=Object.keys(e).map(f=>{var E;const p=e[f],h=p.channel,g=h==null?void 0:h.address,_=h==null?void 0:h.parameters,k=p.action===sn.SEND,y=((E=p.action)==null?void 0:E.toUpperCase())??"",x=k?"bg-green-100 text-green-800":p.action===sn.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",w=t===f;return u.jsxs("tr",{id:`operation-${f}`,onClick:()=>i(f),className:`group cursor-pointer ${w?"bg-neutral-50":""}`,children:[u.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:g&&u.jsx(dr,{address:g,parameters:_,truncate:!0})}),u.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:u.jsx("div",{className:`inline-flex w-24 items-center justify-center px-2 py-1 text-center rounded-md text-xs font-medium uppercase ${x}`,children:y})}),u.jsx("td",{className:"group-hover:bg-neutral-50"})]},f)}),o=r?r.channel:null,l=(r==null?void 0:r.action)===sn.SEND?"bg-green-100 text-green-800":(r==null?void 0:r.action)===sn.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",c=r&&(o!=null&&o.address)?u.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[u.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium uppercase ${l}`,children:r.action}),u.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:u.jsx(dr,{address:o.address,parameters:o.parameters})})]}):t??"Operation",d=u.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:u.jsxs("table",{className:"w-full",children:[u.jsx("thead",{className:"bg-neutral-100 w-full",children:u.jsxs("tr",{children:[u.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),u.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),u.jsx("tbody",{className:"bg-surface divide-y divide-border",children:s})]})});return u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{title:Eu,content:d,stickySideContent:!1})}),u.jsx(wl,{isOpen:!!r,side:"right",onClose:()=>i(null),title:c,children:r&&u.jsx(Ih,{op:r,id:t})})]})}function Ch({schemas:e,selectedKey:t}){const{deref:n}=zt(),i=ie.useMemo(()=>Object.entries(e).map(([s,o])=>[s,$r(o,n)]),[e,n]),r=i.length?u.jsx("div",{className:"grid gap-6 w-full",children:i.map(([s,o])=>{const a=o.schema,l=rc(o.schemaFormat),c=a.properties?Object.keys(a.properties).length:0;return u.jsxs("article",{id:`schema-${s}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===s?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[u.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-base font-semibold text-foreground",children:s}),o.description&&u.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:o.description})]}),u.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:a.type??"unknown"})]}),(a.format||l||c>0)&&u.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[a.format&&u.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",a.format]}),l&&u.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:o.schemaFormat,children:l}),c>0&&u.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[c," properties"]})]}),o.conversionError&&u.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"," ",ic(o.schemaFormat)??"the"," schema — showing raw definition. ",o.conversionError]}),o.conversionError&&typeof o.originalSchema=="string"?u.jsx("div",{className:"mt-4",children:u.jsx(Vl,{schema:o.originalSchema})}):u.jsx(lo,{schema:a,rootName:s,className:"mt-4"})]},s)})}):u.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 u.jsx("div",{className:"flex justify-center w-full",children:u.jsx(Bn,{content:r,stickySideContent:!1})})}const Lh=e=>typeof e=="object"&&e!==null,Ph=e=>e==="operations"||e==="messages"||e==="schemas";function Dh({asyncapi:e,config:t}){var pe,S,O,m,M,q,P,U;const n=t.show??{},i=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:_l}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:El}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Ol}]:[]],r=((pe=i[0])==null?void 0:pe.id)??"operations",[s,o]=ie.useState(r),[a,l]=ie.useState(null),[c,d]=ie.useState(null),[f,p]=ie.useState(null),h=i.some(B=>B.id===s)?s:r,g=n.operations!==!1?a:null,_=n.messages!==!1?c:null,k=n.schemas!==!1?f:null,y=ie.useMemo(()=>new Map,[]),[x,w]=ie.useState(null),[E,j]=ie.useState(null);ie.useEffect(()=>{y.clear()},[e,y]);const N=ie.useCallback(B=>{if(y.has(B))return y.get(B);const J=B.replace(/^#\//,"").split("/");let de=e;for(const X of J){if(!Lh(de)){de=void 0;break}const xe=X.replace(/~1/g,"/").replace(/~0/g,"~");if(de=de[xe],de==null)break}return de!==void 0&&y.set(B,de),de},[e,y]),R=((S=t.expand)==null?void 0:S.schemas)===!0,Z=(m=(O=t.theme)==null?void 0:O.depthColors)!=null&&m.length?t.theme.depthColors:Is,H=ie.useMemo(()=>({document:e,deref:N,portalHost:x,rootElement:E,defaultSchemaExpanded:R,depthColors:Z}),[e,N,x,E,R,Z]),K=h==="operations"?u.jsx(Mh,{operations:e.operations??{},selectedKey:g,onSelectKey:l}):h==="messages"?u.jsx(bh,{messages:((M=e.components)==null?void 0:M.messages)??{},selectedKey:_}):u.jsx(Ch,{schemas:((q=e.components)==null?void 0:q.schemas)??{},selectedKey:k}),Y=t.theme?Iu(t.theme):{};return u.jsx(bl.Provider,{value:H,children:u.jsxs("div",{ref:j,style:Y,className:`relative @container bg-background text-foreground p-2 ${n.sidebar!==!1?"pt-14":""}`,children:[u.jsx("div",{ref:w,className:"asyncapi-portal-root"}),n.info!==!1&&u.jsx(Mf,{...e.info}),n.servers!==!1&&e.servers&&Object.keys(e.servers).length>0&&u.jsx(Sh,{servers:e.servers}),n.sidebar!==!1&&u.jsx(ju,{info:e.info,operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(P=e.components)==null?void 0:P.messages:void 0,schemas:n.schemas!==!1?(U=e.components)==null?void 0:U.schemas:void 0,sidebarConfig:t.sidebar,activeTab:h,onTabChange:o,onItemSelect:(B,J)=>{o(B),l(B==="operations"?J:null),d(B==="messages"?J:null),p(B==="schemas"?J:null)},selectedItem:g?{tab:"operations",key:g}:_?{tab:"messages",key:_}:k?{tab:"schemas",key:k}:null}),u.jsx(su,{tabs:i,current:h,onChange:B=>{Ph(B)&&o(B)}}),u.jsx("div",{id:`panel-${h}`,role:"tabpanel","aria-labelledby":`tab-${h}`,children:K})]})})}const uo=e=>{const t=e.asyncapi,n=ie.useMemo(()=>iu(t),[t]),i=e.config??gl;return u.jsx(Dh,{asyncapi:n,config:i})};function Pc(e,t,n){e.registerSchemaParser(t);const i=e.parserRegistry,r=i.get.bind(i);i.get=s=>{const o=r(s);return o!==void 0?o:n(s)?t:void 0}}const Fh=["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 Bh(){return{validate:qh,parse:Uh,getMimeTypes:()=>Fh}}function zh(e){Pc(e,Bh(),xr)}function qh(e){return Xs(e.data).map(t=>({message:t,path:e.path}))}function Uh(e){var n,i;const t=Xs(e.data);if(t.length>0)return{[mr]:t[0]};try{const r=ks(e.data),s=e.meta.message,o=(i=(n=s==null?void 0:s.bindings)==null?void 0:n.kafka)==null?void 0:i.key;return o&&s&&(s["x-parser-original-bindings-kafka-key"]=o,s.bindings.kafka.key=ks(o)),r}catch(r){return{[mr]:r instanceof Error?r.message:"Failed to convert Avro schema"}}}const Hh=["application/vnd.google.protobuf","application/vnd.google.protobuf;version=2","application/vnd.google.protobuf;version=3"];function Vh(){return{validate:Jh,parse:Zh,getMimeTypes:()=>Hh}}function Wh(e){Pc(e,Vh(),br)}function Jh(e){return Td(e.data).map(t=>({message:t,path:e.path}))}function Zh(e){if(typeof e.data!="string")return{[mr]:"Protobuf schema must be a string of .proto source"};try{return so(e.data)}catch(t){return{[mr]:t instanceof Error?t.message:"Failed to convert Protobuf schema"}}}async function Xh(){try{const e=await Promise.resolve().then(()=>require("./index-DqcOEYz_.cjs")).then(n=>n.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 Dc(e){const t=await Xh(),n=new t;zh(n),Wh(n);try{const{document:i,diagnostics:r}=await n.parse(e);return{diagnostics:r,document:i?$h(i):null}}catch(i){return{diagnostics:[{message:i instanceof Error?i.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Yh(e,t){const{diagnostics:n,document:i}=await Dc(e);return{diagnostics:n,view:i?u.jsx(uo,{kind:"resolved",asyncapi:i,config:t}):null}}function $h(e){return e.json()}function Kh({raw:e,config:t,onDiagnostics:n}){const[i,r]=ie.useState(null),s=ie.useRef(n);return s.current=n,ie.useEffect(()=>{let o=!0;return Dc(e).then(({document:a,diagnostics:l})=>{var c;o&&(r(a),(c=s.current)==null||c.call(s,l))}),()=>{o=!1}},[e]),i?u.jsx(uo,{kind:"resolved",asyncapi:i,config:t}):null}exports.AsyncAPI=uo;exports.AsyncAPIRenderer=Kh;exports.SchemaTabs=Rs;exports.SchemaTree=lo;exports.defaultConfig=gl;exports.getDefaultExportFromCjs=Ls;exports.parseAndRender=Yh;exports.useAsyncAPIDocument=zt;