apiuikit 0.2.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +47 -3
  2. package/dist/LinkedInExtension-6xekO5bX.cjs +1 -0
  3. package/dist/LinkedInExtension-BL-4T9tt.js +21 -0
  4. package/dist/LogoExtension-BOYrY_RE.cjs +1 -0
  5. package/dist/LogoExtension-HOlSsQf-.js +27 -0
  6. package/dist/XExtension-GyRtdHLL.js +23 -0
  7. package/dist/XExtension-jAiATfg-.cjs +1 -0
  8. package/dist/apiuikit.cjs.js +1 -1
  9. package/dist/apiuikit.css +1 -1
  10. package/dist/apiuikit.es.js +16 -9
  11. package/dist/components/Bindings.d.ts +3 -1
  12. package/dist/components/InfoMetadata.d.ts +7 -1
  13. package/dist/components/Navigation.d.ts +11 -4
  14. package/dist/components/RenderExtensions.d.ts +15 -0
  15. package/dist/components/SearchPanel.d.ts +9 -0
  16. package/dist/components/schema/SchemaNode.d.ts +10 -1
  17. package/dist/components/schema/SchemaTab.d.ts +8 -1
  18. package/dist/components/schema/SchemaTree.d.ts +5 -1
  19. package/dist/components/schema/SchemaTreeRow.d.ts +2 -1
  20. package/dist/components/tests/Authorization.test.d.ts +1 -0
  21. package/dist/components/tests/RenderExtensions.test.d.ts +1 -0
  22. package/dist/config/config.d.ts +3 -0
  23. package/dist/containers/AsyncAPI/AsyncAPI.d.ts +12 -6
  24. package/dist/containers/AsyncAPI/AsyncAPIDocumentProvider.d.ts +12 -0
  25. package/dist/containers/AsyncAPI/AsyncAPIRenderer.d.ts +9 -0
  26. package/dist/containers/AsyncAPI/tests/searchHighlight.test.d.ts +1 -0
  27. package/dist/containers/Messages/MessageDetails.d.ts +3 -1
  28. package/dist/containers/Messages/Messages.d.ts +3 -1
  29. package/dist/containers/Operation/Operation.d.ts +3 -1
  30. package/dist/containers/Operation/Operations.d.ts +3 -1
  31. package/dist/containers/Schema/Schemas.d.ts +6 -1
  32. package/dist/containers/Server/Server.d.ts +8 -1
  33. package/dist/containers/Server/Servers.d.ts +7 -3
  34. package/dist/contexts/useSpec.d.ts +2 -0
  35. package/dist/helpers/protobuf/lazyProtoToJsonSchema.d.ts +14 -0
  36. package/dist/helpers/schemaFormat.d.ts +3 -0
  37. package/dist/helpers/searchIndex.d.ts +18 -0
  38. package/dist/helpers/textHighlight.d.ts +2 -0
  39. package/dist/hooks/useSpecSearch.d.ts +13 -0
  40. package/dist/icons/Search.d.ts +3 -0
  41. package/dist/icons/Server.d.ts +4 -3
  42. package/dist/index-BG6colCU.js +11473 -0
  43. package/dist/{index-DqcOEYz_.cjs → index-BcNlIoEF.cjs} +1 -1
  44. package/dist/index-Bmw7IyyF.cjs +73 -0
  45. package/dist/{index-yG3rYT_D.js → index-CEf0X0H_.js} +1 -1
  46. package/dist/index.d.ts +2 -0
  47. package/dist/protoToJsonSchema-BcqPKXqK.js +6174 -0
  48. package/dist/protoToJsonSchema-C43lKcgx.cjs +83 -0
  49. package/dist/protobufSchemaParser-BQVXzHsQ.js +55 -0
  50. package/dist/protobufSchemaParser-sEw46uRx.cjs +1 -0
  51. package/dist/public/sections.d.ts +45 -0
  52. package/dist/public/tests/sections.test.d.ts +1 -0
  53. package/dist/stories/AsyncAPI.stories.d.ts +6 -0
  54. package/dist/stories/AsyncAPIRenderer.stories.d.ts +6 -0
  55. package/dist/stories/Authorization.stories.d.ts +13 -0
  56. package/dist/stories/Bindings.stories.d.ts +12 -0
  57. package/dist/stories/ChannelAddress.stories.d.ts +13 -0
  58. package/dist/stories/CodeBlock.stories.d.ts +11 -0
  59. package/dist/stories/Examples.stories.d.ts +11 -0
  60. package/dist/stories/Information.stories.d.ts +1 -0
  61. package/dist/stories/Message.stories.d.ts +11 -0
  62. package/dist/stories/Messages.stories.d.ts +11 -0
  63. package/dist/stories/Operation.stories.d.ts +10 -0
  64. package/dist/stories/Operations.stories.d.ts +16 -0
  65. package/dist/stories/SchemaTab.stories.d.ts +12 -0
  66. package/dist/stories/SchemaTree.stories.d.ts +1 -0
  67. package/dist/stories/SearchPanel.stories.d.ts +16 -0
  68. package/dist/stories/Server.stories.d.ts +4 -1
  69. package/dist/stories/TabToggle.stories.d.ts +10 -0
  70. package/dist/stories/Tabs.stories.d.ts +11 -0
  71. package/dist/stories/documentContextDecorator.d.ts +25 -0
  72. package/dist/stories/noCanvasDocsPage.d.ts +9 -0
  73. package/package.json +5 -4
  74. package/dist/index-BYmrdiVi.cjs +0 -155
  75. package/dist/index-DfH4J5EL.js +0 -15436
  76. package/dist/stories/Button.d.ts +0 -14
  77. package/dist/stories/Button.stories.d.ts +0 -23
@@ -0,0 +1,73 @@
1
+ "use strict";var Tl=Object.defineProperty;var _l=(e,t,n)=>t in e?Tl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ve=(e,t,n)=>_l(e,typeof t!="symbol"?t+"":t,n);const o=require("react/jsx-runtime"),j=require("react"),Ys=require("react-dom"),Js=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Qs=(e,t)=>{const n=t.length>0?t:Js,s=(e%n.length+n.length)%n.length;return n[s]},Gs={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:Js},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!1}},Ho=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",_r=e=>typeof e=="object"&&e!==null,Cl=e=>e.replace(/^#\//,"").split("/").pop()??e,Uo=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Ho(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(s=>Uo(s,t))),Ol=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let s=e;for(const r of n){if(!_r(s)&&!Array.isArray(s))return;const i=r.replace(/~1/g,"/").replace(/~0/g,"~");if(s=s[i],s==null)return}return s};function ei(e){if(!Uo(e))return e;const t=new Map,n=new Set,s=r=>{if(Array.isArray(r)){const i=t.get(r);if(i!==void 0)return i;const a=[];t.set(r,a),n.add(r);try{for(const l of r)a.push(s(l))}finally{n.delete(r)}return a}if(Ho(r)){const i=Ol(e,r.$ref),a=_r(i)||Array.isArray(i);if(a&&!n.has(i)){const l=s(i);return _r(l)&&l["x-parser-schema-id"]===void 0&&(l["x-parser-schema-id"]=Cl(r.$ref)),l}if(i!==void 0&&!a)return i}if(_r(r)){const i=t.get(r);if(i!==void 0)return i;const a={};t.set(r,a),n.add(r);try{for(const[l,c]of Object.entries(r))a[l]=s(c)}finally{n.delete(r)}return a}return r};return s(e)}const ti=j.createContext(null),dt=()=>{const e=j.useContext(ti);if(!e)throw new Error("useAsyncAPIDocument must be used within an AsyncAPIDocumentProvider");return e},Il="Contact",Ml="Email",$i="License",qi="External Documentation",Rl="Tags",Ll="Implicit",Pl=`The Implicit flow is a simplified OAuth flow previously recommended
2
+ for native apps and JavaScript apps where the access token is returned
3
+ immediately without an extra authorization code exchange step.`,Dl="Client Credentials",Bl="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",Fl="Password",zl="The Password grant type is a legacy way to exchange a user's credentials for an access token.",Hl="Authorization Code",Ul="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Wl="Connecting to a server",$l="",Vi=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],ql=[50,100,200,300,500,600,700],Vl={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 Wo(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),s=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return`${n} ${s} ${r}`}function hs(e,t,n){if(e)for(const s of ql){const r=e[s];r&&(n[`--color-${t}-${s}`]=Wo(r))}}const Xl=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],Zl={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 Kl(e){const t={},n=e.light?"light":e.dark?"dark":null,s=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[r,i]of Object.entries(Zl))t[`--color-neutral-${r}`]=i;if(s)for(const[r,i]of Xl){const a=s[r];a&&(t[i]=Wo(a))}return e.colors&&(hs(e.colors.primary,"primary",t),hs(e.colors.secondary,"secondary",t),hs(e.colors.neutral,"neutral",t)),t}const Yl=e=>typeof e=="object"&&e!==null;function ni({document:e,config:t=Gs,className:n="",children:s}){var A,I,P,S;const r=j.useMemo(()=>new Map,[]),[i,a]=j.useState(null),[l,c]=j.useState(null);j.useEffect(()=>{r.clear()},[e,r]);const u=j.useCallback(w=>{if(r.has(w))return r.get(w);const x=w.replace(/^#\//,"").split("/");let C=e;for(const N of x){if(!Yl(C)){C=void 0;break}const _=N.replace(/~1/g,"/").replace(/~0/g,"~");if(C=C[_],C==null)break}return C!==void 0&&r.set(w,C),C},[e,r]),d=((A=t.expand)==null?void 0:A.schemas)===!0,f=(P=(I=t.theme)==null?void 0:I.depthColors)!=null&&P.length?t.theme.depthColors:Js,h=((S=t.show)==null?void 0:S.extensions)!==!1,g=j.useMemo(()=>({document:e,deref:u,portalHost:i,rootElement:l,defaultSchemaExpanded:d,depthColors:f,showExtensions:h}),[e,u,i,l,d,f,h]),v=t.theme?Kl(t.theme):{};return o.jsx(ti.Provider,{value:g,children:o.jsxs("div",{ref:c,style:v,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[o.jsx("div",{ref:a,className:"asyncapi-portal-root"}),s]})})}function Tn({title:e,content:t,sideContent:n,stickySideContent:s=!1,info:r=!1,reverseLayoutOnMobile:i=!1}){return o.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[e&&o.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}),o.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&i?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[o.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),o.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:o.jsx("div",{className:`${s&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function jn(...e){return e.filter(Boolean).join(" ")}function ri({tabs:e,current:t,onChange:n=()=>{},ariaLabel:s="Tabs",selectLabel:r="Select a tab"}){var d;const i=j.useId(),a=j.useRef([]),l=t??((d=e[0])==null?void 0:d.id)??"",c=e.some(f=>!!f.icon),u=(f,h)=>{var A;if(e.length===0)return;const g=I=>(I+e.length)%e.length;let v=h;if(f.key==="ArrowRight"&&(f.preventDefault(),v=g(h+1)),f.key==="ArrowLeft"&&(f.preventDefault(),v=g(h-1)),f.key==="Home"&&(f.preventDefault(),v=0),f.key==="End"&&(f.preventDefault(),v=e.length-1),v!==h){const I=e[v];n(I.id),(A=a.current[v])==null||A.focus()}};return e.length?o.jsxs("div",{children:[o.jsxs("div",{className:"@sm:hidden",children:[o.jsx("label",{htmlFor:i,className:"sr-only",children:r}),o.jsx("select",{id:i,name:"tabs",value:l,onChange:f=>n(f.target.value),className:jn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",c?"mt-0":"mt-4"),children:e.map(f=>o.jsx("option",{value:f.id,children:f.name},f.id))})]}),o.jsx("div",{className:jn("hidden @sm:block",c?"":"mt-6"),children:c?o.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":s,children:o.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((f,h)=>{const g=f.id===t,v=f.icon;return o.jsx("button",{ref:A=>{a.current[h]=A},id:`tab-${f.id}`,type:"button",role:"tab",tabIndex:g?0:-1,"aria-selected":g,"aria-controls":`panel-${f.id}`,onClick:()=>n(f.id),onKeyDown:A=>u(A,h),className:jn("border-b-2 px-1 py-3 text-sm font-semibold transition-colors",g?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:o.jsxs("span",{className:"inline-flex items-center gap-2",children:[v?o.jsx(v,{className:"h-4 w-4 shrink-0"}):null,o.jsx("span",{children:f.name})]})},f.id)})})}):o.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":s,children:e.map((f,h)=>{const g=f.id===t;return o.jsxs("button",{ref:v=>{a.current[h]=v},id:`tab-${f.id}`,type:"button",role:"tab",tabIndex:g?0:-1,"aria-selected":g,"aria-controls":`panel-${f.id}`,onClick:()=>n(f.id),onKeyDown:v=>u(v,h),className:jn(g?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",h===0?"rounded-l-lg":"",h===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"),children:[o.jsx("span",{children:f.name}),o.jsx("span",{"aria-hidden":"true",className:jn(g?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},f.id)})})})]}):null}function Jl({tabs:e,current:t,onChange:n}){if(!e.length)return null;const s=o.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:o.jsx(ri,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return o.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:o.jsx(Tn,{content:s,stickySideContent:!1})})}const Ql=({isCollapsed:e})=>o.jsxs("svg",{width:22,height:22,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:[o.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"}),o.jsx("rect",{className:`panel-icon-rect ${e?"panel-icon-rect-collapsed":""}`,x:"2",y:"3",height:"10",rx:"1"})]});function Gl(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function $o(e){let t=e;for(;t&&t!==document.body;){if(Gl(t))return t;t=t.parentElement}return document.documentElement}function qo(e){const t=e.style.overflow,n=e.style.paddingRight,s=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",s>0){const r=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${r+s}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}function si(e,t){const[n,s]=j.useState(null);return j.useLayoutEffect(()=>{if(!e||!t){s(null);return}let r=null;const i=()=>{r===null&&(r=requestAnimationFrame(()=>{r=null,s(e.getBoundingClientRect())}))};s(e.getBoundingClientRect());const a=new ResizeObserver(i);return a.observe(e),window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{r!==null&&cancelAnimationFrame(r),a.disconnect(),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),n}const Vo=j.forwardRef(function({isOpen:t,side:n,onClose:s,title:r,children:i,width:a="w-[50rem]"},l){j.useEffect(()=>{const v=A=>{A.key==="Escape"&&s()};return document.addEventListener("keydown",v),()=>document.removeEventListener("keydown",v)},[s]);const c=n==="right"?"translate-x-full":"-translate-x-full",u=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:f}=dt();j.useEffect(()=>{if(!(!t||!d))return qo($o(d))},[t,d]);const h=si(f,!0),g=h?{position:"fixed",top:0,left:h.left,width:h.width,height:"100vh"}:{position:"fixed",inset:0};return d?Ys.createPortal(o.jsxs("div",{className:"z-50 overflow-hidden",style:{...g,pointerEvents:t?"auto":"none"},children:[o.jsx("div",{onClick:s,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),o.jsxs("div",{ref:l,className:`absolute top-0 ${u} h-full ${a} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":c}`,children:[r&&o.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[o.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof r=="string"?o.jsx("span",{className:"truncate block",children:r}):r}),o.jsx("button",{onClick:s,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:o.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:o.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),o.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i})]})]}),d):null});function Xo({className:e}){return o.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:o.jsx("path",{d:"M389.44 768a96.064 96.064 0 0 1 181.12 0H896v64H570.56a96.064 96.064 0 0 1-181.12 0H128v-64h261.44zm192-288a96.064 96.064 0 0 1 181.12 0H896v64H762.56a96.064 96.064 0 0 1-181.12 0H128v-64h453.44zm-320-288a96.064 96.064 0 0 1 181.12 0H896v64H442.56a96.064 96.064 0 0 1-181.12 0H128v-64h133.44z"})})}function Zo({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{d:"M128 224v512a64 64 0 0 0 64 64h640a64 64 0 0 0 64-64V224H128zm0-64h768a64 64 0 0 1 64 64v512a128 128 0 0 1-128 128H192A128 128 0 0 1 64 736V224a64 64 0 0 1 64-64z"}),o.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}function Ko({className:e}){return o.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M14 20C17.3137 20 20 17.3137 20 14C20 10.6863 17.3137 8 14 8C10.6863 8 8 10.6863 8 14C8 17.3137 10.6863 20 14 20ZM18 14C18 16.2091 16.2091 18 14 18C11.7909 18 10 16.2091 10 14C10 11.7909 11.7909 10 14 10C16.2091 10 18 11.7909 18 14Z"}),o.jsx("path",{clipRule:"evenodd",fillRule:"evenodd",d:"M0 12.9996V14.9996C0 16.5478 1.17261 17.822 2.67809 17.9826C2.80588 18.3459 2.95062 18.7011 3.11133 19.0473C2.12484 20.226 2.18536 21.984 3.29291 23.0916L4.70712 24.5058C5.78946 25.5881 7.49305 25.6706 8.67003 24.7531C9.1044 24.9688 9.55383 25.159 10.0163 25.3218C10.1769 26.8273 11.4511 28 12.9993 28H14.9993C16.5471 28 17.8211 26.8279 17.9821 25.3228C18.4024 25.175 18.8119 25.0046 19.2091 24.8129C20.3823 25.6664 22.0344 25.564 23.0926 24.5058L24.5068 23.0916C25.565 22.0334 25.6674 20.3813 24.814 19.2081C25.0054 18.8113 25.1757 18.4023 25.3234 17.9824C26.8282 17.8211 28 16.5472 28 14.9996V12.9996C28 11.452 26.8282 10.1782 25.3234 10.0169C25.1605 9.55375 24.9701 9.10374 24.7541 8.66883C25.6708 7.49189 25.5882 5.78888 24.5061 4.70681L23.0919 3.29259C21.9846 2.18531 20.2271 2.12455 19.0485 3.1103C18.7017 2.94935 18.3459 2.80441 17.982 2.67647C17.8207 1.17177 16.5468 0 14.9993 0H12.9993C11.4514 0 10.1773 1.17231 10.0164 2.6775C9.60779 2.8213 9.20936 2.98653 8.82251 3.17181C7.64444 2.12251 5.83764 2.16276 4.70782 3.29259L3.2936 4.7068C2.16377 5.83664 2.12352 7.64345 3.17285 8.82152C2.98737 9.20877 2.82199 9.60763 2.67809 10.0167C1.17261 10.1773 0 11.4515 0 12.9996ZM15.9993 3C15.9993 2.44772 15.5516 2 14.9993 2H12.9993C12.447 2 11.9993 2.44772 11.9993 3V3.38269C11.9993 3.85823 11.6626 4.26276 11.2059 4.39542C10.4966 4.60148 9.81974 4.88401 9.18495 5.23348C8.76836 5.46282 8.24425 5.41481 7.90799 5.07855L7.53624 4.70681C7.14572 4.31628 6.51256 4.31628 6.12203 4.7068L4.70782 6.12102C4.31729 6.51154 4.31729 7.14471 4.70782 7.53523L5.07958 7.90699C5.41584 8.24325 5.46385 8.76736 5.23451 9.18395C4.88485 9.8191 4.6022 10.4963 4.39611 11.2061C4.2635 11.6629 3.85894 11.9996 3.38334 11.9996H3C2.44772 11.9996 2 12.4474 2 12.9996V14.9996C2 15.5519 2.44772 15.9996 3 15.9996H3.38334C3.85894 15.9996 4.26349 16.3364 4.39611 16.7931C4.58954 17.4594 4.85042 18.0969 5.17085 18.6979C5.39202 19.1127 5.34095 19.6293 5.00855 19.9617L4.70712 20.2632C4.3166 20.6537 4.3166 21.2868 4.70712 21.6774L6.12134 23.0916C6.51186 23.4821 7.14503 23.4821 7.53555 23.0916L7.77887 22.8483C8.11899 22.5081 8.65055 22.4633 9.06879 22.7008C9.73695 23.0804 10.4531 23.3852 11.2059 23.6039C11.6626 23.7365 11.9993 24.1411 11.9993 24.6166V25C11.9993 25.5523 12.447 26 12.9993 26H14.9993C15.5516 26 15.9993 25.5523 15.9993 25V24.6174C15.9993 24.1418 16.3361 23.7372 16.7929 23.6046C17.5032 23.3985 18.1809 23.1157 18.8164 22.7658C19.233 22.5365 19.7571 22.5845 20.0934 22.9208L20.2642 23.0916C20.6547 23.4821 21.2879 23.4821 21.6784 23.0916L23.0926 21.6774C23.4831 21.2868 23.4831 20.6537 23.0926 20.2632L22.9218 20.0924C22.5855 19.7561 22.5375 19.232 22.7669 18.8154C23.1166 18.1802 23.3992 17.503 23.6053 16.7931C23.7379 16.3364 24.1425 15.9996 24.6181 15.9996H25C25.5523 15.9996 26 15.5519 26 14.9996V12.9996C26 12.4474 25.5523 11.9996 25 11.9996H24.6181C24.1425 11.9996 23.7379 11.6629 23.6053 11.2061C23.3866 10.4529 23.0817 9.73627 22.7019 9.06773C22.4643 8.64949 22.5092 8.11793 22.8493 7.77781L23.0919 7.53523C23.4824 7.14471 23.4824 6.51154 23.0919 6.12102L21.6777 4.7068C21.2872 4.31628 20.654 4.31628 20.2635 4.7068L19.9628 5.00748C19.6304 5.33988 19.1137 5.39096 18.6989 5.16979C18.0976 4.84915 17.4596 4.58815 16.7929 4.39467C16.3361 4.2621 15.9993 3.85752 15.9993 3.38187V3Z"})]})}function ec({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",width:"800px",height:"800px",viewBox:"0 0 24 24",fill:"none",children:o.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}var Qt=(e=>(e.SEND="send",e.RECEIVE="receive",e))(Qt||{});function Yo(e,t){const[n,s]=j.useState("docked"),r=j.useRef(t);return r.current=t,j.useEffect(()=>{if(!e)return;let i=null,a=null;const l=()=>{a=null;const u=e.getBoundingClientRect().top,d=i===null?0:u-i;i=u,u>=0?s("docked"):r.current||d>0?s("pinned"):d<0?s("hidden"):s(f=>f==="docked"?"hidden":f)},c=()=>{a===null&&(a=requestAnimationFrame(l))};return l(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{a!==null&&cancelAnimationFrame(a),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),j.useEffect(()=>{t&&s(i=>i==="hidden"?"pinned":i)},[t]),n}function tc(e){if(e.length===0)return o.jsx("span",{children:"No allowed values."});if(e.length===1)return o.jsxs("span",{children:["Allowed value is ",o.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((s,r)=>o.jsxs(j.Fragment,{children:[o.jsx("code",{children:s}),", "," "]},r)),n=o.jsx("code",{children:e[e.length-1]},"last");return o.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function nc(e){return e.map(t=>`\`${t}\``).join(", ")}function rc(e){const t=[],n=/\{([^}]+)\}/g;let s=0,r;for(;(r=n.exec(e))!==null;)r.index>s&&t.push({type:"text",value:e.slice(s,r.index)}),t.push({type:"param",value:r[1]}),s=r.index+r[0].length;return s<e.length&&t.push({type:"text",value:e.slice(s)}),t}function Zn({address:e,parameters:t,className:n="text-xs",truncate:s=!1}){const{portalHost:r}=dt(),[i,a]=j.useState(null),[l,c]=j.useState({top:0,left:0,placement:"top"}),[u,d]=j.useState(!1),f=j.useRef(null),h=rc(e);let g=0;const v=40;j.useEffect(()=>{if(!s)return;const S=f.current;if(!S)return;const w=()=>d(S.scrollWidth>S.clientWidth);w();const x=new ResizeObserver(w);return x.observe(S),()=>x.disconnect()},[s,e]);const A=(S,w)=>{const x=w.getBoundingClientRect(),C=x.top<v?"bottom":"top";c({top:C==="top"?x.top-8:x.bottom+8,left:x.left+x.width/2,placement:C}),a(S)},I=()=>a(null),P=h.map((S,w)=>{if(S.type==="text")return o.jsx("span",{children:S.value},w);const x=t==null?void 0:t[S.value],C=Vi[g++%Vi.length],N=i===w,_=!!x&&(x.description||x.default||x.enum&&x.enum.length>0||x.examples&&x.examples.length>0),Y=`channel-address-tooltip-${w}`,E=_&&N?Y:void 0;return o.jsxs("span",{className:"inline-block",onMouseEnter:k=>_&&A(w,k.currentTarget),onMouseLeave:I,children:[o.jsx("span",{className:`font-semibold ${C} ${_?"cursor-help underline decoration-dotted":""}`,role:_?"button":void 0,tabIndex:_?0:void 0,"aria-expanded":_?N:void 0,"aria-describedby":E,onFocus:k=>_&&A(w,k.currentTarget),onBlur:I,onKeyDown:k=>{_&&((k.key==="Enter"||k.key===" ")&&(k.preventDefault(),A(w,k.currentTarget)),k.key==="Escape"&&(k.preventDefault(),I(),k.currentTarget.blur()))},children:`{${S.value}}`}),_&&N&&r&&Ys.createPortal(o.jsxs("div",{id:Y,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 ${l.placement==="top"?"-translate-y-full":""}`,style:{top:l.top,left:l.left},children:[x.description&&o.jsx("div",{children:x.description}),x.default&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",o.jsx("code",{children:x.default})]}),x.enum&&x.enum.length>0&&o.jsx("div",{className:"mt-1",children:tc(x.enum)}),x.examples&&x.examples.length>0&&o.jsxs("div",{className:"mt-1",children:[o.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",x.examples.join(", ")]})]}),r)]},w)});return s?o.jsxs("code",{className:`px-2 py-1 rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[o.jsx("span",{ref:f,className:"overflow-hidden whitespace-nowrap min-w-0",children:P}),u&&o.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):o.jsx("code",{className:`px-2 py-1 rounded text-foreground-secondary break-all ${n}`,children:P})}function sc({info:e,operations:t={},messages:n={},schemas:s={},servers:r={},activeTab:i,onTabChange:a,onItemSelect:l,onSelectServer:c,selectedItem:u,sidebarConfig:d}){const[f,h]=j.useState(!1),[g,v]=j.useState(0),[A,I]=j.useState(null),{rootElement:P}=dt(),S=Yo(P,f),w=S!=="docked",x=si(P,w),N={transform:`translate(${f&&g?g-2:0}px, ${S==="hidden"?"-150%":"0px"})`,...w?{position:"fixed",top:10,left:((x==null?void 0:x.left)??0)+12,pointerEvents:S==="hidden"?"none":void 0}:{}};j.useEffect(()=>{if(!A)return;const L=new ResizeObserver(([ae])=>v(ae.contentRect.width));return L.observe(A),()=>L.disconnect()},[A]);const _=L=>{var se;return d!=null&&d.useChannelAddressAsIdentifier?((se=t[L])==null?void 0:se.channel)??null:null},Y=[{id:"servers",label:"Servers",icon:ec,items:Object.keys(r)},{id:"operations",label:"Operations",icon:Xo,items:Object.keys(t)},{id:"messages",label:"Messages",icon:Zo,items:Object.keys(n)},{id:"schemas",label:"Schemas",icon:Ko,items:Object.keys(s)}],E=L=>L!=="servers",k=(L,ae)=>{E(L)&&a(L),ae&&setTimeout(()=>{var se;(se=document.getElementById(ae))==null||se.scrollIntoView({behavior:"smooth",block:"start"})},50)};return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>h(L=>!L),title:f?"Close navigation":"Open navigation",className:"panel-toggle-btn bg-neutral-100",style:N,children:o.jsx(Ql,{isCollapsed:f})}),o.jsx(Vo,{ref:I,isOpen:f,side:"left",onClose:()=>h(!1),width:"min-w-[450px] w-auto",children:o.jsxs("nav",{className:"space-y-1",children:[o.jsxs("div",{className:"flex items-center gap-2 pb-4 mb-2 border-b border-border",children:[o.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:e.title}),e.version&&o.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]})]}),Y.map(({id:L,label:ae,icon:se,items:Ae})=>{const fe=i===L;if(!(Ae.length<1))return o.jsxs("div",{className:"pb-1",children:[o.jsxs("button",{onClick:()=>k(L),className:`flex items-center gap-2 w-full text-left px-2 py-2 rounded-md group transition-colors ${fe?"bg-primary-50":"hover:bg-neutral-50"}`,children:[o.jsx(se,{className:`w-3.5 h-3.5 shrink-0 transition-colors ${fe?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),o.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${fe?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:ae}),o.jsx("span",{className:`ml-auto text-[10px] font-mono px-1.5 py-0.5 rounded transition-colors ${fe?"bg-primary-100 text-primary-500 border border-primary-200":"bg-neutral-100 text-foreground-muted"}`,children:Ae.length})]}),Ae.length>0&&o.jsx("ul",{className:"mt-0.5 space-y-0.5 pl-3 border-l border-border ml-4",children:Ae.map(Ce=>{const ie=L==="operations"?t[Ce]:null,Te=L==="operations"?_(Ce):null,be=ie==null?void 0:ie.action,$e=be===Qt.SEND?"bg-green-100 text-green-700":be===Qt.RECEIVE?"bg-blue-100 text-blue-700":null,pe=(u==null?void 0:u.tab)===L&&(u==null?void 0:u.key)===Ce;return o.jsx("li",{children:o.jsxs("button",{onClick:()=>{k(L,`${L.slice(0,-1)}-${Ce}`),E(L)?l==null||l(L,Ce):c==null||c(Ce)},className:`w-full text-left flex items-center gap-2 text-xs py-1.5 px-2 rounded-md transition-colors ${pe?"bg-primary-50 text-primary-500 font-medium":fe?"text-foreground-secondary hover:text-foreground hover:bg-primary-50":"text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-50"}`,children:[$e&&o.jsx("span",{className:`shrink-0 text-[10px] font-medium uppercase px-1.5 py-0.5 rounded ${$e}`,children:be}),Te!=null&&Te.address?o.jsx(Zn,{address:Te.address,parameters:Te.parameters,className:"text-xs bg-transparent p-0"}):o.jsx("span",{className:"truncate",children:Ce})]})},Ce)})})]},L)})]})})]})}const ic=e=>o.jsxs("svg",{width:18,height:18,viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",...e,children:[o.jsx("circle",{cx:"7",cy:"7",r:"5"}),o.jsx("path",{d:"M14 14l-3.5-3.5"})]}),Xi=60;function oc({query:e,onQueryChange:t,results:n,onSelectResult:s}){const r=j.useRef(null),i=j.useRef(null),[a,l]=j.useState(!1),[c,u]=j.useState(-1),d="asyncapi-search-results",{portalHost:f,rootElement:h}=dt(),g=Yo(h,a),v=g!=="docked",A=si(h,v),I={left:v?((A==null?void 0:A.left)??0)+Xi:Xi,transform:`translateY(${g==="hidden"?"-150%":"0px"})`,zIndex:40,...v?{position:"fixed",top:10,pointerEvents:g==="hidden"?"none":void 0}:{}},P=()=>{l(!1),u(-1)},S=j.useRef(!1),w=j.useRef(!1);j.useEffect(()=>{if(!h)return;const k=()=>{S.current=!0},L=()=>{S.current=!1};return h.addEventListener("mouseenter",k),h.addEventListener("mouseleave",L),()=>{h.removeEventListener("mouseenter",k),h.removeEventListener("mouseleave",L)}},[h]),j.useEffect(()=>{if(!h)return;const k=L=>{w.current=h.contains(L.target)};return document.addEventListener("mousedown",k,!0),()=>document.removeEventListener("mousedown",k,!0)},[h]),j.useEffect(()=>{if(!h)return;const k=L=>{!(L.metaKey||L.ctrlKey)||L.key.toLowerCase()!=="k"||!(h.contains(document.activeElement)||S.current||w.current)||(L.preventDefault(),l(!0))};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[h]),j.useEffect(()=>{if(!a)return;const k=requestAnimationFrame(()=>{var L;return(L=i.current)==null?void 0:L.focus()});return()=>cancelAnimationFrame(k)},[a]),j.useEffect(()=>{if(!(!a||!f))return qo($o(f))},[a,f]),j.useEffect(()=>{if(!a)return;const k=L=>{L.key==="Escape"&&P()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[a]),j.useEffect(()=>{if(!a)return;const k=L=>{r.current&&!r.current.contains(L.target)&&P()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[a]),j.useEffect(()=>{c>=n.length&&u(n.length-1)},[c,n.length]);const x=a&&e.trim().length>0,C=k=>{P(),s(k)},N=k=>{if(k.key==="Escape"){k.preventDefault(),P();return}if(x){if(k.key==="ArrowDown"){k.preventDefault(),u(L=>n.length===0?-1:Math.min(L+1,n.length-1));return}if(k.key==="ArrowUp"){k.preventDefault(),u(L=>n.length===0?-1:L<=0?n.length-1:L-1);return}if(k.key==="Home"){k.preventDefault(),n.length>0&&u(0);return}if(k.key==="End"){k.preventDefault(),n.length>0&&u(n.length-1);return}if(k.key==="Enter"&&c>=0&&n[c]){k.preventDefault(),C(n[c]);return}}},_=k=>`asyncapi-search-result-${k}`,Y=x?`${n.length} result${n.length===1?"":"s"} found`:"",E=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>l(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",style:I,children:o.jsx(ic,{})}),a&&f&&Ys.createPortal(o.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",children:[o.jsx("div",{className:"absolute inset-0 bg-black/30"}),o.jsxs("div",{ref:r,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[o.jsx("div",{className:"p-4",children:o.jsx("input",{ref:i,id:"asyncapi-search",type:"search",value:e,onChange:k=>t(k.target.value),onKeyDown:N,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":x,"aria-controls":d,"aria-autocomplete":"list","aria-activedescendant":c>=0?_(c):void 0,className:"w-full rounded-md bg-surface px-4 py-3 text-sm text-foreground placeholder:text-foreground-muted focus:outline-none"})}),o.jsx("div",{"aria-live":"polite",className:"sr-only",children:Y}),x&&o.jsx("div",{id:d,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?o.jsx("ul",{className:"divide-y divide-border",children:n.map((k,L)=>o.jsx("li",{children:o.jsxs("button",{id:_(L),type:"button",role:"option","aria-selected":c===L,onClick:()=>C(k),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(c===L?"bg-neutral-100":""),children:[o.jsx("div",{className:"text-sm font-semibold text-foreground",children:k.name}),o.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[o.jsx("span",{children:k.location}),k.subtitle&&o.jsxs("span",{children:["• ",k.subtitle]})]})]})},k.id))}):o.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),o.jsxs("div",{className:"flex items-center justify-center gap-1 px-4 py-1.5 text-xs text-foreground-muted",children:["Press",o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:E?"⌘ Cmd":"Ctrl"}),o.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]}),f)]})}function Gt(e){return Array.isArray?Array.isArray(e):Qo(e)==="[object Array]"}function ac(e){if(typeof e=="string")return e;if(typeof e=="bigint")return e.toString();const t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function Ss(e){return e==null?"":ac(e)}function Xe(e){return typeof e=="string"}function Cr(e){return typeof e=="number"}function lc(e){return e===!0||e===!1||cc(e)&&Qo(e)=="[object Boolean]"}function Jo(e){return typeof e=="object"}function cc(e){return Jo(e)&&e!==null}function ct(e){return e!=null}function Er(e){return!e.trim().length}function Qo(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const uc="Incorrect 'index' type",Ns="Invalid doc index: must be a non-negative integer within the bounds of the docs array",dc=e=>`Invalid value for key ${e}`,fc=e=>`Pattern length exceeds max of ${e}.`,pc=e=>`Missing ${e} property in key`,hc=e=>`Property 'weight' in key '${e}' must be a positive integer`,mc="Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.",Zi=Object.prototype.hasOwnProperty;var gc=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const s=Go(n);this._keys.push(s),this._keyMap[s.id]=s,t+=s.weight}),this._keys.forEach(n=>{n.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function Go(e){let t=null,n=null,s=null,r=1,i=null;if(Xe(e)||Gt(e))s=e,t=Ki(e),n=Or(e);else{if(!Zi.call(e,"name"))throw new Error(pc("name"));const a=e.name;if(s=a,Zi.call(e,"weight")&&e.weight!==void 0&&(r=e.weight,r<=0))throw new Error(hc(Or(a)));t=Ki(a),n=Or(a),i=e.getFn??null}return{path:t,id:n,weight:r,src:s,getFn:i}}function Ki(e){return Gt(e)?e:e.split(".")}function Or(e){return Gt(e)?e.join("."):e}function xc(e,t){const n=[];let s=!1;const r=(i,a,l,c)=>{if(ct(i))if(!a[l])n.push(c!==void 0?{v:i,i:c}:i);else{const u=i[a[l]];if(!ct(u))return;if(l===a.length-1&&(Xe(u)||Cr(u)||lc(u)||typeof u=="bigint"))n.push(c!==void 0?{v:Ss(u),i:c}:Ss(u));else if(Gt(u)){s=!0;for(let d=0,f=u.length;d<f;d+=1)r(u[d],a,l+1,d)}else a.length&&r(u,a,l+1,c)}};return r(e,Xe(t)?t.split("."):t,0),s?n:n[0]}const bc={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},yc={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},vc={location:0,threshold:.6,distance:100},wc={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:xc,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Q=Object.freeze({...yc,...bc,...vc,...wc});function Ec(e){return e>=9&&e<=13||e===32||e===160}function Ac(e=1,t=3){const n=new Map,s=Math.pow(10,t);return{get(r){let i=0,a=!1;for(let c=0;c<r.length;c++)Ec(r.charCodeAt(c))?a=!1:a||(i++,a=!0);if(i===0&&(i=1),n.has(i))return n.get(i);const l=Math.round(s/Math.pow(i,.5*e))/s;return n.set(i,l),l},clear(){n.clear()}}}var ii=class{constructor({getFn:e=Q.getFn,fieldNormWeight:t=Q.fieldNormWeight}={}){this.norm=Ac(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((t,n)=>{this._keysMap[t.id]=n})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;const e=this.docs.length;this.records=new Array(e);let t=0;if(Xe(this.docs[0]))for(let n=0;n<e;n++){const s=this._createStringRecord(this.docs[n],n);s&&(this.records[t++]=s)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw new Error(Ns);if(Xe(e)){const s=this._createStringRecord(e,t);return s&&this.records.push(s),s}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(Ns);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&(this.records[t].i-=1)}removeAll(e){const t=new Set;for(const s of e)Number.isInteger(s)&&s>=0&&t.add(s);if(t.size===0)return;this.records=this.records.filter(s=>!t.has(s.i));const n=Array.from(t).sort((s,r)=>s-r);for(const s of this.records){let r=0,i=n.length;for(;r<i;){const a=r+i>>>1;n[a]<s.i?r=a+1:i=a}s.i-=r}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ct(e)||Er(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let s=0,r=this.keys.length;s<r;s++){const i=this.keys[s],a=i.getFn?i.getFn(e):this.getFn(e,i.path);if(ct(a)){if(Gt(a)){const l=[];for(let c=0,u=a.length;c<u;c+=1){const d=a[c];if(ct(d)){if(Xe(d)){if(!Er(d)){const f={v:d,i:c,n:this.norm.get(d)};l.push(f)}}else if(ct(d.v)){const f=Xe(d.v)?d.v:Ss(d.v);if(!Er(f)){const h={v:f,i:d.i,n:this.norm.get(f)};l.push(h)}}}}n.$[s]=l}else if(Xe(a)&&!Er(a)){const l={v:a,n:this.norm.get(a)};n.$[s]=l}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function ea(e,t,{getFn:n=Q.getFn,fieldNormWeight:s=Q.fieldNormWeight}={}){const r=new ii({getFn:n,fieldNormWeight:s});return r.setKeys(e.map(Go)),r.setSources(t),r.create(),r}function kc(e,{getFn:t=Q.getFn,fieldNormWeight:n=Q.fieldNormWeight}={}){const{keys:s,records:r}=e,i=new ii({getFn:t,fieldNormWeight:n});return i.setKeys(s),i.setIndexRecords(r),i}function jc(e=[],t=Q.minMatchCharLength){const n=[];let s=-1,r=-1,i=0;for(let a=e.length;i<a;i+=1){const l=e[i];l&&s===-1?s=i:!l&&s!==-1&&(r=i-1,r-s+1>=t&&n.push([s,r]),s=-1)}return e[i-1]&&i-s>=t&&n.push([s,i-1]),n}function Sc(e,t,n,{location:s=Q.location,distance:r=Q.distance,threshold:i=Q.threshold,findAllMatches:a=Q.findAllMatches,minMatchCharLength:l=Q.minMatchCharLength,includeMatches:c=Q.includeMatches,ignoreLocation:u=Q.ignoreLocation}={}){if(t.length>32)throw new Error(fc(32));const d=t.length,f=e.length,h=Math.max(0,Math.min(s,f));let g=i,v=h;const A=(E,k)=>{const L=E/d;if(u)return L;const ae=Math.abs(h-k);return r?L+ae/r:ae?1:L},I=l>1||c,P=I?Array(f):[];let S;for(;(S=e.indexOf(t,v))>-1;){const E=A(0,S);if(g=Math.min(E,g),v=S+d,I){let k=0;for(;k<d;)P[S+k]=1,k+=1}}v=-1;let w=[],x=1,C=0,N=d+f;const _=1<<d-1;for(let E=0;E<d;E+=1){let k=0,L=N;for(;k<L;)A(E,h+L)<=g?k=L:N=L,L=Math.floor((N-k)/2+k);N=L;let ae=Math.max(1,h-L+1);const se=a?f:Math.min(h+L,f)+d,Ae=Array(se+2);Ae[se+1]=(1<<E)-1;for(let fe=se;fe>=ae;fe-=1){const Ce=fe-1,ie=n[e[Ce]];if(Ae[fe]=(Ae[fe+1]<<1|1)&ie,E&&(Ae[fe]|=(w[fe+1]|w[fe])<<1|1|w[fe+1]),Ae[fe]&_&&(x=A(E,Ce),x<=g)){if(g=x,v=Ce,C=E,v<=h)break;ae=Math.max(1,2*h-v)}}if(A(E+1,h)>g)break;w=Ae}if(I&&v>=0){const E=Math.min(f-1,v+d-1+C);for(let k=v;k<=E;k+=1)n[e[k]]&&(P[k]=1)}const Y={isMatch:v>=0,score:Math.max(.001,x)};if(I){const E=jc(P,l);E.length?c&&(Y.indices=E):Y.isMatch=!1}return Y}function Nc(e){const t={};for(let n=0,s=e.length;n<s;n+=1){const r=e.charAt(n);t[r]=(t[r]||0)|1<<s-n-1}return t}function oi(e){if(e.length<=1)return e;e.sort((n,s)=>n[0]-s[0]||n[1]-s[1]);const t=[e[0]];for(let n=1,s=e.length;n<s;n+=1){const r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}const ta={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},Tc=new RegExp("["+Object.keys(ta).join("")+"]","g"),Kn=typeof String.prototype.normalize=="function"?e=>e.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(Tc,t=>ta[t]):e=>e;var ai=class{constructor(e,{location:t=Q.location,threshold:n=Q.threshold,distance:s=Q.distance,includeMatches:r=Q.includeMatches,findAllMatches:i=Q.findAllMatches,minMatchCharLength:a=Q.minMatchCharLength,isCaseSensitive:l=Q.isCaseSensitive,ignoreDiacritics:c=Q.ignoreDiacritics,ignoreLocation:u=Q.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:s,includeMatches:r,findAllMatches:i,minMatchCharLength:a,isCaseSensitive:l,ignoreDiacritics:c,ignoreLocation:u},e=l?e:e.toLowerCase(),e=c?Kn(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const d=(h,g)=>{this.chunks.push({pattern:h,alphabet:Nc(h),startIndex:g})},f=this.pattern.length;if(f>32){let h=0;const g=f%32,v=f-g;for(;h<v;)d(this.pattern.substr(h,32),h),h+=32;if(g){const A=f-32;d(this.pattern.substr(A),A)}}else d(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:s}=this.options;if(e=t?e:e.toLowerCase(),e=n?Kn(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const v={isMatch:!0,score:0};return s&&(v.indices=[[0,e.length-1]]),v}const{location:r,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,ignoreLocation:u}=this.options,d=[];let f=0,h=!1;this.chunks.forEach(({pattern:v,alphabet:A,startIndex:I})=>{const{isMatch:P,score:S,indices:w}=Sc(e,v,A,{location:r+I,distance:i,threshold:a,findAllMatches:l,minMatchCharLength:c,includeMatches:s,ignoreLocation:u});P&&(h=!0),f+=S,P&&w&&d.push(...w)});const g={isMatch:h,score:h?f/this.chunks.length:1};return h&&s&&(g.indices=oi(d)),g}};const _c=new Set(["fuzzy","include"]);function Cc(e){return e.startsWith("inverse")}const Ts=[{type:"exact",multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:"exact",search(t){const n=t===e;return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"include",multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:"include",search(t){let n=0,s;const r=[],i=e.length;for(;(s=t.indexOf(e,n))>-1;)n=s+i,r.push([s,n-1]);const a=!!r.length;return{isMatch:a,score:a?0:1,indices:r}}})},{type:"prefix-exact",multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:"prefix-exact",search(t){const n=t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}})},{type:"inverse-prefix-exact",multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:"inverse-prefix-exact",search(t){const n=!t.startsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"inverse-suffix-exact",multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:"inverse-suffix-exact",search(t){const n=!t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"suffix-exact",multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:"suffix-exact",search(t){const n=t.endsWith(e);return{isMatch:n,score:n?0:1,indices:[t.length-e.length,t.length-1]}}})},{type:"inverse-exact",multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:"inverse-exact",search(t){const n=t.indexOf(e)===-1;return{isMatch:n,score:n?0:1,indices:[0,t.length-1]}}})},{type:"fuzzy",multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{const n=new ai(e,{location:t.location??Q.location,threshold:t.threshold??Q.threshold,distance:t.distance??Q.distance,includeMatches:t.includeMatches??Q.includeMatches,findAllMatches:t.findAllMatches??Q.findAllMatches,minMatchCharLength:t.minMatchCharLength??Q.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??Q.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??Q.ignoreDiacritics,ignoreLocation:t.ignoreLocation??Q.ignoreLocation});return{type:"fuzzy",search(s){return n.searchIn(s)}}}}],Yi=Ts.length,Oc="\0",Ic="|";function Mc(e){const t=[],n=e.length;let s=0;for(;s<n;){for(;s<n&&e[s]===" ";)s++;if(s>=n)break;let r=s;for(;r<n&&e[r]!==" "&&e[r]!=='"';)r++;if(r<n&&e[r]==='"'){for(r++;r<n;){if(e[r]==='"'){const i=r+1;if(i>=n||e[i]===" "){r++;break}if(e[i]==="$"&&(i+1>=n||e[i+1]===" ")){r+=2;break}}r++}t.push(e.substring(s,r)),s=r}else{for(;r<n&&e[r]!==" ";)r++;t.push(e.substring(s,r)),s=r}}return t}function Ji(e,t){const n=e.match(t);return n?n[1]:null}function Rc(e,t={}){return e.replace(/\\\|/g,Oc).split(Ic).map(n=>{const s=Mc(n.replace(/\u0000/g,"|").trim()).filter(i=>i&&!!i.trim()),r=[];for(let i=0,a=s.length;i<a;i+=1){const l=s[i];let c=!1,u=-1;for(;!c&&++u<Yi;){const d=Ts[u],f=Ji(l,d.multiRegex);f&&(r.push(d.create(f,t)),c=!0)}if(!c)for(u=-1;++u<Yi;){const d=Ts[u],f=Ji(l,d.singleRegex);if(f){r.push(d.create(f,t));break}}}return r})}var Lc=class{constructor(e,{isCaseSensitive:t=Q.isCaseSensitive,ignoreDiacritics:n=Q.ignoreDiacritics,includeMatches:s=Q.includeMatches,minMatchCharLength:r=Q.minMatchCharLength,ignoreLocation:i=Q.ignoreLocation,findAllMatches:a=Q.findAllMatches,location:l=Q.location,threshold:c=Q.threshold,distance:u=Q.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:s,minMatchCharLength:r,findAllMatches:a,ignoreLocation:i,location:l,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?Kn(e):e,this.pattern=e,this.query=Rc(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){const t=this.query;if(!t)return{isMatch:!1,score:1};const{includeMatches:n,isCaseSensitive:s,ignoreDiacritics:r}=this.options;e=s?e:e.toLowerCase(),e=r?Kn(e):e;let i=0;const a=[];let l=0,c=!1;for(let u=0,d=t.length;u<d;u+=1){const f=t[u];a.length=0,i=0,c=!1;for(let h=0,g=f.length;h<g;h+=1){const v=f[h],{isMatch:A,indices:I,score:P}=v.search(e);if(A)i+=1,l+=P,Cc(v.type)&&(c=!0),n&&(_c.has(v.type)?a.push(...I):a.push(I));else{l=0,i=0,a.length=0,c=!1;break}}if(i){const h={isMatch:!0,score:l/i};return c&&(h.hasInverse=!0),n&&(h.indices=oi(a)),h}}return{isMatch:!1,score:1}}};const _s=[];function li(...e){_s.push(...e)}function Lr(e,t){for(let n=0,s=_s.length;n<s;n+=1){const r=_s[n];if(r.condition(e,t))return new r(e,t)}return new ai(e,t)}const Pr={AND:"$and",OR:"$or"},Cs={PATH:"$path",PATTERN:"$val"},Os=e=>!!(e[Pr.AND]||e[Pr.OR]),Pc=e=>!!e[Cs.PATH],Dc=e=>!Gt(e)&&Jo(e)&&!Os(e),Qi=e=>({[Pr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function na(e,t,{auto:n=!0}={}){const s=r=>{if(Xe(r)){const c={keyId:null,pattern:r};return n&&(c.searcher=Lr(r,t)),c}const i=Object.keys(r),a=Pc(r);if(!a&&i.length>1&&!Os(r))return s(Qi(r));if(Dc(r)){const c=a?r[Cs.PATH]:i[0],u=a?r[Cs.PATTERN]:r[c];if(!Xe(u))throw new Error(dc(c));const d={keyId:Or(c),pattern:u};return n&&(d.searcher=Lr(u,t)),d}const l={children:[],operator:i[0]};return i.forEach(c=>{const u=r[c];Gt(u)&&u.forEach(d=>{l.children.push(s(d))})}),l};return Os(e)||(e=Qi(e)),s(e)}function Is(e,{ignoreFieldNorm:t=Q.ignoreFieldNorm}){let n=1;return e.forEach(({key:s,norm:r,score:i})=>{const a=s?s.weight:null;n*=Math.pow(i===0&&a?Number.EPSILON:i,(a||1)*(t?1:r))}),n}function Bc(e,{ignoreFieldNorm:t=Q.ignoreFieldNorm}){e.forEach(n=>{n.score=Is(n.matches,{ignoreFieldNorm:t})})}var Fc=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){const t=this.heap;for(;e>0;){const n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;const s=t[e];t[e]=t[n],t[n]=s,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let s=e;do{e=s;const r=2*e+1,i=2*e+2;if(r<n&&this.comparator(t[r],t[s])>0&&(s=r),i<n&&this.comparator(t[i],t[s])>0&&(s=i),s!==e){const a=t[e];t[e]=t[s],t[s]=a}}while(s!==e)}};function zc(e){const t=[];return e.matches.forEach(n=>{if(!ct(n.indices)||!n.indices.length)return;const s={indices:n.indices,value:n.value};n.key&&(s.key=n.key.id),n.idx>-1&&(s.refIndex=n.idx),t.push(s)}),t}function Hc(e,t,{includeMatches:n=Q.includeMatches,includeScore:s=Q.includeScore}={}){return e.map(r=>{const{idx:i}=r,a={item:t[i],refIndex:i};return n&&(a.matches=zc(r)),s&&(a.score=r.score),a})}const Uc=/[\p{L}\p{M}\p{N}_]+/gu,Gi=new WeakSet;function Wc(e){Gi.has(e)||(Gi.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function $c(e){if(typeof e=="function"){let t=!1;return n=>{const s=e(n);if(!t&&(t=!0,!Array.isArray(s)||s.some(r=>typeof r!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(s)?"array containing non-strings":typeof s}.`);return s}}return e instanceof RegExp?(e.global||Wc(e),t=>t.match(e)||[]):t=>t.match(Uc)||[]}function Ms({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const s=$c(n);return{tokenize(r){return e||(r=r.toLowerCase()),t&&(r=Kn(r)),s(r)}}}var qc=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Ms({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:s,fieldCount:r}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const i of n){this.termSearchers.push(new ai(i,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));const a=s.get(i)||0,l=Math.log(1+(r-a+.5)/(a+.5));this.idfWeights.push(l)}this.combineAll=t.tokenMatch==="all",this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const t=[];let n=0,s=0,r=0,i=0;const a=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),f=this.idfWeights[u];s+=f,d.isMatch&&(r++,n+=f*(1-d.score),d.indices&&t.push(...d.indices),this.combineAll&&(this.useMask?i|=1<<u:a.add(u)))}if(r===0)return{isMatch:!1,score:1};const l=s>0?1-n/s:0,c={isMatch:!0,score:Math.max(.001,l)};return this.options.includeMatches&&t.length&&(c.indices=oi(t)),this.combineAll&&(this.useMask?c.matchedMask=i:c.matchedTerms=a,c.termCount=this.numTerms),c}};function ms(e,t,n,s){const r=s.tokenize(t);if(!r.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const i=new Set(r);let a=e.docTermFieldHits.get(n);a||(a=new Map,e.docTermFieldHits.set(n,a));for(const l of i)a.set(l,(a.get(l)||0)+1),e.df.set(l,(e.df.get(l)||0)+1)}function ra(e,t,n,s){const{i:r,v:i,$:a}=t;if(i!==void 0){ms(e,i,r,s);return}if(a)for(let l=0;l<n;l++){const c=a[l];if(c)if(Array.isArray(c))for(const u of c)ms(e,u.v,r,s);else ms(e,c.v,r,s)}}function Vc(e,t,n){const s={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const r of e)ra(s,r,t,n);return s}function Xc(e,t,n,s){ra(e,t,n,s)}function Zc(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const s=e.docTermFieldHits.get(t);if(s){for(const[r,i]of s){const a=(e.df.get(r)||0)-i;a<=0?e.df.delete(r):e.df.set(r,a)}e.docTermFieldHits.delete(t)}}function eo(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((l,c)=>l-c);for(const l of n)Zc(e,l);const s=l=>{let c=0,u=n.length;for(;c<u;){const d=c+u>>>1;n[d]<l?c=d+1:u=d}return l-c},r=n[0],i=new Map;for(const[l,c]of e.docFieldCount)i.set(l>r?s(l):l,c);e.docFieldCount=i;const a=new Map;for(const[l,c]of e.docTermFieldHits)a.set(l>r?s(l):l,c);e.docTermFieldHits=a}var en=class{constructor(e,t,n){this.options={...Q,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new gc(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const t=Lr(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof ii))throw new Error(uc);if(this._myIndex=t||ea(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=Ms({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Vc(this._myIndex.records,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}add(e){if(!ct(e))return;this._docs.push(e);const t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){const n=Ms({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Xc(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let s=0,r=this._docs.length;s<r;s+=1)e(this._docs[s],s)&&(t.push(this._docs[s]),n.push(s));if(n.length){this._invertedIndex&&eo(this._invertedIndex,n);const s=new Set(n);this._docs=this._docs.filter((r,i)=>!s.has(i)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(Ns);this._invertedIndex&&eo(this._invertedIndex,[e]);const t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){const{limit:n=-1}=t||{},{includeMatches:s,includeScore:r,shouldSort:i,sortFn:a,ignoreFieldNorm:l}=this.options;if(Xe(e)&&!e.trim()){let h=this._docs.map((g,v)=>({item:g,refIndex:v}));return Cr(n)&&n>-1&&(h=h.slice(0,n)),h}const c=i&&Cr(n)&&n>0&&Xe(e),u=a,d=(h,g)=>u(h,g)||h.idx-g.idx;let f;if(c){const h=new Fc(n,d);Xe(this._docs[0])?this._searchStringList(e,{heap:h,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:h,ignoreFieldNorm:l}),f=h.extractSorted()}else f=Xe(e)?Xe(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Bc(f,{ignoreFieldNorm:l}),i&&f.sort(Xe(e)?d:u),Cr(n)&&n>-1&&(f=f.slice(0,n));return Hc(f,this._docs,{includeMatches:s,includeScore:r})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const s=this._getSearcher(e),r=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=t?null:[];return i.forEach(({v:l,i:c,n:u})=>{if(!ct(l))return;const d=s.searchIn(l);if(d.isMatch){const f={score:d.score,value:l,norm:u,indices:d.indices};r&&(f.matchedMask=d.matchedMask,f.matchedTerms=d.matchedTerms,f.termCount=d.termCount);const h=[f];if(!r||this._coversAllTokens(h)){const g={item:l,idx:c,matches:h};t?(g.score=Is(g.matches,{ignoreFieldNorm:n}),t.insert(g)):a.push(g)}}}),a}_searchLogical(e){const t=na(e,this.options),n=this._normalizedKeys(),s=(l,c,u)=>{if(!("children"in l)){const{keyId:g,searcher:v}=l;let A;return g===null?(A=[],n.forEach((I,P)=>{A.push(...this._findMatches({key:I,value:c[P],searcher:v}))})):A=this._findMatches({key:this._keyStore.get(g),value:this._myIndex.getValueForItemAtKeyId(c,g),searcher:v}),A&&A.length?[{idx:u,item:c,matches:A}]:[]}const{children:d,operator:f}=l,h=[];for(let g=0,v=d.length;g<v;g+=1){const A=d[g],I=s(A,c,u);if(I.length)h.push(...I);else if(f===Pr.AND)return[]}return h},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:l,i:c})=>{if(ct(l)){const u=s(t,l,c);u.length&&(i.has(c)||(i.set(c,{idx:c,item:l,matches:[]}),a.push(i.get(c))),u.forEach(({matches:d})=>{i.get(c).matches.push(...d)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const s=this._getSearcher(e),r=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:i}=this._myIndex,a=this._normalizedKeys(),l=t?null:[];return i.forEach(({$:c,i:u})=>{if(!ct(c))return;const d=[];let f=!1,h=!1;if(a.forEach((g,v)=>{const A=this._findMatches({key:g,value:c[v],searcher:s});A.length?(d.push(...A),A[0].hasInverse&&(h=!0)):f=!0}),!(h&&f)&&d.length&&(!r||this._coversAllTokens(d))){const g={idx:u,item:c,matches:d};t?(g.score=Is(g.matches,{ignoreFieldNorm:n}),t.insert(g)):l.push(g)}}),l}_findMatches({key:e,value:t,searcher:n}){if(!ct(t))return[];const s=[];if(Gt(t))t.forEach(({v:r,i,n:a})=>{if(!ct(r))return;const l=n.searchIn(r);if(l.isMatch){const c={score:l.score,key:e,value:r,idx:i,norm:a,indices:l.indices,hasInverse:l.hasInverse};l.termCount!==void 0&&(c.matchedMask=l.matchedMask,c.matchedTerms=l.matchedTerms,c.termCount=l.termCount),s.push(c)}});else{const{v:r,n:i}=t,a=n.searchIn(r);if(a.isMatch){const l={score:a.score,key:e,value:r,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(l.matchedMask=a.matchedMask,l.matchedTerms=a.matchedTerms,l.termCount=a.termCount),s.push(l)}}return s}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let s=0;for(let r=0;r<e.length;r++)s|=e[r].matchedMask||0;return s===2**t-1}const n=new Set;for(let s=0;s<e.length;s++){const r=e[s].matchedTerms;if(r)for(const i of r)n.add(i)}return n.size===t}};en.version="7.5.0";en.createIndex=ea;en.parseIndex=kc;en.config=Q;en.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(mc);return Lr(e,{...Q,...n}).searchIn(t)};en.parseQuery=na;li(Lc);li(qc);en.use=function(...e){e.forEach(t=>li(t))};var Kc=en;const Ht=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ir=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>Ir(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,s])=>[n,Ir(s,t)]).join(" "):Ht(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,s])=>[n,Ir(s,t)]).join(" ")):"",At=e=>Ir(e).trim().replace(/\s+/g," "),Yc=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Jc=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Qc=e=>{if(!Ht(e))return e;const t={};for(const[n,s]of Object.entries(e))Jc.has(n)||(t[n]=s);return t},Gc=(e,t,n,s)=>{const r=`schema-${n}`,i=(l,c,u,d)=>{const f=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,h=`Schemas > ${s}${u.length?` > ${u.join(" > ")}`:""}`,g=Ht(l)?l.description:void 0,v=c.length?`${s}.${c.join(".")}`:s;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:d?Yc(n,d):r,type:"schema",tab:"schemas",key:n,name:v,path:f,location:h,subtitle:g,text:At([Qc(l)]),schemaFocusTokens:d&&d.length>0?d:void 0})},a=(l,c=[],u=[],d=[])=>{if(i(l,c,u,d),!Ht(l))return;if(Ht(l.properties))for(const[h,g]of Object.entries(l.properties))a(g,[...c,"properties",h],[...u,h],d?[...d,"properties",h]:null);const f=l.items;Ht(f)?a(f,[...c,"items"],[...u,"items"],d?[...d,"items"]:null):Array.isArray(f)&&f.forEach((h,g)=>{a(h,[...c,`items[${g}]`],[...u,`items[${g}]`],null)});for(const h of["allOf","oneOf","anyOf"]){const g=l[h];Array.isArray(g)&&g.forEach((v,A)=>{a(v,[...c,`${h}[${A}]`],[...u,`${h}[${A}]`],d&&h!=="allOf"?[...d,`${h}[${A}]`]:null)})}Ht(l.additionalProperties)&&a(l.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null)};a(t)};function eu(e){var n,s;const t=[];if(e.info){const r=e.info.title??"Info",i=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:r,path:"info",location:"Info",subtitle:i,text:At([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[r,i]of Object.entries(e.servers)){const a=i,l=a.description??r,c=[a.protocol,a.host].filter(Boolean).join(" ");t.push({id:`server-${r}`,targetId:`server-${r}`,type:"server",tab:"servers",key:r,name:r,path:`servers.${r}`,location:`Servers > ${r}`,subtitle:c,text:At([r,l,c,a.description,a.protocol,a.host,a.variables,a.security,a.bindings])});const u=a.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${r}-security`,targetId:`server-${r}-security`,type:"server",tab:"servers",key:r,name:`${r} > Authorization`,path:`servers.${r}.security`,location:`Servers > ${r} > Authorization`,focusSection:"security",text:At(u)});const d=a.bindings,f=Ht(d)&&a.protocol?d[a.protocol]:void 0;f!=null&&t.push({id:`server-${r}-bindings`,targetId:`server-${r}-bindings`,type:"server",tab:"servers",key:r,name:`${r} > ${a.protocol} configuration`,path:`servers.${r}.bindings.${a.protocol}`,location:`Servers > ${r} > ${a.protocol} configuration`,focusSection:`binding:${a.protocol}`,text:At(f)})}if(e.operations)for(const[r,i]of Object.entries(e.operations)){const a=i.title??r,l=i.summary??i.description??i.action??"";t.push({id:`operation-${r}`,targetId:`operation-${r}-detail`,type:"operation",tab:"operations",key:r,name:a,path:`operations.${r}`,location:`Operations > ${a}`,subtitle:l,text:At([r,a,l,i.action,i.channel,i.messages,i.reply,i.traits,i.bindings,i.security,i.tags])});const c=i.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${r}-security`,targetId:`operation-${r}-security`,type:"operation",tab:"operations",key:r,name:`${a} > Authorization`,path:`operations.${r}.security`,location:`Operations > ${a} > Authorization`,focusSection:"security",text:At(c)});const u=i.bindings;if(Ht(u))for(const[d,f]of Object.entries(u))f!=null&&t.push({id:`operation-${r}-bindings-${d}`,targetId:`operation-${r}-bindings-${d}`,type:"operation",tab:"operations",key:r,name:`${a} > ${d} configuration`,path:`operations.${r}.bindings.${d}`,location:`Operations > ${a} > ${d} configuration`,focusSection:`binding:${d}`,text:At(f)})}if((n=e.components)!=null&&n.messages)for(const[r,i]of Object.entries(e.components.messages)){const a=i.title??i.name??r,l=i.summary??i.description??i.contentType??"";t.push({id:`message-${r}`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:a,path:`components.messages.${r}`,location:`Messages > ${a}`,subtitle:l,text:At([r,a,l,i.contentType,i.payload,i.headers,i.correlationId,i.tags,i.externalDocs,i.bindings])}),i.payload&&t.push({id:`message-${r}-payload`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:`${a} > Payload`,path:`components.messages.${r}.payload`,location:`Messages > ${a} > Payload`,focusSection:"payload",text:At(i.payload)}),i.headers&&t.push({id:`message-${r}-headers`,targetId:`message-${r}`,type:"message",tab:"messages",key:r,name:`${a} > Headers`,path:`components.messages.${r}.headers`,location:`Messages > ${a} > Headers`,focusSection:"headers",text:At(i.headers)})}if((s=e.components)!=null&&s.schemas)for(const[r,i]of Object.entries(e.components.schemas))Gc(t,i,r,r);return t}function tu(e,t={}){const[n,s]=j.useState(""),[r,i]=j.useState(""),a=t.debounceMs??150;j.useEffect(()=>{const d=setTimeout(()=>i(n),a);return()=>clearTimeout(d)},[n,a]);const l=j.useMemo(()=>eu(e),[e]),c=j.useMemo(()=>new Kc(l,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:t.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[l,t.threshold]),u=j.useMemo(()=>r.trim()?c.search(r.trim(),{limit:t.limit??20}).map(d=>d.item):[],[c,r,t.limit]);return{query:n,setQuery:s,results:u,searchIndex:l}}const Rs="search-match",sa=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function nu(e,t){const n=t.trim().toLowerCase();if(!n)return[];const s=[],r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let i=r.nextNode();i;i=r.nextNode()){const a=(i.textContent??"").toLowerCase();let l=0;for(let c=a.indexOf(n);c!==-1;c=a.indexOf(n,l)){const u=document.createRange();u.setStart(i,c),u.setEnd(i,c+n.length),s.push(u),l=c+n.length}}return s}function ru(e,t){if(!sa())return;const n=nu(e,t);if(!n.length){CSS.highlights.delete(Rs);return}CSS.highlights.set(Rs,new Highlight(...n))}function gs(){sa()&&CSS.highlights.delete(Rs)}const ia={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},su=()=>Promise.resolve().then(()=>require("./LogoExtension-BOYrY_RE.cjs"));var iu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ci(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ou(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?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(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),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 xs,to;function no(){if(to)return xs;to=1;function e(M,R){(R==null||R>M.length)&&(R=M.length);for(var U=0,m=Array(R);U<R;U++)m[U]=M[U];return m}function t(M){if(Array.isArray(M))return M}function n(M,R){var U=M==null?null:typeof Symbol<"u"&&M[Symbol.iterator]||M["@@iterator"];if(U!=null){var m,y,T,q,Ee=[],ce=!0,H=!1;try{if(T=(U=U.call(M)).next,R!==0)for(;!(ce=(m=T.call(U)).done)&&(Ee.push(m.value),Ee.length!==R);ce=!0);}catch(z){H=!0,y=z}finally{try{if(!ce&&U.return!=null&&(q=U.return(),Object(q)!==q))return}finally{if(H)throw y}}return Ee}}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function r(M,R){return t(M)||n(M,R)||i(M,R)||s()}function i(M,R){if(M){if(typeof M=="string")return e(M,R);var U={}.toString.call(M).slice(8,-1);return U==="Object"&&M.constructor&&(U=M.constructor.name),U==="Map"||U==="Set"?Array.from(M):U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U)?e(M,R):void 0}}const a=Object.entries,l=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,d=Object.getOwnPropertyDescriptor;let f=Object.freeze,h=Object.seal,g=Object.create,v=typeof Reflect<"u"&&Reflect,A=v.apply,I=v.construct;f||(f=function(R){return R}),h||(h=function(R){return R}),A||(A=function(R,U){for(var m=arguments.length,y=new Array(m>2?m-2:0),T=2;T<m;T++)y[T-2]=arguments[T];return R.apply(U,y)}),I||(I=function(R){for(var U=arguments.length,m=new Array(U>1?U-1:0),y=1;y<U;y++)m[y-1]=arguments[y];return new R(...m)});const P=pe(Array.prototype.forEach),S=pe(Array.prototype.lastIndexOf),w=pe(Array.prototype.pop),x=pe(Array.prototype.push),C=pe(Array.prototype.splice),N=Array.isArray,_=pe(String.prototype.toLowerCase),Y=pe(String.prototype.toString),E=pe(String.prototype.match),k=pe(String.prototype.replace),L=pe(String.prototype.indexOf),ae=pe(String.prototype.trim),se=pe(Number.prototype.toString),Ae=pe(Boolean.prototype.toString),fe=typeof BigInt>"u"?null:pe(BigInt.prototype.toString),Ce=typeof Symbol>"u"?null:pe(Symbol.prototype.toString),ie=pe(Object.prototype.hasOwnProperty),Te=pe(Object.prototype.toString),be=pe(RegExp.prototype.test),$e=$t(TypeError);function pe(M){return function(R){R instanceof RegExp&&(R.lastIndex=0);for(var U=arguments.length,m=new Array(U>1?U-1:0),y=1;y<U;y++)m[y-1]=arguments[y];return A(M,R,m)}}function $t(M){return function(){for(var R=arguments.length,U=new Array(R),m=0;m<R;m++)U[m]=arguments[m];return I(M,U)}}function te(M,R){let U=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_;if(l&&l(M,null),!N(R))return M;let m=R.length;for(;m--;){let y=R[m];if(typeof y=="string"){const T=U(y);T!==y&&(c(R)||(R[m]=T),y=T)}M[y]=!0}return M}function Rt(M){for(let R=0;R<M.length;R++)ie(M,R)||(M[R]=null);return M}function V(M){const R=g(null);for(const m of a(M)){var U=r(m,2);const y=U[0],T=U[1];ie(M,y)&&(N(T)?R[y]=Rt(T):T&&typeof T=="object"&&T.constructor===Object?R[y]=V(T):R[y]=T)}return R}function ft(M){switch(typeof M){case"string":return M;case"number":return se(M);case"boolean":return Ae(M);case"bigint":return fe?fe(M):"0";case"symbol":return Ce?Ce(M):"Symbol()";case"undefined":return Te(M);case"function":case"object":{if(M===null)return Te(M);const R=M,U=$(R,"toString");if(typeof U=="function"){const m=U(R);return typeof m=="string"?m:Te(m)}return Te(M)}default:return Te(M)}}function $(M,R){for(;M!==null;){const m=d(M,R);if(m){if(m.get)return pe(m.get);if(typeof m.value=="function")return pe(m.value)}M=u(M)}function U(){return null}return U}function oe(M){try{return be(M,""),!0}catch{return!1}}const ge=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"]),le=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"]),ke=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"]),je=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"]),Be=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"]),pt=f(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),et=f(["#text"]),yt=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"]),Ue=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"]),Le=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"]),qt=f(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),tn=h(/{{[\w\W]*|^[\w\W]*}}/g),mn=h(/<%[\w\W]*|^[\w\W]*%>/g),gn=h(/\${[\w\W]*/g),xn=h(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ze=h(/^aria-[\-\w]+$/),Vt=h(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pe=h(/^(?:\w+script|data):/i),rt=h(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Lt=h(/^html$/i),Cn=h(/^[a-z][.\w]*(-[.\w]+)+$/i),ar=h(/<[/\w!]/g),Yr=h(/<[/\w]/g),Jr=h(/<\/no(script|embed|frames)/i),Qr=h(/\/>/i),st={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Gr=function(){return typeof window>"u"?null:window},es=function(R,U){if(typeof R!="object"||typeof R.createPolicy!="function")return null;let m=null;const y="data-tt-policy-suffix";U&&U.hasAttribute(y)&&(m=U.getAttribute(y));const T="dompurify"+(m?"#"+m:"");try{return R.createPolicy(T,{createHTML(q){return q},createScriptURL(q){return q}})}catch{return console.warn("TrustedTypes policy "+T+" could not be created."),null}},lr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ht=function(R,U,m,y){return ie(R,U)&&N(R[U])?te(y.base?V(y.base):{},R[U],y.transform):m};function On(){let M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Gr();const R=B=>On(B);if(R.version="3.4.11",R.removed=[],!M||!M.document||M.document.nodeType!==st.document||!M.Element)return R.isSupported=!1,R;let U=M.document;const m=U,y=m.currentScript;M.DocumentFragment;const T=M.HTMLTemplateElement,q=M.Node,Ee=M.Element,ce=M.NodeFilter,H=M.NamedNodeMap;H===void 0&&(M.NamedNodeMap||M.MozNamedAttrMap),M.HTMLFormElement;const z=M.DOMParser,J=M.trustedTypes,Se=Ee.prototype,Me=$(Se,"cloneNode"),Xt=$(Se,"remove"),In=$(Se,"nextSibling"),Pt=$(Se,"childNodes"),nn=$(Se,"parentNode"),bn=$(Se,"shadowRoot"),Mn=$(Se,"attributes"),Ke=q&&q.prototype?$(q.prototype,"nodeType"):null,Nt=q&&q.prototype?$(q.prototype,"nodeName"):null;if(typeof T=="function"){const B=U.createElement("template");B.content&&B.content.ownerDocument&&(U=B.content.ownerDocument)}let qe,mt="",Rn,ur=!1,rn=0;const vt=function(){if(rn>0)throw $e('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.')},Dt=function(p){vt(),rn++;try{return qe.createHTML(p)}finally{rn--}},dr=function(p){vt(),rn++;try{return qe.createScriptURL(p)}finally{rn--}},ts=function(){return ur||(Rn=es(J,y),ur=!0),Rn},yn=U,Ln=yn.implementation,sn=yn.createNodeIterator,ns=yn.createDocumentFragment,O=yn.getElementsByTagName,K=m.importNode;let Z=lr();R.isSupported=typeof a=="function"&&typeof nn=="function"&&Ln&&Ln.createHTMLDocument!==void 0;const ye=tn,De=mn,it=gn,Tt=xn,vn=Ze,Ye=Pe,ot=rt,fr=Cn;let Pn=Vt,_e=null;const pr=te({},[...ge,...le,...ke,...Be,...et]);let Oe=null;const hr=te({},[...yt,...Ue,...Le,...qt]);let Ie=Object.seal(g(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}})),_t=null,Dn=null;const ze=Object.seal(g(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let mr=!0,on=!0,G=!1,Bn=!0,Ne=!1,he=!0,gt=!1,wt=!1,an=null,ln=null,F=!1,W=!1,ne=!1,ue=!1,He=!0,xt=!1;const gr="user-content-";let Fn=!0,rs=!1,wn={},Ct=null;const ss=te({},["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 _i=null;const Ci=te({},["audio","video","img","source","image","track"]);let is=null;const Oi=te({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xr="http://www.w3.org/1998/Math/MathML",br="http://www.w3.org/2000/svg",Ot="http://www.w3.org/1999/xhtml";let En=Ot,os=!1,as=null;const fl=te({},[xr,br,Ot],Y),Ii=f(["mi","mo","mn","ms","mtext"]);let ls=te({},Ii);const Mi=f(["annotation-xml"]);let cs=te({},Mi);const pl=te({},["title","style","font","a","script"]);let zn=null;const hl=["application/xhtml+xml","text/html"],ml="text/html";let Re=null,An=null;const gl=U.createElement("form"),Ri=function(p){return p instanceof RegExp||p instanceof Function},us=function(){let p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(An&&An===p)return;(!p||typeof p!="object")&&(p={}),p=V(p),zn=hl.indexOf(p.PARSER_MEDIA_TYPE)===-1?ml:p.PARSER_MEDIA_TYPE,Re=zn==="application/xhtml+xml"?Y:_,_e=ht(p,"ALLOWED_TAGS",pr,{transform:Re}),Oe=ht(p,"ALLOWED_ATTR",hr,{transform:Re}),as=ht(p,"ALLOWED_NAMESPACES",fl,{transform:Y}),is=ht(p,"ADD_URI_SAFE_ATTR",Oi,{transform:Re,base:Oi}),_i=ht(p,"ADD_DATA_URI_TAGS",Ci,{transform:Re,base:Ci}),Ct=ht(p,"FORBID_CONTENTS",ss,{transform:Re}),_t=ht(p,"FORBID_TAGS",V({}),{transform:Re}),Dn=ht(p,"FORBID_ATTR",V({}),{transform:Re}),wn=ie(p,"USE_PROFILES")?p.USE_PROFILES&&typeof p.USE_PROFILES=="object"?V(p.USE_PROFILES):p.USE_PROFILES:!1,mr=p.ALLOW_ARIA_ATTR!==!1,on=p.ALLOW_DATA_ATTR!==!1,G=p.ALLOW_UNKNOWN_PROTOCOLS||!1,Bn=p.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Ne=p.SAFE_FOR_TEMPLATES||!1,he=p.SAFE_FOR_XML!==!1,gt=p.WHOLE_DOCUMENT||!1,W=p.RETURN_DOM||!1,ne=p.RETURN_DOM_FRAGMENT||!1,ue=p.RETURN_TRUSTED_TYPE||!1,F=p.FORCE_BODY||!1,He=p.SANITIZE_DOM!==!1,xt=p.SANITIZE_NAMED_PROPS||!1,Fn=p.KEEP_CONTENT!==!1,rs=p.IN_PLACE||!1,Pn=oe(p.ALLOWED_URI_REGEXP)?p.ALLOWED_URI_REGEXP:Vt,En=typeof p.NAMESPACE=="string"?p.NAMESPACE:Ot,ls=ie(p,"MATHML_TEXT_INTEGRATION_POINTS")&&p.MATHML_TEXT_INTEGRATION_POINTS&&typeof p.MATHML_TEXT_INTEGRATION_POINTS=="object"?V(p.MATHML_TEXT_INTEGRATION_POINTS):te({},Ii),cs=ie(p,"HTML_INTEGRATION_POINTS")&&p.HTML_INTEGRATION_POINTS&&typeof p.HTML_INTEGRATION_POINTS=="object"?V(p.HTML_INTEGRATION_POINTS):te({},Mi);const b=ie(p,"CUSTOM_ELEMENT_HANDLING")&&p.CUSTOM_ELEMENT_HANDLING&&typeof p.CUSTOM_ELEMENT_HANDLING=="object"?V(p.CUSTOM_ELEMENT_HANDLING):g(null);if(Ie=g(null),ie(b,"tagNameCheck")&&Ri(b.tagNameCheck)&&(Ie.tagNameCheck=b.tagNameCheck),ie(b,"attributeNameCheck")&&Ri(b.attributeNameCheck)&&(Ie.attributeNameCheck=b.attributeNameCheck),ie(b,"allowCustomizedBuiltInElements")&&typeof b.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=b.allowCustomizedBuiltInElements),h(Ie),Ne&&(on=!1),ne&&(W=!0),wn&&(_e=te({},et),Oe=g(null),wn.html===!0&&(te(_e,ge),te(Oe,yt)),wn.svg===!0&&(te(_e,le),te(Oe,Ue),te(Oe,qt)),wn.svgFilters===!0&&(te(_e,ke),te(Oe,Ue),te(Oe,qt)),wn.mathMl===!0&&(te(_e,Be),te(Oe,Le),te(Oe,qt))),ze.tagCheck=null,ze.attributeCheck=null,ie(p,"ADD_TAGS")&&(typeof p.ADD_TAGS=="function"?ze.tagCheck=p.ADD_TAGS:N(p.ADD_TAGS)&&(_e===pr&&(_e=V(_e)),te(_e,p.ADD_TAGS,Re))),ie(p,"ADD_ATTR")&&(typeof p.ADD_ATTR=="function"?ze.attributeCheck=p.ADD_ATTR:N(p.ADD_ATTR)&&(Oe===hr&&(Oe=V(Oe)),te(Oe,p.ADD_ATTR,Re))),ie(p,"ADD_URI_SAFE_ATTR")&&N(p.ADD_URI_SAFE_ATTR)&&te(is,p.ADD_URI_SAFE_ATTR,Re),ie(p,"FORBID_CONTENTS")&&N(p.FORBID_CONTENTS)&&(Ct===ss&&(Ct=V(Ct)),te(Ct,p.FORBID_CONTENTS,Re)),ie(p,"ADD_FORBID_CONTENTS")&&N(p.ADD_FORBID_CONTENTS)&&(Ct===ss&&(Ct=V(Ct)),te(Ct,p.ADD_FORBID_CONTENTS,Re)),Fn&&(_e["#text"]=!0),gt&&te(_e,["html","head","body"]),_e.table&&(te(_e,["tbody"]),delete _t.tbody),p.TRUSTED_TYPES_POLICY){if(typeof p.TRUSTED_TYPES_POLICY.createHTML!="function")throw $e('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof p.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $e('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const D=qe;qe=p.TRUSTED_TYPES_POLICY;try{mt=Dt("")}catch(X){throw qe=D,X}}else p.TRUSTED_TYPES_POLICY===null?(qe=void 0,mt=""):(qe===void 0&&(qe=ts()),qe&&typeof mt=="string"&&(mt=Dt("")));f&&f(p),An=p},Li=te({},[...le,...ke,...je]),Pi=te({},[...Be,...pt]),xl=function(p,b,D){return b.namespaceURI===Ot?p==="svg":b.namespaceURI===xr?p==="svg"&&(D==="annotation-xml"||ls[D]):!!Li[p]},bl=function(p,b,D){return b.namespaceURI===Ot?p==="math":b.namespaceURI===br?p==="math"&&cs[D]:!!Pi[p]},yl=function(p,b,D){return b.namespaceURI===br&&!cs[D]||b.namespaceURI===xr&&!ls[D]?!1:!Pi[p]&&(pl[p]||!Li[p])},vl=function(p){let b=nn(p);(!b||!b.tagName)&&(b={namespaceURI:En,tagName:"template"});const D=_(p.tagName),X=_(b.tagName);return as[p.namespaceURI]?p.namespaceURI===br?xl(D,b,X):p.namespaceURI===xr?bl(D,b,X):p.namespaceURI===Ot?yl(D,b,X):!!(zn==="application/xhtml+xml"&&as[p.namespaceURI]):!1},Zt=function(p){x(R.removed,{element:p});try{nn(p).removeChild(p)}catch{if(Xt(p),!nn(p))throw $e("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Di=function(p){const b=Pt(p);if(b){const X=[];P(b,re=>{x(X,re)}),P(X,re=>{try{Xt(re)}catch{}})}const D=Mn(p);if(D)for(let X=D.length-1;X>=0;--X){const re=D[X],de=re&&re.name;if(typeof de=="string")try{p.removeAttribute(de)}catch{}}},cn=function(p,b){try{x(R.removed,{attribute:b.getAttributeNode(p),from:b})}catch{x(R.removed,{attribute:null,from:b})}if(b.removeAttribute(p),p==="is")if(W||ne)try{Zt(b)}catch{}else try{b.setAttribute(p,"")}catch{}},wl=function(p){const b=Mn(p);if(b)for(let D=b.length-1;D>=0;--D){const X=b[D],re=X&&X.name;if(!(typeof re!="string"||Oe[Re(re)]))try{p.removeAttribute(re)}catch{}}},El=function(p){const b=[p];for(;b.length>0;){const D=b.pop();(Ke?Ke(D):D.nodeType)===st.element&&wl(D);const re=Pt(D);if(re)for(let de=re.length-1;de>=0;--de)b.push(re[de])}},Bi=function(p){let b=null,D=null;if(F)p="<remove></remove>"+p;else{const de=E(p,/^[\r\n\t ]+/);D=de&&de[0]}zn==="application/xhtml+xml"&&En===Ot&&(p='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+p+"</body></html>");const X=qe?Dt(p):p;if(En===Ot)try{b=new z().parseFromString(X,zn)}catch{}if(!b||!b.documentElement){b=Ln.createDocument(En,"template",null);try{b.documentElement.innerHTML=os?mt:X}catch{}}const re=b.body||b.documentElement;return p&&D&&re.insertBefore(U.createTextNode(D),re.childNodes[0]||null),En===Ot?O.call(b,gt?"html":"body")[0]:gt?b.documentElement:re},Fi=function(p){return sn.call(p.ownerDocument||p,p,ce.SHOW_ELEMENT|ce.SHOW_COMMENT|ce.SHOW_TEXT|ce.SHOW_PROCESSING_INSTRUCTION|ce.SHOW_CDATA_SECTION,null)},yr=function(p){return p=k(p,ye," "),p=k(p,De," "),p=k(p,it," "),p},ds=function(p){var b;p.normalize();const D=sn.call(p.ownerDocument||p,p,ce.SHOW_TEXT|ce.SHOW_COMMENT|ce.SHOW_CDATA_SECTION|ce.SHOW_PROCESSING_INSTRUCTION,null);let X=D.nextNode();for(;X;)X.data=yr(X.data),X=D.nextNode();const re=(b=p.querySelectorAll)===null||b===void 0?void 0:b.call(p,"template");re&&P(re,de=>{kn(de.content)&&ds(de.content)})},vr=function(p){const b=Nt?Nt(p):null;return typeof b!="string"||Re(b)!=="form"?!1:typeof p.nodeName!="string"||typeof p.textContent!="string"||typeof p.removeChild!="function"||p.attributes!==Mn(p)||typeof p.removeAttribute!="function"||typeof p.setAttribute!="function"||typeof p.namespaceURI!="string"||typeof p.insertBefore!="function"||typeof p.hasChildNodes!="function"||p.nodeType!==Ke(p)||p.childNodes!==Pt(p)},kn=function(p){if(!Ke||typeof p!="object"||p===null)return!1;try{return Ke(p)===st.documentFragment}catch{return!1}},Hn=function(p){if(!Ke||typeof p!="object"||p===null)return!1;try{return typeof Ke(p)=="number"}catch{return!1}};function Bt(B,p,b){B.length!==0&&P(B,D=>{D.call(R,p,b,An)})}const Al=function(p,b){return!!(he&&p.hasChildNodes()&&!Hn(p.firstElementChild)&&be(ar,p.textContent)&&be(ar,p.innerHTML)||he&&p.namespaceURI===Ot&&b==="style"&&Hn(p.firstElementChild)||p.nodeType===st.processingInstruction||he&&p.nodeType===st.comment&&be(Yr,p.data))},kl=function(p,b){if(!_t[b]&&Ui(b)&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,b)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(b)))return!1;if(Fn&&!Ct[b]){const D=nn(p),X=Pt(p);if(X&&D){const re=X.length;for(let de=re-1;de>=0;--de){const We=rs?X[de]:Me(X[de],!0);D.insertBefore(We,In(p))}}}return Zt(p),!0},zi=function(p){if(Bt(Z.beforeSanitizeElements,p,null),vr(p))return Zt(p),!0;const b=Re(Nt?Nt(p):p.nodeName);if(Bt(Z.uponSanitizeElement,p,{tagName:b,allowedTags:_e}),Al(p,b))return Zt(p),!0;if(_t[b]||!(ze.tagCheck instanceof Function&&ze.tagCheck(b))&&!_e[b])return kl(p,b);if((Ke?Ke(p):p.nodeType)===st.element&&!vl(p)||(b==="noscript"||b==="noembed"||b==="noframes")&&be(Jr,p.innerHTML))return Zt(p),!0;if(Ne&&p.nodeType===st.text){const X=yr(p.textContent);p.textContent!==X&&(x(R.removed,{element:p.cloneNode()}),p.textContent=X)}return Bt(Z.afterSanitizeElements,p,null),!1},Hi=function(p,b,D){if(Dn[b]||He&&(b==="id"||b==="name")&&(D in U||D in gl))return!1;const X=Oe[b]||ze.attributeCheck instanceof Function&&ze.attributeCheck(b,p);if(!(on&&be(Tt,b))){if(!(mr&&be(vn,b))){if(X){if(!is[b]){if(!be(Pn,k(D,ot,""))){if(!((b==="src"||b==="xlink:href"||b==="href")&&p!=="script"&&L(D,"data:")===0&&_i[p])){if(!(G&&!be(Ye,k(D,ot,"")))){if(D)return!1}}}}}else if(!(Ui(p)&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,p)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(p))&&(Ie.attributeNameCheck instanceof RegExp&&be(Ie.attributeNameCheck,b)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(b,p))||b==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&be(Ie.tagNameCheck,D)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(D))))return!1}}return!0},jl=te({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ui=function(p){return!jl[_(p)]&&be(fr,p)},Sl=function(p,b,D,X){if(qe&&typeof J=="object"&&typeof J.getAttributeType=="function"&&!D)switch(J.getAttributeType(p,b)){case"TrustedHTML":return Dt(X);case"TrustedScriptURL":return dr(X)}return X},Nl=function(p,b,D,X){try{D?p.setAttributeNS(D,b,X):p.setAttribute(b,X),vr(p)?Zt(p):w(R.removed)}catch{cn(b,p)}},Wi=function(p){Bt(Z.beforeSanitizeAttributes,p,null);const b=p.attributes;if(!b||vr(p))return;const D={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Oe,forceKeepAttr:void 0};let X=b.length;const re=Re(p.nodeName);for(;X--;){const de=b[X],We=de.name,Fe=de.namespaceURI,bt=de.value,Et=Re(We),ps=bt;let Je=We==="value"?ps:ae(ps);if(D.attrName=Et,D.attrValue=Je,D.keepAttr=!0,D.forceKeepAttr=void 0,Bt(Z.uponSanitizeAttribute,p,D),Je=D.attrValue,xt&&(Et==="id"||Et==="name")&&L(Je,gr)!==0&&(cn(We,p),Je=gr+Je),he&&be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Je)){cn(We,p);continue}if(Et==="attributename"&&E(Je,"href")){cn(We,p);continue}if(!D.forceKeepAttr){if(!D.keepAttr){cn(We,p);continue}if(!Bn&&be(Qr,Je)){cn(We,p);continue}if(Ne&&(Je=yr(Je)),!Hi(re,Et,Je)){cn(We,p);continue}Je=Sl(re,Et,Fe,Je),Je!==ps&&Nl(p,We,Fe,Je)}}Bt(Z.afterSanitizeAttributes,p,null)},wr=function(p){let b=null;const D=Fi(p);for(Bt(Z.beforeSanitizeShadowDOM,p,null);b=D.nextNode();)if(Bt(Z.uponSanitizeShadowNode,b,null),zi(b),Wi(b),kn(b.content)&&wr(b.content),(Ke?Ke(b):b.nodeType)===st.element){const re=bn(b);kn(re)&&(fs(re),wr(re))}Bt(Z.afterSanitizeShadowDOM,p,null)},fs=function(p){const b=[{node:p,shadow:null}];for(;b.length>0;){const D=b.pop();if(D.shadow){wr(D.shadow);continue}const X=D.node,de=(Ke?Ke(X):X.nodeType)===st.element,We=Pt(X);if(We)for(let Fe=We.length-1;Fe>=0;--Fe)b.push({node:We[Fe],shadow:null});if(de){const Fe=Nt?Nt(X):null;if(typeof Fe=="string"&&Re(Fe)==="template"){const bt=X.content;kn(bt)&&b.push({node:bt,shadow:null})}}if(de){const Fe=bn(X);kn(Fe)&&b.push({node:null,shadow:Fe},{node:Fe,shadow:null})}}};return R.sanitize=function(B){let p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=null,D=null,X=null,re=null;if(os=!B,os&&(B="<!-->"),typeof B!="string"&&!Hn(B)&&(B=ft(B),typeof B!="string"))throw $e("dirty is not a string, aborting");if(!R.isSupported)return B;wt?(_e=an,Oe=ln):us(p),(Z.uponSanitizeElement.length>0||Z.uponSanitizeAttribute.length>0)&&(_e=V(_e)),Z.uponSanitizeAttribute.length>0&&(Oe=V(Oe)),R.removed=[];const de=rs&&typeof B!="string"&&Hn(B);if(de){const bt=Nt?Nt(B):B.nodeName;if(typeof bt=="string"){const Et=Re(bt);if(!_e[Et]||_t[Et])throw $e("root node is forbidden and cannot be sanitized in-place")}if(vr(B))throw $e("root node is clobbered and cannot be sanitized in-place");try{fs(B)}catch(Et){throw Di(B),Et}}else if(Hn(B))b=Bi("<!---->"),D=b.ownerDocument.importNode(B,!0),D.nodeType===st.element&&D.nodeName==="BODY"||D.nodeName==="HTML"?b=D:b.appendChild(D),fs(D);else{if(!W&&!Ne&&!gt&&B.indexOf("<")===-1)return qe&&ue?Dt(B):B;if(b=Bi(B),!b)return W?null:ue?mt:""}b&&F&&Zt(b.firstChild);const We=Fi(de?B:b);try{for(;X=We.nextNode();)zi(X),Wi(X),kn(X.content)&&wr(X.content)}catch(bt){throw de&&Di(B),bt}if(de)return P(R.removed,bt=>{bt.element&&El(bt.element)}),Ne&&ds(B),B;if(W){if(Ne&&ds(b),ne)for(re=ns.call(b.ownerDocument);b.firstChild;)re.appendChild(b.firstChild);else re=b;return(Oe.shadowroot||Oe.shadowrootmode)&&(re=K.call(m,re,!0)),re}let Fe=gt?b.outerHTML:b.innerHTML;return gt&&_e["!doctype"]&&b.ownerDocument&&b.ownerDocument.doctype&&b.ownerDocument.doctype.name&&be(Lt,b.ownerDocument.doctype.name)&&(Fe="<!DOCTYPE "+b.ownerDocument.doctype.name+`>
5
+ `+Fe),Ne&&(Fe=yr(Fe)),qe&&ue?Dt(Fe):Fe},R.setConfig=function(){let B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};us(B),wt=!0,an=_e,ln=Oe},R.clearConfig=function(){An=null,wt=!1,an=null,ln=null,qe=Rn,mt=""},R.isValidAttribute=function(B,p,b){An||us({});const D=Re(B),X=Re(p);return Hi(D,X,b)},R.addHook=function(B,p){typeof p=="function"&&ie(Z,B)&&x(Z[B],p)},R.removeHook=function(B,p){if(ie(Z,B)){if(p!==void 0){const b=S(Z[B],p);return b===-1?void 0:C(Z[B],b,1)[0]}return w(Z[B])}},R.removeHooks=function(B){ie(Z,B)&&(Z[B]=[])},R.removeAllHooks=function(){Z=lr()},R}var cr=On();return xs=cr,xs}var bs,ro;function au(){return ro||(ro=1,bs=self.DOMPurify||(self.DOMPurify=no().default||no())),bs}var lu=au();const oa=ci(lu);function ui(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var pn=ui();function aa(e){pn=e}var Xn={exec:()=>null};function xe(e,t=""){let n=typeof e=="string"?e:e.source;const s={replace:(r,i)=>{let a=typeof i=="string"?i:i.source;return a=a.replace(Ge.caret,"$1"),n=n.replace(r,a),s},getRegex:()=>new RegExp(n,t)};return s}var Ge={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")},cu=/^(?:[ \t]*(?:\n|$))+/,uu=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,du=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Qn=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,fu=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,di=/(?:[*+-]|\d{1,9}[.)])/,la=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ca=xe(la).replace(/bull/g,di).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(),pu=xe(la).replace(/bull/g,di).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(),fi=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,hu=/^[^\n]+/,pi=/(?!\s*\])(?:\\.|[^\[\]\\])+/,mu=xe(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",pi).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),gu=xe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,di).getRegex(),qr="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",hi=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,xu=xe("^ {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",hi).replace("tag",qr).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ua=xe(fi).replace("hr",Qn).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",qr).getRegex(),bu=xe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ua).getRegex(),mi={blockquote:bu,code:uu,def:mu,fences:du,heading:fu,hr:Qn,html:xu,lheading:ca,list:gu,newline:cu,paragraph:ua,table:Xn,text:hu},so=xe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Qn).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",qr).getRegex(),yu={...mi,lheading:pu,table:so,paragraph:xe(fi).replace("hr",Qn).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",so).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",qr).getRegex()},vu={...mi,html:xe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",hi).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:Xn,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:xe(fi).replace("hr",Qn).replace("heading",` *#{1,6} *[^
6
+ ]`).replace("lheading",ca).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},wu=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Eu=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,da=/^( {2,}|\\)\n(?!\s*$)/,Au=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Vr=/[\p{P}\p{S}]/u,gi=/[\s\p{P}\p{S}]/u,fa=/[^\s\p{P}\p{S}]/u,ku=xe(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,gi).getRegex(),pa=/(?!~)[\p{P}\p{S}]/u,ju=/(?!~)[\s\p{P}\p{S}]/u,Su=/(?:[^\s\p{P}\p{S}]|~)/u,Nu=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,ha=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Tu=xe(ha,"u").replace(/punct/g,Vr).getRegex(),_u=xe(ha,"u").replace(/punct/g,pa).getRegex(),ma="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Cu=xe(ma,"gu").replace(/notPunctSpace/g,fa).replace(/punctSpace/g,gi).replace(/punct/g,Vr).getRegex(),Ou=xe(ma,"gu").replace(/notPunctSpace/g,Su).replace(/punctSpace/g,ju).replace(/punct/g,pa).getRegex(),Iu=xe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,fa).replace(/punctSpace/g,gi).replace(/punct/g,Vr).getRegex(),Mu=xe(/\\(punct)/,"gu").replace(/punct/g,Vr).getRegex(),Ru=xe(/^<(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(),Lu=xe(hi).replace("(?:-->|$)","-->").getRegex(),Pu=xe("^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",Lu).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Dr=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Du=xe(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Dr).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ga=xe(/^!?\[(label)\]\[(ref)\]/).replace("label",Dr).replace("ref",pi).getRegex(),xa=xe(/^!?\[(ref)\](?:\[\])?/).replace("ref",pi).getRegex(),Bu=xe("reflink|nolink(?!\\()","g").replace("reflink",ga).replace("nolink",xa).getRegex(),xi={_backpedal:Xn,anyPunctuation:Mu,autolink:Ru,blockSkip:Nu,br:da,code:Eu,del:Xn,emStrongLDelim:Tu,emStrongRDelimAst:Cu,emStrongRDelimUnd:Iu,escape:wu,link:Du,nolink:xa,punctuation:ku,reflink:ga,reflinkSearch:Bu,tag:Pu,text:Au,url:Xn},Fu={...xi,link:xe(/^!?\[(label)\]\((.*?)\)/).replace("label",Dr).getRegex(),reflink:xe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Dr).getRegex()},Ls={...xi,emStrongRDelimAst:Ou,emStrongLDelim:_u,url:xe(/^((?: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.!#$%&'*+\/=?_`{\|}~-]+@)))/},zu={...Ls,br:xe(da).replace("{2,}","*").getRegex(),text:xe(Ls.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ar={normal:mi,gfm:yu,pedantic:vu},Un={normal:xi,gfm:Ls,breaks:zu,pedantic:Fu},Hu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},io=e=>Hu[e];function It(e,t){if(t){if(Ge.escapeTest.test(e))return e.replace(Ge.escapeReplace,io)}else if(Ge.escapeTestNoEncode.test(e))return e.replace(Ge.escapeReplaceNoEncode,io);return e}function oo(e){try{e=encodeURI(e).replace(Ge.percentDecode,"%")}catch{return null}return e}function ao(e,t){var i;const n=e.replace(Ge.findPipe,(a,l,c)=>{let u=!1,d=l;for(;--d>=0&&c[d]==="\\";)u=!u;return u?"|":" |"}),s=n.split(Ge.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),t)if(s.length>t)s.splice(t);else for(;s.length<t;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(Ge.slashPipe,"|");return s}function Wn(e,t,n){const s=e.length;if(s===0)return"";let r=0;for(;r<s&&e.charAt(s-r-1)===t;)r++;return e.slice(0,s-r)}function Uu(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let s=0;s<e.length;s++)if(e[s]==="\\")s++;else if(e[s]===t[0])n++;else if(e[s]===t[1]&&(n--,n<0))return s;return n>0?-2:-1}function lo(e,t,n,s,r){const i=t.href,a=t.title||null,l=e[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:i,title:a,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,c}function Wu(e,t,n){const s=e.match(n.other.indentCodeCompensation);if(s===null)return t;const r=s[1];return t.split(`
7
+ `).map(i=>{const a=i.match(n.other.beginningSpace);if(a===null)return i;const[l]=a;return l.length>=r.length?i.slice(r.length):i}).join(`
8
+ `)}var Br=class{constructor(e){ve(this,"options");ve(this,"rules");ve(this,"lexer");this.options=e||pn}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:Wn(n,`
9
+ `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],s=Wu(n,t[3]||"",this.rules);return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:s}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(this.rules.other.endingHash.test(n)){const s=Wn(n,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(n=s.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Wn(t[0],`
10
+ `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=Wn(t[0],`
11
+ `).split(`
12
+ `),s="",r="";const i=[];for(;n.length>0;){let a=!1;const l=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))l.push(n[c]),a=!0;else if(!a)l.push(n[c]);else break;n=n.slice(c);const u=l.join(`
13
+ `),d=u.replace(this.rules.other.blockquoteSetextReplace,`
14
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
15
+ ${u}`:u,r=r?`${r}
16
+ ${d}`:d;const f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,i,!0),this.lexer.state.top=f,n.length===0)break;const h=i.at(-1);if((h==null?void 0:h.type)==="code")break;if((h==null?void 0:h.type)==="blockquote"){const g=h,v=g.raw+`
17
+ `+n.join(`
18
+ `),A=this.blockquote(v);i[i.length-1]=A,s=s.substring(0,s.length-g.raw.length)+A.raw,r=r.substring(0,r.length-g.text.length)+A.text;break}else if((h==null?void 0:h.type)==="list"){const g=h,v=g.raw+`
19
+ `+n.join(`
20
+ `),A=this.list(v);i[i.length-1]=A,s=s.substring(0,s.length-h.raw.length)+A.raw,r=r.substring(0,r.length-g.raw.length)+A.raw,n=v.substring(i.at(-1).raw.length).split(`
21
+ `);continue}}return{type:"blockquote",raw:s,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const s=n.length>1,r={type:"list",raw:"",ordered:s,start:s?+n.slice(0,-1):"",loose:!1,items:[]};n=s?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=s?n:"[*+-]");const i=this.rules.other.listItemRegex(n);let a=!1;for(;e;){let c=!1,u="",d="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(`
22
+ `,1)[0].replace(this.rules.other.listReplaceTabs,P=>" ".repeat(3*P.length)),h=e.split(`
23
+ `,1)[0],g=!f.trim(),v=0;if(this.options.pedantic?(v=2,d=f.trimStart()):g?v=t[1].length+1:(v=t[2].search(this.rules.other.nonSpaceChar),v=v>4?1:v,d=f.slice(v),v+=t[1].length),g&&this.rules.other.blankLine.test(h)&&(u+=h+`
24
+ `,e=e.substring(h.length+1),c=!0),!c){const P=this.rules.other.nextBulletRegex(v),S=this.rules.other.hrRegex(v),w=this.rules.other.fencesBeginRegex(v),x=this.rules.other.headingBeginRegex(v),C=this.rules.other.htmlBeginRegex(v);for(;e;){const N=e.split(`
25
+ `,1)[0];let _;if(h=N,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),_=h):_=h.replace(this.rules.other.tabCharGlobal," "),w.test(h)||x.test(h)||C.test(h)||P.test(h)||S.test(h))break;if(_.search(this.rules.other.nonSpaceChar)>=v||!h.trim())d+=`
26
+ `+_.slice(v);else{if(g||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||w.test(f)||x.test(f)||S.test(f))break;d+=`
27
+ `+h}!g&&!h.trim()&&(g=!0),u+=N+`
28
+ `,e=e.substring(N.length+1),f=_.slice(v)}}r.loose||(a?r.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(a=!0));let A=null,I;this.options.gfm&&(A=this.rules.other.listIsTask.exec(d),A&&(I=A[0]!=="[ ] ",d=d.replace(this.rules.other.listReplaceTask,""))),r.items.push({type:"list_item",raw:u,task:!!A,checked:I,loose:!1,text:d,tokens:[]}),r.raw+=u}const l=r.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;r.raw=r.raw.trimEnd();for(let c=0;c<r.items.length;c++)if(this.lexer.state.top=!1,r.items[c].tokens=this.lexer.blockTokens(r.items[c].text,[]),!r.loose){const u=r.items[c].tokens.filter(f=>f.type==="space"),d=u.length>0&&u.some(f=>this.rules.other.anyLine.test(f.raw));r.loose=d}if(r.loose)for(let c=0;c<r.items.length;c++)r.items[c].loose=!0;return r}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",r=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:s,title:r}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=ao(t[1]),s=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),r=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
29
+ `):[],i={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<n.length;l++)i.header.push({text:n[l],tokens:this.lexer.inline(n[l]),header:!0,align:i.align[l]});for(const l of r)i.rows.push(ao(l,i.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:i.align[u]})));return i}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===`
30
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;const i=Wn(n.slice(0,-1),"\\");if((n.length-i.length)%2===0)return}else{const i=Uu(t[2],"()");if(i===-2)return;if(i>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let s=t[2],r="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],r=i[3])}else r=t[3]?t[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?s=s.slice(1):s=s.slice(1,-1)),lo(t,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:r&&r.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const s=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),r=t[s.toLowerCase()];if(!r){const i=n[0].charAt(0);return{type:"text",raw:i,text:i}}return lo(n,r,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let s=this.rules.inline.emStrongLDelim.exec(e);if(!s||s[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(s[1]||s[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const i=[...s[0]].length-1;let a,l,c=i,u=0;const d=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+i);(s=d.exec(t))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(l=[...a].length,s[3]||s[4]){c+=l;continue}else if((s[5]||s[6])&&i%3&&!((i+l)%3)){u+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+u);const f=[...s[0]][0].length,h=e.slice(0,i+s.index+f+l);if(Math.min(i,l)%2){const v=h.slice(1,-1);return{type:"em",raw:h,text:v,tokens:this.lexer.inlineTokens(v)}}const g=h.slice(2,-2);return{type:"strong",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const s=this.rules.other.nonSpaceChar.test(n),r=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return s&&r&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,s;return t[2]==="@"?(n=t[1],s="mailto:"+n):(n=t[1],s=n),{type:"link",raw:t[0],text:n,href:s,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let s,r;if(t[2]==="@")s=t[0],r="mailto:"+s;else{let i;do i=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(i!==t[0]);s=t[0],t[1]==="www."?r="http://"+t[0]:r=t[0]}return{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const n=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:n}}}},Ut=class Ps{constructor(t){ve(this,"tokens");ve(this,"options");ve(this,"state");ve(this,"tokenizer");ve(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||pn,this.options.tokenizer=this.options.tokenizer||new Br,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const n={other:Ge,block:Ar.normal,inline:Un.normal};this.options.pedantic?(n.block=Ar.pedantic,n.inline=Un.pedantic):this.options.gfm&&(n.block=Ar.gfm,this.options.breaks?n.inline=Un.breaks:n.inline=Un.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ar,inline:Un}}static lex(t,n){return new Ps(n).lex(t)}static lexInline(t,n){return new Ps(n).inlineTokens(t)}lex(t){t=t.replace(Ge.carriageReturn,`
31
+ `),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const s=this.inlineQueue[n];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],s=!1){var r,i,a;for(this.options.pedantic&&(t=t.replace(Ge.tabCharGlobal," ").replace(Ge.spaceLine,""));t;){let l;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(u=>(l=u.call({lexer:this},t,n))?(t=t.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);const u=n.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
32
+ `:n.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
33
+ `+l.raw,u.text+=`
34
+ `+l.text,this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
35
+ `+l.raw,u.text+=`
36
+ `+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title});continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),n.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0;const d=t.slice(1);let f;this.options.extensions.startBlock.forEach(h=>{f=h.call({lexer:this},d),typeof f=="number"&&f>=0&&(u=Math.min(u,f))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){const u=n.at(-1);s&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
37
+ `+l.raw,u.text+=`
38
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l),s=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
39
+ `+l.raw,u.text+=`
40
+ `+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(l);continue}if(t){const u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,n}inline(t,n=[]){return this.inlineQueue.push({src:t,tokens:n}),n}inlineTokens(t,n=[]){var l,c,u;let s=t,r=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)d.includes(r[0].slice(r[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,r.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(r=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,r.index)+"["+"a".repeat(r[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let i=!1,a="";for(;t;){i||(a=""),i=!1;let d;if((c=(l=this.options.extensions)==null?void 0:l.inline)!=null&&c.some(h=>(d=h.call({lexer:this},t,n))?(t=t.substring(d.raw.length),n.push(d),!0):!1))continue;if(d=this.tokenizer.escape(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.tag(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.link(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(d.raw.length);const h=n.at(-1);d.type==="text"&&(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(d=this.tokenizer.emStrong(t,s,a)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.codespan(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.br(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.del(t)){t=t.substring(d.raw.length),n.push(d);continue}if(d=this.tokenizer.autolink(t)){t=t.substring(d.raw.length),n.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(t))){t=t.substring(d.raw.length),n.push(d);continue}let f=t;if((u=this.options.extensions)!=null&&u.startInline){let h=1/0;const g=t.slice(1);let v;this.options.extensions.startInline.forEach(A=>{v=A.call({lexer:this},g),typeof v=="number"&&v>=0&&(h=Math.min(h,v))}),h<1/0&&h>=0&&(f=t.substring(0,h+1))}if(d=this.tokenizer.inlineText(f)){t=t.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(a=d.raw.slice(-1)),i=!0;const h=n.at(-1);(h==null?void 0:h.type)==="text"?(h.raw+=d.raw,h.text+=d.text):n.push(d);continue}if(t){const h="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(h);break}else throw new Error(h)}}return n}},Fr=class{constructor(e){ve(this,"options");ve(this,"parser");this.options=e||pn}space(e){return""}code({text:e,lang:t,escaped:n}){var i;const s=(i=(t||"").match(Ge.notSpaceStart))==null?void 0:i[0],r=e.replace(Ge.endingNewline,"")+`
41
+ `;return s?'<pre><code class="language-'+It(s)+'">'+(n?r:It(r,!0))+`</code></pre>
42
+ `:"<pre><code>"+(n?r:It(r,!0))+`</code></pre>
43
+ `}blockquote({tokens:e}){return`<blockquote>
44
+ ${this.parser.parse(e)}</blockquote>
45
+ `}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
46
+ `}hr(e){return`<hr>
47
+ `}list(e){const t=e.ordered,n=e.start;let s="";for(let a=0;a<e.items.length;a++){const l=e.items[a];s+=this.listitem(l)}const r=t?"ol":"ul",i=t&&n!==1?' start="'+n+'"':"";return"<"+r+i+`>
48
+ `+s+"</"+r+`>
49
+ `}listitem(e){var n;let t="";if(e.task){const s=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=s+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=s+" "+It(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:s+" ",text:s+" ",escaped:!0}):t+=s+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
50
+ `}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
51
+ `}table(e){let t="",n="";for(let r=0;r<e.header.length;r++)n+=this.tablecell(e.header[r]);t+=this.tablerow({text:n});let s="";for(let r=0;r<e.rows.length;r++){const i=e.rows[r];n="";for(let a=0;a<i.length;a++)n+=this.tablecell(i[a]);s+=this.tablerow({text:n})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
52
+ <thead>
53
+ `+t+`</thead>
54
+ `+s+`</table>
55
+ `}tablerow({text:e}){return`<tr>
56
+ ${e}</tr>
57
+ `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
58
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${It(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const s=this.parser.parseInline(n),r=oo(e);if(r===null)return s;e=r;let i='<a href="'+e+'"';return t&&(i+=' title="'+It(t)+'"'),i+=">"+s+"</a>",i}image({href:e,title:t,text:n,tokens:s}){s&&(n=this.parser.parseInline(s,this.parser.textRenderer));const r=oo(e);if(r===null)return It(n);e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${It(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:It(e.text)}},bi=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Wt=class Ds{constructor(t){ve(this,"options");ve(this,"renderer");ve(this,"textRenderer");this.options=t||pn,this.options.renderer=this.options.renderer||new Fr,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new bi}static parse(t,n){return new Ds(n).parse(t)}static parseInline(t,n){return new Ds(n).parseInline(t)}parse(t,n=!0){var r,i;let s="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const u=l,d=this.options.extensions.renderers[u.type].call({parser:this},u);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){s+=d||"";continue}}const c=l;switch(c.type){case"space":{s+=this.renderer.space(c);continue}case"hr":{s+=this.renderer.hr(c);continue}case"heading":{s+=this.renderer.heading(c);continue}case"code":{s+=this.renderer.code(c);continue}case"table":{s+=this.renderer.table(c);continue}case"blockquote":{s+=this.renderer.blockquote(c);continue}case"list":{s+=this.renderer.list(c);continue}case"html":{s+=this.renderer.html(c);continue}case"paragraph":{s+=this.renderer.paragraph(c);continue}case"text":{let u=c,d=this.renderer.text(u);for(;a+1<t.length&&t[a+1].type==="text";)u=t[++a],d+=`
59
+ `+this.renderer.text(u);n?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=d;continue}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}parseInline(t,n=this.renderer){var r,i;let s="";for(let a=0;a<t.length;a++){const l=t[a];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[l.type]){const u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){s+=u||"";continue}}const c=l;switch(c.type){case"escape":{s+=n.text(c);break}case"html":{s+=n.html(c);break}case"link":{s+=n.link(c);break}case"image":{s+=n.image(c);break}case"strong":{s+=n.strong(c);break}case"em":{s+=n.em(c);break}case"codespan":{s+=n.codespan(c);break}case"br":{s+=n.br(c);break}case"del":{s+=n.del(c);break}case"text":{s+=n.text(c);break}default:{const u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return s}},js,Mr=(js=class{constructor(e){ve(this,"options");ve(this,"block");this.options=e||pn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Ut.lex:Ut.lexInline}provideParser(){return this.block?Wt.parse:Wt.parseInline}},ve(js,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),js),ba=class{constructor(...e){ve(this,"defaults",ui());ve(this,"options",this.setOptions);ve(this,"parse",this.parseMarkdown(!0));ve(this,"parseInline",this.parseMarkdown(!1));ve(this,"Parser",Wt);ve(this,"Renderer",Fr);ve(this,"TextRenderer",bi);ve(this,"Lexer",Ut);ve(this,"Tokenizer",Br);ve(this,"Hooks",Mr);this.use(...e)}walkTokens(e,t){var s,r;let n=[];for(const i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{const a=i;for(const l of a.header)n=n.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=i;n=n.concat(this.walkTokens(a.items,t));break}default:{const a=i;(r=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&r[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);n=n.concat(this.walkTokens(c,t))}):a.tokens&&(n=n.concat(this.walkTokens(a.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const s={...n};if(s.async=this.defaults.async||s.async||!1,n.extensions&&(n.extensions.forEach(r=>{if(!r.name)throw new Error("extension name required");if("renderer"in r){const i=t.renderers[r.name];i?t.renderers[r.name]=function(...a){let l=r.renderer.apply(this,a);return l===!1&&(l=i.apply(this,a)),l}:t.renderers[r.name]=r.renderer}if("tokenizer"in r){if(!r.level||r.level!=="block"&&r.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[r.level];i?i.unshift(r.tokenizer):t[r.level]=[r.tokenizer],r.start&&(r.level==="block"?t.startBlock?t.startBlock.push(r.start):t.startBlock=[r.start]:r.level==="inline"&&(t.startInline?t.startInline.push(r.start):t.startInline=[r.start]))}"childTokens"in r&&r.childTokens&&(t.childTokens[r.name]=r.childTokens)}),s.extensions=t),n.renderer){const r=this.defaults.renderer||new Fr(this.defaults);for(const i in n.renderer){if(!(i in r))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const a=i,l=n.renderer[a],c=r[a];r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d||""}}s.renderer=r}if(n.tokenizer){const r=this.defaults.tokenizer||new Br(this.defaults);for(const i in n.tokenizer){if(!(i in r))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const a=i,l=n.tokenizer[a],c=r[a];r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.tokenizer=r}if(n.hooks){const r=this.defaults.hooks||new Mr;for(const i in n.hooks){if(!(i in r))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const a=i,l=n.hooks[a],c=r[a];Mr.passThroughHooks.has(i)?r[a]=u=>{if(this.defaults.async)return Promise.resolve(l.call(r,u)).then(f=>c.call(r,f));const d=l.call(r,u);return c.call(r,d)}:r[a]=(...u)=>{let d=l.apply(r,u);return d===!1&&(d=c.apply(r,u)),d}}s.hooks=r}if(n.walkTokens){const r=this.defaults.walkTokens,i=n.walkTokens;s.walkTokens=function(a){let l=[];return l.push(i.call(this,a)),r&&(l=l.concat(r.call(this,a))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Ut.lex(e,t??this.defaults)}parser(e,t){return Wt.parse(e,t??this.defaults)}parseMarkdown(e){return(n,s)=>{const r={...s},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));i.hooks&&(i.hooks.options=i,i.hooks.block=e);const l=i.hooks?i.hooks.provideLexer():e?Ut.lex:Ut.lexInline,c=i.hooks?i.hooks.provideParser():e?Wt.parse:Wt.parseInline;if(i.async)return Promise.resolve(i.hooks?i.hooks.preprocess(n):n).then(u=>l(u,i)).then(u=>i.hooks?i.hooks.processAllTokens(u):u).then(u=>i.walkTokens?Promise.all(this.walkTokens(u,i.walkTokens)).then(()=>u):u).then(u=>c(u,i)).then(u=>i.hooks?i.hooks.postprocess(u):u).catch(a);try{i.hooks&&(n=i.hooks.preprocess(n));let u=l(n,i);i.hooks&&(u=i.hooks.processAllTokens(u)),i.walkTokens&&this.walkTokens(u,i.walkTokens);let d=c(u,i);return i.hooks&&(d=i.hooks.postprocess(d)),d}catch(u){return a(u)}}}onError(e,t){return n=>{if(n.message+=`
60
+ Please report this to https://github.com/markedjs/marked.`,e){const s="<p>An error occurred:</p><pre>"+It(n.message+"",!0)+"</pre>";return t?Promise.resolve(s):s}if(t)return Promise.reject(n);throw n}}},dn=new ba;function we(e,t){return dn.parse(e,t)}we.options=we.setOptions=function(e){return dn.setOptions(e),we.defaults=dn.defaults,aa(we.defaults),we};we.getDefaults=ui;we.defaults=pn;we.use=function(...e){return dn.use(...e),we.defaults=dn.defaults,aa(we.defaults),we};we.walkTokens=function(e,t){return dn.walkTokens(e,t)};we.parseInline=dn.parseInline;we.Parser=Wt;we.parser=Wt.parse;we.Renderer=Fr;we.TextRenderer=bi;we.Lexer=Ut;we.lexer=Ut.lex;we.Tokenizer=Br;we.Hooks=Mr;we.parse=we;we.options;we.setOptions;we.use;we.walkTokens;we.parseInline;Wt.parse;Ut.lex;function $u(e){if(typeof e=="function"&&(e={highlight:e}),!e||typeof e.highlight!="function")throw new Error("Must provide highlight function");return typeof e.langPrefix!="string"&&(e.langPrefix="language-"),typeof e.emptyLangClass!="string"&&(e.emptyLangClass=""),{async:!!e.async,walkTokens(t){if(t.type!=="code")return;const n=co(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(uo(t));const s=e.highlight(t.text,n,t.lang||"");if(s instanceof Promise)throw new Error("markedHighlight is not set to async but the highlight function is async. Set the async option to true on markedHighlight to await the async highlight function.");uo(t)(s)},useNewRenderer:!0,renderer:{code(t,n,s){typeof t=="object"&&(s=t.escaped,n=t.lang,t=t.text);const r=co(n),i=r?e.langPrefix+po(r):e.emptyLangClass,a=i?` class="${i}"`:"";return t=t.replace(/\n$/,""),`<pre><code${a}>${s?t:po(t,!0)}
61
+ </code></pre>`}}}}function co(e){return(e||"").match(/\S*/)[0]}function uo(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const ya=/[&<>"']/,qu=new RegExp(ya.source,"g"),va=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Vu=new RegExp(va.source,"g"),Xu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},fo=e=>Xu[e];function po(e,t){if(t){if(ya.test(e))return e.replace(qu,fo)}else if(va.test(e))return e.replace(Vu,fo);return e}var ys,ho;function Zu(){if(ho)return ys;ho=1;function e(m){return m instanceof Map?m.clear=m.delete=m.set=function(){throw new Error("map is read-only")}:m instanceof Set&&(m.add=m.clear=m.delete=function(){throw new Error("set is read-only")}),Object.freeze(m),Object.getOwnPropertyNames(m).forEach(y=>{const T=m[y],q=typeof T;(q==="object"||q==="function")&&!Object.isFrozen(T)&&e(T)}),m}class t{constructor(y){y.data===void 0&&(y.data={}),this.data=y.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(m){return m.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function s(m,...y){const T=Object.create(null);for(const q in m)T[q]=m[q];return y.forEach(function(q){for(const Ee in q)T[Ee]=q[Ee]}),T}const r="</span>",i=m=>!!m.scope,a=(m,{prefix:y})=>{if(m.startsWith("language:"))return m.replace("language:","language-");if(m.includes(".")){const T=m.split(".");return[`${y}${T.shift()}`,...T.map((q,Ee)=>`${q}${"_".repeat(Ee+1)}`)].join(" ")}return`${y}${m}`};class l{constructor(y,T){this.buffer="",this.classPrefix=T.classPrefix,y.walk(this)}addText(y){this.buffer+=n(y)}openNode(y){if(!i(y))return;const T=a(y.scope,{prefix:this.classPrefix});this.span(T)}closeNode(y){i(y)&&(this.buffer+=r)}value(){return this.buffer}span(y){this.buffer+=`<span class="${y}">`}}const c=(m={})=>{const y={children:[]};return Object.assign(y,m),y};class u{constructor(){this.rootNode=c(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(y){this.top.children.push(y)}openNode(y){const T=c({scope:y});this.add(T),this.stack.push(T)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(y){return this.constructor._walk(y,this.rootNode)}static _walk(y,T){return typeof T=="string"?y.addText(T):T.children&&(y.openNode(T),T.children.forEach(q=>this._walk(y,q)),y.closeNode(T)),y}static _collapse(y){typeof y!="string"&&y.children&&(y.children.every(T=>typeof T=="string")?y.children=[y.children.join("")]:y.children.forEach(T=>{u._collapse(T)}))}}class d extends u{constructor(y){super(),this.options=y}addText(y){y!==""&&this.add(y)}startScope(y){this.openNode(y)}endScope(){this.closeNode()}__addSublanguage(y,T){const q=y.root;T&&(q.scope=`language:${T}`),this.add(q)}toHTML(){return new l(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function f(m){return m?typeof m=="string"?m:m.source:null}function h(m){return A("(?=",m,")")}function g(m){return A("(?:",m,")*")}function v(m){return A("(?:",m,")?")}function A(...m){return m.map(T=>f(T)).join("")}function I(m){const y=m[m.length-1];return typeof y=="object"&&y.constructor===Object?(m.splice(m.length-1,1),y):{}}function P(...m){return"("+(I(m).capture?"":"?:")+m.map(q=>f(q)).join("|")+")"}function S(m){return new RegExp(m.toString()+"|").exec("").length-1}function w(m,y){const T=m&&m.exec(y);return T&&T.index===0}const x=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function C(m,{joinWith:y}){let T=0;return m.map(q=>{T+=1;const Ee=T;let ce=f(q),H="";for(;ce.length>0;){const z=x.exec(ce);if(!z){H+=ce;break}H+=ce.substring(0,z.index),ce=ce.substring(z.index+z[0].length),z[0][0]==="\\"&&z[1]?H+="\\"+String(Number(z[1])+Ee):(H+=z[0],z[0]==="("&&T++)}return H}).map(q=>`(${q})`).join(y)}const N=/\b\B/,_="[a-zA-Z]\\w*",Y="[a-zA-Z_]\\w*",E="\\b\\d+(\\.\\d+)?",k="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",L="\\b(0b[01]+)",ae="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",se=(m={})=>{const y=/^#![ ]*\//;return m.binary&&(m.begin=A(y,/.*\b/,m.binary,/\b.*/)),s({scope:"meta",begin:y,end:/$/,relevance:0,"on:begin":(T,q)=>{T.index!==0&&q.ignoreMatch()}},m)},Ae={begin:"\\\\[\\s\\S]",relevance:0},fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Ae]},Ce={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Ae]},ie={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Te=function(m,y,T={}){const q=s({scope:"comment",begin:m,end:y,contains:[]},T);q.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ee=P("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return q.contains.push({begin:A(/[ ]+/,"(",Ee,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),q},be=Te("//","$"),$e=Te("/\\*","\\*/"),pe=Te("#","$"),$t={scope:"number",begin:E,relevance:0},te={scope:"number",begin:k,relevance:0},Rt={scope:"number",begin:L,relevance:0},V={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[Ae,{begin:/\[/,end:/\]/,relevance:0,contains:[Ae]}]},ft={scope:"title",begin:_,relevance:0},$={scope:"title",begin:Y,relevance:0},oe={begin:"\\.\\s*"+Y,relevance:0};var le=Object.freeze({__proto__:null,APOS_STRING_MODE:fe,BACKSLASH_ESCAPE:Ae,BINARY_NUMBER_MODE:Rt,BINARY_NUMBER_RE:L,COMMENT:Te,C_BLOCK_COMMENT_MODE:$e,C_LINE_COMMENT_MODE:be,C_NUMBER_MODE:te,C_NUMBER_RE:k,END_SAME_AS_BEGIN:function(m){return Object.assign(m,{"on:begin":(y,T)=>{T.data._beginMatch=y[1]},"on:end":(y,T)=>{T.data._beginMatch!==y[1]&&T.ignoreMatch()}})},HASH_COMMENT_MODE:pe,IDENT_RE:_,MATCH_NOTHING_RE:N,METHOD_GUARD:oe,NUMBER_MODE:$t,NUMBER_RE:E,PHRASAL_WORDS_MODE:ie,QUOTE_STRING_MODE:Ce,REGEXP_MODE:V,RE_STARTERS_RE:ae,SHEBANG:se,TITLE_MODE:ft,UNDERSCORE_IDENT_RE:Y,UNDERSCORE_TITLE_MODE:$});function ke(m,y){m.input[m.index-1]==="."&&y.ignoreMatch()}function je(m,y){m.className!==void 0&&(m.scope=m.className,delete m.className)}function Be(m,y){y&&m.beginKeywords&&(m.begin="\\b("+m.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",m.__beforeBegin=ke,m.keywords=m.keywords||m.beginKeywords,delete m.beginKeywords,m.relevance===void 0&&(m.relevance=0))}function pt(m,y){Array.isArray(m.illegal)&&(m.illegal=P(...m.illegal))}function et(m,y){if(m.match){if(m.begin||m.end)throw new Error("begin & end are not supported with match");m.begin=m.match,delete m.match}}function yt(m,y){m.relevance===void 0&&(m.relevance=1)}const Ue=(m,y)=>{if(!m.beforeMatch)return;if(m.starts)throw new Error("beforeMatch cannot be used with starts");const T=Object.assign({},m);Object.keys(m).forEach(q=>{delete m[q]}),m.keywords=T.keywords,m.begin=A(T.beforeMatch,h(T.begin)),m.starts={relevance:0,contains:[Object.assign(T,{endsParent:!0})]},m.relevance=0,delete T.beforeMatch},Le=["of","and","for","in","not","or","if","then","parent","list","value"],qt="keyword";function tn(m,y,T=qt){const q=Object.create(null);return typeof m=="string"?Ee(T,m.split(" ")):Array.isArray(m)?Ee(T,m):Object.keys(m).forEach(function(ce){Object.assign(q,tn(m[ce],y,ce))}),q;function Ee(ce,H){y&&(H=H.map(z=>z.toLowerCase())),H.forEach(function(z){const J=z.split("|");q[J[0]]=[ce,mn(J[0],J[1])]})}}function mn(m,y){return y?Number(y):gn(m)?0:1}function gn(m){return Le.includes(m.toLowerCase())}const xn={},Ze=m=>{console.error(m)},Vt=(m,...y)=>{console.log(`WARN: ${m}`,...y)},Pe=(m,y)=>{xn[`${m}/${y}`]||(console.log(`Deprecated as of ${m}. ${y}`),xn[`${m}/${y}`]=!0)},rt=new Error;function Lt(m,y,{key:T}){let q=0;const Ee=m[T],ce={},H={};for(let z=1;z<=y.length;z++)H[z+q]=Ee[z],ce[z+q]=!0,q+=S(y[z-1]);m[T]=H,m[T]._emit=ce,m[T]._multi=!0}function Cn(m){if(Array.isArray(m.begin)){if(m.skip||m.excludeBegin||m.returnBegin)throw Ze("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),rt;if(typeof m.beginScope!="object"||m.beginScope===null)throw Ze("beginScope must be object"),rt;Lt(m,m.begin,{key:"beginScope"}),m.begin=C(m.begin,{joinWith:""})}}function ar(m){if(Array.isArray(m.end)){if(m.skip||m.excludeEnd||m.returnEnd)throw Ze("skip, excludeEnd, returnEnd not compatible with endScope: {}"),rt;if(typeof m.endScope!="object"||m.endScope===null)throw Ze("endScope must be object"),rt;Lt(m,m.end,{key:"endScope"}),m.end=C(m.end,{joinWith:""})}}function Yr(m){m.scope&&typeof m.scope=="object"&&m.scope!==null&&(m.beginScope=m.scope,delete m.scope)}function Jr(m){Yr(m),typeof m.beginScope=="string"&&(m.beginScope={_wrap:m.beginScope}),typeof m.endScope=="string"&&(m.endScope={_wrap:m.endScope}),Cn(m),ar(m)}function Qr(m){function y(H,z){return new RegExp(f(H),"m"+(m.case_insensitive?"i":"")+(m.unicodeRegex?"u":"")+(z?"g":""))}class T{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(z,J){J.position=this.position++,this.matchIndexes[this.matchAt]=J,this.regexes.push([J,z]),this.matchAt+=S(z)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const z=this.regexes.map(J=>J[1]);this.matcherRe=y(C(z,{joinWith:"|"}),!0),this.lastIndex=0}exec(z){this.matcherRe.lastIndex=this.lastIndex;const J=this.matcherRe.exec(z);if(!J)return null;const Se=J.findIndex((Xt,In)=>In>0&&Xt!==void 0),Me=this.matchIndexes[Se];return J.splice(0,Se),Object.assign(J,Me)}}class q{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(z){if(this.multiRegexes[z])return this.multiRegexes[z];const J=new T;return this.rules.slice(z).forEach(([Se,Me])=>J.addRule(Se,Me)),J.compile(),this.multiRegexes[z]=J,J}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(z,J){this.rules.push([z,J]),J.type==="begin"&&this.count++}exec(z){const J=this.getMatcher(this.regexIndex);J.lastIndex=this.lastIndex;let Se=J.exec(z);if(this.resumingScanAtSamePosition()&&!(Se&&Se.index===this.lastIndex)){const Me=this.getMatcher(0);Me.lastIndex=this.lastIndex+1,Se=Me.exec(z)}return Se&&(this.regexIndex+=Se.position+1,this.regexIndex===this.count&&this.considerAll()),Se}}function Ee(H){const z=new q;return H.contains.forEach(J=>z.addRule(J.begin,{rule:J,type:"begin"})),H.terminatorEnd&&z.addRule(H.terminatorEnd,{type:"end"}),H.illegal&&z.addRule(H.illegal,{type:"illegal"}),z}function ce(H,z){const J=H;if(H.isCompiled)return J;[je,et,Jr,Ue].forEach(Me=>Me(H,z)),m.compilerExtensions.forEach(Me=>Me(H,z)),H.__beforeBegin=null,[Be,pt,yt].forEach(Me=>Me(H,z)),H.isCompiled=!0;let Se=null;return typeof H.keywords=="object"&&H.keywords.$pattern&&(H.keywords=Object.assign({},H.keywords),Se=H.keywords.$pattern,delete H.keywords.$pattern),Se=Se||/\w+/,H.keywords&&(H.keywords=tn(H.keywords,m.case_insensitive)),J.keywordPatternRe=y(Se,!0),z&&(H.begin||(H.begin=/\B|\b/),J.beginRe=y(J.begin),!H.end&&!H.endsWithParent&&(H.end=/\B|\b/),H.end&&(J.endRe=y(J.end)),J.terminatorEnd=f(J.end)||"",H.endsWithParent&&z.terminatorEnd&&(J.terminatorEnd+=(H.end?"|":"")+z.terminatorEnd)),H.illegal&&(J.illegalRe=y(H.illegal)),H.contains||(H.contains=[]),H.contains=[].concat(...H.contains.map(function(Me){return Gr(Me==="self"?H:Me)})),H.contains.forEach(function(Me){ce(Me,J)}),H.starts&&ce(H.starts,z),J.matcher=Ee(J),J}if(m.compilerExtensions||(m.compilerExtensions=[]),m.contains&&m.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return m.classNameAliases=s(m.classNameAliases||{}),ce(m)}function st(m){return m?m.endsWithParent||st(m.starts):!1}function Gr(m){return m.variants&&!m.cachedVariants&&(m.cachedVariants=m.variants.map(function(y){return s(m,{variants:null},y)})),m.cachedVariants?m.cachedVariants:st(m)?s(m,{starts:m.starts?s(m.starts):null}):Object.isFrozen(m)?s(m):m}var es="11.11.1";class lr extends Error{constructor(y,T){super(y),this.name="HTMLInjectionError",this.html=T}}const ht=n,On=s,cr=Symbol("nomatch"),M=7,R=function(m){const y=Object.create(null),T=Object.create(null),q=[];let Ee=!0;const ce="Could not find the language '{}', did you forget to load/include a language module?",H={disableAutodetect:!0,name:"Plain text",contains:[]};let z={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function J(O){return z.noHighlightRe.test(O)}function Se(O){let K=O.className+" ";K+=O.parentNode?O.parentNode.className:"";const Z=z.languageDetectRe.exec(K);if(Z){const ye=vt(Z[1]);return ye||(Vt(ce.replace("{}",Z[1])),Vt("Falling back to no-highlight mode for this block.",O)),ye?Z[1]:"no-highlight"}return K.split(/\s+/).find(ye=>J(ye)||vt(ye))}function Me(O,K,Z){let ye="",De="";typeof K=="object"?(ye=O,Z=K.ignoreIllegals,De=K.language):(Pe("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pe("10.7.0",`Please use highlight(code, options) instead.
62
+ https://github.com/highlightjs/highlight.js/issues/2277`),De=O,ye=K),Z===void 0&&(Z=!0);const it={code:ye,language:De};sn("before:highlight",it);const Tt=it.result?it.result:Xt(it.language,it.code,Z);return Tt.code=it.code,sn("after:highlight",Tt),Tt}function Xt(O,K,Z,ye){const De=Object.create(null);function it(F,W){return F.keywords[W]}function Tt(){if(!G.keywords){Ne.addText(he);return}let F=0;G.keywordPatternRe.lastIndex=0;let W=G.keywordPatternRe.exec(he),ne="";for(;W;){ne+=he.substring(F,W.index);const ue=ze.case_insensitive?W[0].toLowerCase():W[0],He=it(G,ue);if(He){const[xt,gr]=He;if(Ne.addText(ne),ne="",De[ue]=(De[ue]||0)+1,De[ue]<=M&&(gt+=gr),xt.startsWith("_"))ne+=W[0];else{const Fn=ze.classNameAliases[xt]||xt;ot(W[0],Fn)}}else ne+=W[0];F=G.keywordPatternRe.lastIndex,W=G.keywordPatternRe.exec(he)}ne+=he.substring(F),Ne.addText(ne)}function vn(){if(he==="")return;let F=null;if(typeof G.subLanguage=="string"){if(!y[G.subLanguage]){Ne.addText(he);return}F=Xt(G.subLanguage,he,!0,Bn[G.subLanguage]),Bn[G.subLanguage]=F._top}else F=Pt(he,G.subLanguage.length?G.subLanguage:null);G.relevance>0&&(gt+=F.relevance),Ne.__addSublanguage(F._emitter,F.language)}function Ye(){G.subLanguage!=null?vn():Tt(),he=""}function ot(F,W){F!==""&&(Ne.startScope(W),Ne.addText(F),Ne.endScope())}function fr(F,W){let ne=1;const ue=W.length-1;for(;ne<=ue;){if(!F._emit[ne]){ne++;continue}const He=ze.classNameAliases[F[ne]]||F[ne],xt=W[ne];He?ot(xt,He):(he=xt,Tt(),he=""),ne++}}function Pn(F,W){return F.scope&&typeof F.scope=="string"&&Ne.openNode(ze.classNameAliases[F.scope]||F.scope),F.beginScope&&(F.beginScope._wrap?(ot(he,ze.classNameAliases[F.beginScope._wrap]||F.beginScope._wrap),he=""):F.beginScope._multi&&(fr(F.beginScope,W),he="")),G=Object.create(F,{parent:{value:G}}),G}function _e(F,W,ne){let ue=w(F.endRe,ne);if(ue){if(F["on:end"]){const He=new t(F);F["on:end"](W,He),He.isMatchIgnored&&(ue=!1)}if(ue){for(;F.endsParent&&F.parent;)F=F.parent;return F}}if(F.endsWithParent)return _e(F.parent,W,ne)}function pr(F){return G.matcher.regexIndex===0?(he+=F[0],1):(ln=!0,0)}function Oe(F){const W=F[0],ne=F.rule,ue=new t(ne),He=[ne.__beforeBegin,ne["on:begin"]];for(const xt of He)if(xt&&(xt(F,ue),ue.isMatchIgnored))return pr(W);return ne.skip?he+=W:(ne.excludeBegin&&(he+=W),Ye(),!ne.returnBegin&&!ne.excludeBegin&&(he=W)),Pn(ne,F),ne.returnBegin?0:W.length}function hr(F){const W=F[0],ne=K.substring(F.index),ue=_e(G,F,ne);if(!ue)return cr;const He=G;G.endScope&&G.endScope._wrap?(Ye(),ot(W,G.endScope._wrap)):G.endScope&&G.endScope._multi?(Ye(),fr(G.endScope,F)):He.skip?he+=W:(He.returnEnd||He.excludeEnd||(he+=W),Ye(),He.excludeEnd&&(he=W));do G.scope&&Ne.closeNode(),!G.skip&&!G.subLanguage&&(gt+=G.relevance),G=G.parent;while(G!==ue.parent);return ue.starts&&Pn(ue.starts,F),He.returnEnd?0:W.length}function Ie(){const F=[];for(let W=G;W!==ze;W=W.parent)W.scope&&F.unshift(W.scope);F.forEach(W=>Ne.openNode(W))}let _t={};function Dn(F,W){const ne=W&&W[0];if(he+=F,ne==null)return Ye(),0;if(_t.type==="begin"&&W.type==="end"&&_t.index===W.index&&ne===""){if(he+=K.slice(W.index,W.index+1),!Ee){const ue=new Error(`0 width match regex (${O})`);throw ue.languageName=O,ue.badRule=_t.rule,ue}return 1}if(_t=W,W.type==="begin")return Oe(W);if(W.type==="illegal"&&!Z){const ue=new Error('Illegal lexeme "'+ne+'" for mode "'+(G.scope||"<unnamed>")+'"');throw ue.mode=G,ue}else if(W.type==="end"){const ue=hr(W);if(ue!==cr)return ue}if(W.type==="illegal"&&ne==="")return he+=`
63
+ `,1;if(an>1e5&&an>W.index*3)throw new Error("potential infinite loop, way more iterations than matches");return he+=ne,ne.length}const ze=vt(O);if(!ze)throw Ze(ce.replace("{}",O)),new Error('Unknown language: "'+O+'"');const mr=Qr(ze);let on="",G=ye||mr;const Bn={},Ne=new z.__emitter(z);Ie();let he="",gt=0,wt=0,an=0,ln=!1;try{if(ze.__emitTokens)ze.__emitTokens(K,Ne);else{for(G.matcher.considerAll();;){an++,ln?ln=!1:G.matcher.considerAll(),G.matcher.lastIndex=wt;const F=G.matcher.exec(K);if(!F)break;const W=K.substring(wt,F.index),ne=Dn(W,F);wt=F.index+ne}Dn(K.substring(wt))}return Ne.finalize(),on=Ne.toHTML(),{language:O,value:on,relevance:gt,illegal:!1,_emitter:Ne,_top:G}}catch(F){if(F.message&&F.message.includes("Illegal"))return{language:O,value:ht(K),illegal:!0,relevance:0,_illegalBy:{message:F.message,index:wt,context:K.slice(wt-100,wt+100),mode:F.mode,resultSoFar:on},_emitter:Ne};if(Ee)return{language:O,value:ht(K),illegal:!1,relevance:0,errorRaised:F,_emitter:Ne,_top:G};throw F}}function In(O){const K={value:ht(O),illegal:!1,relevance:0,_top:H,_emitter:new z.__emitter(z)};return K._emitter.addText(O),K}function Pt(O,K){K=K||z.languages||Object.keys(y);const Z=In(O),ye=K.filter(vt).filter(dr).map(Ye=>Xt(Ye,O,!1));ye.unshift(Z);const De=ye.sort((Ye,ot)=>{if(Ye.relevance!==ot.relevance)return ot.relevance-Ye.relevance;if(Ye.language&&ot.language){if(vt(Ye.language).supersetOf===ot.language)return 1;if(vt(ot.language).supersetOf===Ye.language)return-1}return 0}),[it,Tt]=De,vn=it;return vn.secondBest=Tt,vn}function nn(O,K,Z){const ye=K&&T[K]||Z;O.classList.add("hljs"),O.classList.add(`language-${ye}`)}function bn(O){let K=null;const Z=Se(O);if(J(Z))return;if(sn("before:highlightElement",{el:O,language:Z}),O.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",O);return}if(O.children.length>0&&(z.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(O)),z.throwUnescapedHTML))throw new lr("One of your code blocks includes unescaped HTML.",O.innerHTML);K=O;const ye=K.textContent,De=Z?Me(ye,{language:Z,ignoreIllegals:!0}):Pt(ye);O.innerHTML=De.value,O.dataset.highlighted="yes",nn(O,Z,De.language),O.result={language:De.language,re:De.relevance,relevance:De.relevance},De.secondBest&&(O.secondBest={language:De.secondBest.language,relevance:De.secondBest.relevance}),sn("after:highlightElement",{el:O,result:De,text:ye})}function Mn(O){z=On(z,O)}const Ke=()=>{mt(),Pe("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Nt(){mt(),Pe("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let qe=!1;function mt(){function O(){mt()}if(document.readyState==="loading"){qe||window.addEventListener("DOMContentLoaded",O,!1),qe=!0;return}document.querySelectorAll(z.cssSelector).forEach(bn)}function Rn(O,K){let Z=null;try{Z=K(m)}catch(ye){if(Ze("Language definition for '{}' could not be registered.".replace("{}",O)),Ee)Ze(ye);else throw ye;Z=H}Z.name||(Z.name=O),y[O]=Z,Z.rawDefinition=K.bind(null,m),Z.aliases&&Dt(Z.aliases,{languageName:O})}function ur(O){delete y[O];for(const K of Object.keys(T))T[K]===O&&delete T[K]}function rn(){return Object.keys(y)}function vt(O){return O=(O||"").toLowerCase(),y[O]||y[T[O]]}function Dt(O,{languageName:K}){typeof O=="string"&&(O=[O]),O.forEach(Z=>{T[Z.toLowerCase()]=K})}function dr(O){const K=vt(O);return K&&!K.disableAutodetect}function ts(O){O["before:highlightBlock"]&&!O["before:highlightElement"]&&(O["before:highlightElement"]=K=>{O["before:highlightBlock"](Object.assign({block:K.el},K))}),O["after:highlightBlock"]&&!O["after:highlightElement"]&&(O["after:highlightElement"]=K=>{O["after:highlightBlock"](Object.assign({block:K.el},K))})}function yn(O){ts(O),q.push(O)}function Ln(O){const K=q.indexOf(O);K!==-1&&q.splice(K,1)}function sn(O,K){const Z=O;q.forEach(function(ye){ye[Z]&&ye[Z](K)})}function ns(O){return Pe("10.7.0","highlightBlock will be removed entirely in v12.0"),Pe("10.7.0","Please use highlightElement now."),bn(O)}Object.assign(m,{highlight:Me,highlightAuto:Pt,highlightAll:mt,highlightElement:bn,highlightBlock:ns,configure:Mn,initHighlighting:Ke,initHighlightingOnLoad:Nt,registerLanguage:Rn,unregisterLanguage:ur,listLanguages:rn,getLanguage:vt,registerAliases:Dt,autoDetection:dr,inherit:On,addPlugin:yn,removePlugin:Ln}),m.debugMode=function(){Ee=!1},m.safeMode=function(){Ee=!0},m.versionString=es,m.regex={concat:A,lookahead:h,either:P,optional:v,anyNumberOfTimes:g};for(const O in le)typeof le[O]=="object"&&e(le[O]);return Object.assign(m,le),m},U=R({});return U.newInstance=()=>R({}),ys=U,U.HighlightJS=U,U.default=U,ys}var Ku=Zu();const Nn=ci(Ku);function Yu(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],r={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[t,n,e.QUOTE_STRING_MODE,r,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ju(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},r={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},i={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},a={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,r]},l=e.inherit(a,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),h={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},g={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},v={begin:/\{/,end:/\}/,contains:[g],illegal:"\\n",relevance:0},A={begin:"\\[",end:"\\]",contains:[g],illegal:"\\n",relevance:0},I=[s,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},h,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},v,A,i,a],P=[...I];return P.pop(),P.push(l),g.contains=P,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:I}}function Qu(e){const t=e.regex,n={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const r={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},i=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),a={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,r]};r.contains.push(l);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},d={match:/\\'/},f={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},h=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],g=e.SHEBANG({binary:`(${h.join("|")})`,relevance:10}),v={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],I=["true","false"],P={match:/(\/[a-z._-]+)+/},S=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],w=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],x=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],C=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:I,built_in:[...S,...w,"set","shopt",...x,...C]},contains:[g,e.SHEBANG(),v,f,i,a,P,l,c,u,d,n]}}Nn.registerLanguage("json",Yu);Nn.registerLanguage("yaml",Ju);Nn.registerLanguage("bash",Qu);const wa=new ba($u({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!Nn.getLanguage(t))return e;try{return Nn.highlight(e,{language:t}).value}catch{return e}}}));wa.use({extensions:[{name:"link",renderer(e){return`<a class="hover:underline hover:text-secondary-600" href="${e.href}" rel="noopener noreferrer" target="_blank">${e.text}</a>`}}]});function Gu(e){return wa.parse(e)}const hn=({children:e})=>e?typeof e!="string"?o.jsx(o.Fragment,{children:e}):o.jsx("div",{className:"prose max-w-none text-foreground-muted prose-headings:text-foreground prose-strong:text-foreground prose-a:text-primary-600 prose-code:text-foreground-secondary prose-blockquote:text-foreground-muted prose-blockquote:border-border",dangerouslySetInnerHTML:{__html:oa.sanitize(Gu(e))}}):null;function ed({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9m4.5-1.206a8.959 8.959 0 01-4.5 1.207"})})}function Ea({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"})})}function td({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3.055 11H5a2 2 0 012 2v1a2 2 0 002 2 2 2 0 012 2v2.945M8 3.935V5.5A2.5 2.5 0 0010.5 8h.5a2 2 0 012 2 2 2 0 104 0 2 2 0 012-2h1.064M15 20.488V18a2 2 0 012-2h3.064M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}function nd({className:e,...t}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M3 6l3 1m0 0l-3 9a5.002 5.002 0 006.001 0M6 7l3 9M6 7l6-2m6 2l3-1m-3 1l-3 9a5.002 5.002 0 006.001 0M18 7l3 9m-3-9l-6-2m0-2v2m0 16V5m0 16H9m3 0h3"})})}function rd({className:e}){return o.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z"})})}function $n({IconClass:e,term:t,visibleTerm:n=!0,text:s,href:r,vertical:i=!1,className:a=""}){const l=r?c=>o.jsx("a",{href:r,target:"_blank",...c}):c=>o.jsx("div",{...c});return o.jsxs("div",{className:`${!i&&"flex"} ${a}`,children:[o.jsx("dt",{children:o.jsxs(l,{className:"flex",children:[e&&o.jsx(e,{className:"w-5 h-5",title:`${s}`,alt:`${s}`}),n?o.jsx("span",{className:"pl-2 text-sm",children:t}):o.jsx("span",{className:"sr-only",children:t})]})}),o.jsxs("dd",{className:`${i&&"pt-2"} pl-2 text-sm`,children:[!n&&o.jsx(l,{children:s}),i&&o.jsx(l,{children:s})]})]})}function yi({name:e,href:t,title:n}){return o.jsx("a",{className:`text-xs whitespace-nowrap break-all mt-2 rounded-md bg-neutral-300 py-[2px] px-[4px] mr-1 -mt-1 ${t&&"hover:bg-cyan-500 hover:text-white"}`,href:t,target:"_blank",title:n,children:e})}function sd({license:e,externalDocs:t,contact:n,tags:s,logo:r}){const i=t,a={licenseName:e&&e.name?e.name:null,licenseUrl:e&&e.url?e.url:null,externalDocsTitle:i&&i.description?i.description:"External documentation",externalDocsUrl:i&&i.url?i.url:null,externalDocsDescription:i&&i.description?i.description:null,contactName:n&&n.name?n.name:null,contactUrl:n&&n.url?n.url:null,contactEmail:n&&n.email?n.email:null,tags:s};return o.jsxs(o.Fragment,{children:[r&&o.jsx("div",{className:"mb-3",children:r}),o.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[a.licenseName&&o.jsx($n,{IconClass:nd,text:`${a.licenseName} ${$i}`,term:$i,visibleTerm:!a.licenseName,href:a.licenseUrl,className:"mb-4 text-foreground-secondary hover:text-pink-500"}),a.externalDocsUrl&&o.jsx($n,{IconClass:Ea,text:qi,href:a.externalDocsUrl,term:qi,visibleTerm:!a.externalDocsTitle,className:"mb-4 text-foreground-secondary hover:text-secondary-500"}),a.contactEmail&&o.jsx($n,{IconClass:ed,text:`${a.contactEmail}`,term:Ml,visibleTerm:!a.contactEmail,href:`mailto:${a.contactEmail}`,className:"mb-4 text-foreground-secondary hover:text-green-500"}),a.contactUrl&&o.jsx($n,{IconClass:td,text:`${a.contactName}`,term:Il,visibleTerm:!a.contactName,href:a.contactUrl,className:"mb-4 text-foreground-secondary hover:text-green-500"})]}),o.jsx("dl",{children:a.tags&&o.jsx($n,{IconClass:rd,term:Rl,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:a.tags&&o.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:a.tags.map((l,c)=>{const u=l,d=u.externalDocs;return o.jsx(yi,{href:d&&d.url,title:u.description||(d&&d.description?d.description:void 0),name:u.name},c)})})})})]})}const id=[/^x-parser-/i,/^x-lib-/i];function od(e){return id.some(t=>t.test(e))}const mo=new Map;function ad(e){let t=mo.get(e);return t||(t=j.lazy(ia[e]),mo.set(e,t)),t}function ld({source:e,pathPrefix:t}){const{showExtensions:n}=dt();if(!n||!e)return null;const s=Object.keys(e).filter(r=>r.startsWith("x-")&&!od(r)&&Object.prototype.hasOwnProperty.call(ia,r));return s.length===0?null:o.jsx(o.Fragment,{children:s.map(r=>{const i=ad(r);return o.jsx(j.Suspense,{fallback:null,children:o.jsx(i,{value:e[r],path:`${t}.${r}`})},r)})})}const cd=j.lazy(su),Aa=e=>{const{title:t,description:n,license:s,externalDocs:r,contact:i,tags:a}=e,l=e["x-logo"],c=o.jsx("div",{className:"mt-4 w-full",children:o.jsx(hn,{children:n})}),u=l!==void 0&&o.jsx(j.Suspense,{fallback:null,children:o.jsx(cd,{value:l,path:"info.x-logo"})}),d=o.jsxs(o.Fragment,{children:[o.jsx(sd,{logo:u,license:s,externalDocs:r,contact:i,tags:a}),o.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:o.jsx(ld,{source:e,pathPrefix:"info"})})]});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Tn,{title:t,content:c,sideContent:d,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0})})};function Xr({className:e}){return o.jsx("svg",{className:e,id:"Layer_1",version:"1.1",viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",children:o.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}function ud({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M15.6 2l-1.2 3H5.6L4.4 2C3.629 2 3 2.629 3 3.4v15.2c0 .77.629 1.4 1.399 1.4h11.2c.77 0 1.4-.631 1.4-1.4V3.4C17 2.629 16.369 2 15.6 2zm-2 2l.9-2h-2.181L11.6 0H8.4l-.72 2H5.5l.899 2H13.6z"})})}function dd({className:e}){return o.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:o.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}const fd=1500;function pd(e){const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.focus(),t.select();try{return document.execCommand("copy")}catch{return!1}finally{document.body.removeChild(t)}}async function hd(e){try{return await navigator.clipboard.writeText(e),!0}catch{return pd(e)}}function ka({code:e,className:t}){const[n,s]=j.useState("idle"),r=j.useRef(void 0);j.useEffect(()=>()=>clearTimeout(r.current),[]);const i=()=>{hd(e).then(c=>{s(c?"copied":"error"),clearTimeout(r.current),r.current=setTimeout(()=>s("idle"),fd)})},a=Nn.highlight(e,{language:"json"}).value,l=n==="copied"?"Copied":n==="error"?"Copy failed":"Copy to clipboard";return o.jsxs("div",{className:`relative ${t??""}`,children:[o.jsx("button",{type:"button",onClick:i,"aria-label":l,title:l,className:"absolute top-2 right-2 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:n==="copied"?o.jsx(dd,{className:"w-4 h-4 text-green-600"}):o.jsx(ud,{className:`w-4 h-4 ${n==="error"?"text-red-500":""}`})}),o.jsx("pre",{className:"text-xs rounded overflow-x-auto",children:o.jsx("code",{className:"hljs language-json",dangerouslySetInnerHTML:{__html:oa.sanitize(a)}})})]})}const md=/^x-parser-/i;function Bs(e,t=new Set){if(e!==null&&typeof e=="object"){if(t.has(e))return"[circular]";t.add(e);try{if(Array.isArray(e))return e.map(s=>Bs(s,t));const n={};for(const[s,r]of Object.entries(e))md.test(s)||(n[s]=Bs(r,t));return n}finally{t.delete(e)}}return e}const ja=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Bs(e),null,2);return o.jsx(ka,{code:t})},ee=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ft=e=>ee(e)?e:null,go="^[\0-ÿ]*$",gd=Math.pow(-2,31),xd=Math.pow(2,31)-1,bd=Math.pow(-2,63),yd=Math.pow(2,63)-1,vd={null:"null",boolean:"boolean",int:"integer",long:"integer",float:"number",double:"number",bytes:"string",string:"string",fixed:"string",map:"object",array:"array",enum:"string",record:"object",uuid:"string"},vi=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function Yn(e){const t=vi(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function Fs(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const s=Yn(e);s!==void 0&&n[s]&&(t["x-parser-schema-id"]=s)}function xo(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function wd(e,t){let n=e,s=t;if(Array.isArray(e)&&e.length>0){const r=e.length>1&&e[0]==="null";n=e[+r],s.oneOf!==void 0&&(s=s.oneOf[0])}return{type:n,jsonSchema:s}}function Ed(e,t,n){if(!(t===void 0||n.examples||Array.isArray(e)))switch(e){case"boolean":n.examples=[typeof t=="boolean"?t:t==="true"];break;case"int":n.examples=[parseInt(t,10)];break;default:n.examples=[t]}}function zs(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function Hs(e,t,n){const{type:s,jsonSchema:r}=wd(e,n);Ed(s,t.example,r);function i(...a){a.forEach(l=>{let c=!0;l==="minLength"||l==="maxLength"?c=t[l]>-1:l==="multipleOf"&&(c=t[l]>0),t[l]!==void 0&&c&&(r[l]=t[l])})}switch(s){case"int":case"long":case"float":case"double":i("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(r.format=t.logicalType),i("pattern","minLength","maxLength");break;case"array":i("minItems","maxItems","uniqueItems");break}}function wi(e,t,n){t!==void 0&&(e[t]=n)}function Jn(e,t){let n={};if(Array.isArray(e))return kd(n,e,t);const s=vi(e),r=typeof e=="string"?e:s.type;switch(n.type=vd[r],r){case"int":{n.minimum=gd,n.maximum=xd;break}case"long":{n.minimum=bd,n.maximum=yd;break}case"bytes":{n.pattern=go;break}case"fixed":{n.pattern=go,n.minLength=s.size,n.maxLength=s.size;break}case"map":{n.additionalProperties=Jn(s.values,t);break}case"array":{n.items=Jn(s.items,t);break}case"enum":{n.enum=s.symbols;break}case"float":case"double":{n.format=r;break}case"record":{const i=Ad(s,t,n);wi(t,Yn(e),n),n.properties=Object.fromEntries(i.entries());break}default:{const i=t[Yn(e)]??(typeof r=="string"?t[r]:void 0);i&&(n=zs(s)?{...i}:i);break}}return Fs(s,n,t),Hs(r,s,n),n}function Ad(e,t,n){const s=new Map;for(const r of e.fields??[]){const i=typeof r.type=="string"?t[r.type]:void 0;if(i){const a=zs(r)?{...i}:i;xo(r,n,r.default!==void 0),zs(r)&&(Fs(r,a,t),Hs(r.type,r,a)),s.set(r.name,a)}else{const a=Jn(r.type,t);xo(r,n,r.default!==void 0),Fs(r,a,t),Hs(r.type,r,a),s.set(r.name,a),wi(t,Yn(r.type),a)}}return s}function kd(e,t,n){const s=[];let r=null;for(const i of t){const a=Jn(i,n);(typeof i=="string"?i:vi(i).type)==="null"?r=a:(s.push(a),wi(n,Yn(i),a))}return r&&s.push(r),e.oneOf=s,e}function Us(e){return Jn(e,{})}const bo=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),jd=new Set(["record","enum","array","map","fixed"]),yo=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function Ei(e){const t=[];return Sn(e,"schema",t,new Set),t}function Sn(e,t,n,s){if(typeof e=="string"){!bo.has(e)&&!yo.test(e)&&n.push(`${t}: "${e}" is not a valid Avro type name`);return}if(Array.isArray(e)){e.length===0&&n.push(`${t}: union must have at least one alternative`),e.forEach((i,a)=>Sn(i,`${t}[${a}]`,n,s));return}if(!ee(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(s.has(e))return;s.add(e);const r=e.type;if(typeof r!="string"){Array.isArray(r)||ee(r)?Sn(r,`${t}.type`,n,s):n.push(`${t}: missing "type"`);return}if(!bo.has(r)&&!jd.has(r)&&!yo.test(r)){n.push(`${t}: unknown Avro type "${r}"`);return}switch(r){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((i,a)=>{const l=`${t}.fields[${a}]`;if(!ee(i)||typeof i.name!="string"){n.push(`${l}: field must have a string "name"`);return}Sn(i.type,`${l}.type`,n,s)});break}case"enum":{const i=e.symbols;(!Array.isArray(i)||i.some(a=>typeof a!="string"))&&n.push(`${t}: enum must have a "symbols" array of strings`);break}case"array":{e.items===void 0?n.push(`${t}: array must have "items"`):Sn(e.items,`${t}.items`,n,s);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):Sn(e.values,`${t}.values`,n,s);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let zr=null,vs=null;const Ws=new Set;function Sd(){return vs||(vs=Promise.resolve().then(()=>require("./protoToJsonSchema-C43lKcgx.cjs")).then(e=>{zr=e.protoToJsonSchema,Ws.forEach(t=>t())})),vs}function Nd(){return zr||Sd(),zr}function Td(e){return Ws.add(e),()=>Ws.delete(e)}function vo(){return zr!==null}function Ai(){return j.useSyncExternalStore(Td,vo,vo)}const _d="x-parser-original-payload",Hr="x-lib-conversion-error",Cd=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,Od=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Gn(e){return typeof e=="string"&&Cd.test(e)}function er(e){return typeof e=="string"&&Od.test(e)}function Sa(e){return ee(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Na(e){var t,n;if(typeof e!="string")return null;if(Gn(e)){const s=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return s?`avro ${s}`:"avro"}if(er(e)){const s=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return s?`protobuf ${s}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function Ta(e){return Gn(e)?"Avro":er(e)?"Protobuf":null}function Id(e,t){return t?!1:!e||Gn(e)||er(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Md=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Rd=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Ld(e){return typeof e=="string"||Array.isArray(e)?!0:ee(e)?typeof e.type=="string"&&Rd.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Md.some(t=>t in e):!1}function Ur(e,t){let n=e;if(t&&ee(n)&&typeof n.$ref=="string"){const a=t(n.$ref);a!==void 0&&(n=a)}const s=Pd(n),r=s.schema.description;if(typeof r=="string")return{...s,description:r};const i=Sa(n)?n.description:void 0;return typeof i=="string"?{...s,description:i}:s}function Pd(e){var a;if(!Sa(e))return{schema:Ft(e)??e};const{schemaFormat:t}=e,n=e.schema,s=e[_d],r=(a=Ft(n))==null?void 0:a[Hr];if(typeof r=="string")return{schema:Ft(s)??{},schemaFormat:t,originalSchema:s,conversionError:r};if(s!==void 0)return{schema:Ft(n)??{},schemaFormat:t,originalSchema:s};if(Gn(t)&&Ld(n)){const l=Ei(n);if(l.length>0)return{schema:Ft(n)??{},schemaFormat:t,originalSchema:n,conversionError:l[0]};try{return{schema:Us(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:Ft(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(er(t)&&typeof n=="string"){const l=Nd();if(!l)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:l(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Protobuf schema"}}}const i=Ft(n);return i?{schema:i,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const wo=new Set,ki=e=>e.replace(/^#\//,"").split("/").pop()??e,$s=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},Dd={objects:new Set,refs:new Set},zt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:$s(e)};const s=e.$ref,r=ki(s);if(n.has(s))return{schema:e,refLabel:r,circular:!0};const i=Ft(t(s));if(!i)return{schema:e,refLabel:r};const{schema:a}=Ur(i);n.add(s);try{const l=zt(a,t,n);return{schema:l.schema,refLabel:l.circular?void 0:r,circular:l.circular}}finally{n.delete(s)}},fn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return ee(n)?n:null},_a=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},Bd=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ee(e.additionalItems)?e.additionalItems:null,Fd=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ee(e.contains)?e.contains:null,Ca=e=>e.contains!==void 0,Wr=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
64
+
65
+ ${t}`:t},zd=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Jt=(e,t,n,s)=>{if(e===t)return e;const r={...e};if(t.description&&(r.description=Wr(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[i,a]of Object.entries(t.properties)){if(!ee(a))continue;const l=r.properties[i];ee(l)?r.properties[i]=Jt(l,a):r.properties[i]=a}}if(t.items)if(Array.isArray(t.items))Array.isArray(r.items)?r.items=t.items.map((i,a)=>{const l=r.items[a];return ee(i)&&ee(l)?Jt(l,i):ee(i)?i:l}):r.items=t.items;else{const i=fn(t),a=fn(r);i&&a?r.items=Jt(a,i):i&&(r.items=t.items)}if(t.patternProperties&&ee(t.patternProperties)){const i={...ee(r.patternProperties)?r.patternProperties:{}};for(const[a,l]of Object.entries(t.patternProperties)){if(!ee(l)){i[a]=l;continue}const c=i[a];ee(c)?i[a]=Jt(c,l):i[a]=l}r.patternProperties=i}if(t.propertyNames!==void 0)if(ee(t.propertyNames)){const i=r.propertyNames;r.propertyNames=ee(i)?Jt(i,t.propertyNames):t.propertyNames}else r.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ee(t.additionalProperties)){const i=r.additionalProperties;r.additionalProperties=ee(i)?Jt(i,t.additionalProperties):t.additionalProperties}else r.additionalProperties=t.additionalProperties;for(const[i,a]of Object.entries(t))zd.has(i)||a===void 0||(r[i]=a);return r},Eo=(e,t,n,s)=>{const r={...e};delete r.allOf,r.properties&&(r.properties=Object.fromEntries(Object.entries(r.properties).map(([u,d])=>ee(d)?[u,Qe(d,t,n,s)]:[u,d])));const i=fn(r);i&&(r.items=Qe(i,t,n,s));const a=rr(r);a!==null&&ee(a)&&(r.propertyNames=Qe(a,t,n,s));const l=_n(r);l!==null&&ee(l)&&(r.additionalProperties=Qe(l,t,n,s));const c=ji(r);return c.length>0&&(r.patternProperties=Object.fromEntries(c.map(([u,d])=>[u,Qe(d,t,n,s)]))),r},Qe=(e,t,n,s=new Set)=>{if(s.has(e))return e;s.add(e);try{const r=e.allOf;if(Array.isArray(r)&&r.length>0){const i=[];let a={};for(const d of r){if(!ee(d))continue;const{schema:f,circular:h}=zt(d,t,n);if(h)continue;const g=Qe(f,t,n,s);if(g.if!==void 0){const v={if:g.if};g.then!==void 0&&(v.then=g.then),g.else!==void 0&&(v.else=g.else),i.push(v)}i.push(...Ma(g)),a=Jt(a,g,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),i.push(d)}const l={...e};delete l.allOf;const c=Object.keys(l).length>0?Jt(a,l,t,n):a,u=Eo(c,t,n,s);if(i.length===1){const d=i[0];u.if=d.if,d.then!==void 0&&(u.then=d.then),d.else!==void 0&&(u.else=d.else)}else i.length>1&&(u._allOfConditionals=i);return u}return Eo(e,t,n,s)}finally{s.delete(e)}},tr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},nr=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(s=>ee(s));return n.length>0?n:null},Oa=e=>e.not===void 0?null:typeof e.not=="boolean"||ee(e.not)?e.not:null,nt=e=>Oa(e)!==null,Ia=e=>{const{not:t,...n}=e;return n},Hd=e=>{const{if:t,then:n,else:s,...r}=e;return r},at=e=>e.if!==void 0,ws=e=>e===void 0?null:typeof e=="boolean"||ee(e)?e:null,Ma=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ee(t)):[],lt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,rr=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ee(e.propertyNames)?e.propertyNames:null,_n=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ee(e.additionalProperties)?e.additionalProperties:null,ji=e=>{const t=e.patternProperties;return ee(t)?Object.entries(t).flatMap(([n,s])=>ee(s)?[[n,s]]:[]):[]},Ud=(e,t)=>`${e}.[pattern:${t}]`,sr=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,Zr=e=>{const t=rr(e);if(t!==null&&ee(t))return!0;const n=_n(e);return n!==null&&ee(n)?!0:ji(e).length>0},Ra=e=>!!(tr(e)||nr(e)||sr(e)||Zr(e)||e.type==="array"||e.items||e.type!==void 0),jt=e=>!(nt(e)||at(e)||lt(e)||tr(e)||nr(e)||sr(e)||Zr(e)||e.items||Ca(e)||e.type==="array"||e.type==="object");function Wd(e){if(typeof _n(e)=="boolean")return!0;const n=rr(e);return!!(typeof n=="boolean"||n!==null&&ee(n)&&jt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function Ao(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||Wd(e)}const La=(e,t)=>Ao(e)?!0:t?Ao(t):!1,$d=(e,t)=>{if(nt(e)||at(e)||lt(e)||tr(e)||nr(e)||sr(e)||Zr(e))return!0;if(e.type==="array"||e.items){if(Ca(e)||_a(e)!==null)return!0;const n=fn(e);if(!n)return!1;if(n.$ref&&t){const{schema:s}=zt(n,t,wo),r=Qe(s,t,wo);return!jt(r)}return!jt(n)}return!1};function Pa(e){return JSON.stringify(e)}function ko(e){return typeof e=="string"?e:JSON.stringify(e)}function ut({children:e}){return o.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function Da({children:e,mono:t=!1,title:n}){return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",title:n,children:t?o.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function qd(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function Vd(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function Xd(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 jo(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function So(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function kr({name:e,lower:t,upper:n,suffix:s}){return!t&&!n?null:o.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{children:String(t.value)}),o.jsx(ut,{children:t.op})]}),o.jsx(ut,{children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx(ut,{children:n.op}),o.jsx(ut,{children:String(n.value)})]}),s&&o.jsx(ut,{children:s})]})}function Rr({value:e,displayValue:t}){const n=()=>{var i;(i=window.getSelection())!=null&&i.toString()||navigator.clipboard.writeText(ko(e))},s=r=>{r.key!=="Enter"&&r.key!==" "||(r.preventDefault(),navigator.clipboard.writeText(ko(e)))};return o.jsx("span",{role:"button",tabIndex:0,className:"inline-flex cursor-pointer select-text items-center rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs font-medium text-foreground hover:bg-neutral-200",title:"Click to copy",onClick:n,onKeyDown:s,children:t??Pa(e)})}function Kd({schema:e}){const t=_n(e);return typeof t!="boolean"?null:o.jsx(ut,{children:t?"additional properties allowed":"additional properties not allowed"})}function Yd({schema:e}){const t=rr(e);return typeof t=="boolean"?o.jsx(Da,{children:t?"any property name":"no property names"}):t!==null&&ee(t)&&jt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"property name pattern:"}),o.jsx(Rr,{value:t.pattern,displayValue:t.pattern})]}):null}function No({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,s=qd(e),r=Vd(e),i=Xd(e),a=Zd(e),l=jo(e,"minItems"),c=So(e,"maxItems"),u=jo(e,"minProperties"),d=So(e,"maxProperties");return o.jsxs(o.Fragment,{children:[typeof e.multipleOf=="number"&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"multiple of :"}),o.jsx(Da,{children:String(e.multipleOf)})]}),(s||r)&&o.jsx(kr,{name:t,lower:s,upper:r}),(i||a)&&o.jsx(kr,{name:t,lower:i,upper:a,suffix:"chars"}),(l||c)&&o.jsx(kr,{name:t,lower:l,upper:c,suffix:"items"}),(u||d)&&o.jsx(kr,{name:t,lower:u,upper:d,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"regex pattern:"}),o.jsx(Rr,{value:e.pattern,displayValue:e.pattern})]}),n&&o.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[o.jsx(ut,{children:"enum values:"}),n.map((f,h)=>o.jsx(Rr,{value:f},`${h}-${Pa(f)}`))]}),e.const!==void 0&&o.jsxs("span",{className:"inline-flex items-center gap-1",children:[o.jsx(ut,{children:"const value:"}),o.jsx(Rr,{value:e.const})]}),e.uniqueItems===!0&&o.jsx(ut,{children:"unique"}),o.jsx(Kd,{schema:e}),o.jsx(Yd,{schema:e})]})}function Ba({schema:e,itemSchema:t,fieldName:n,className:s="flex flex-col gap-1"}){const r=t!=null&&jt(t),i=n??"value";return o.jsxs("div",{className:s,children:[o.jsx(No,{schema:e,rangeName:i}),r&&o.jsx(No,{schema:t,rangeName:"item"})]})}const Fa=(e,t)=>{const n=tr(e);if(n)return{text:`one of (${n.length})`};const s=nr(e);if(s)return{text:`any of (${s.length})`};if(nt(e)&&!Ra(Ia(e)))return{text:"not"};if(e.type==="array"||e.items){const u=fn(e);if(u){const d=u.type;if(d==="object"){const f=u.$ref?ki(u.$ref):t;return f?{text:"Array of objects",refHint:f}:{text:"Array of objects"}}if(typeof d=="string"){const f=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${d}`,format:f}}}return{text:"array"}}const r=Array.isArray(e.type)?e.type.join(" | "):e.type;let i=r?`${r}`:"type: unknown";const a=_n(e);!sr(e)&&a!==null&&ee(a)&&(r==="object"||i==="type: unknown")&&(i=r==="object"?"object (map)":"map");const l=typeof e.format=="string"?e.format:void 0,c=t&&(r==="object"||i.startsWith("object"))?t:void 0;return{text:i,format:l,refHint:c}},Jd=(e,t)=>{if(!t)return!1;const n=Fa(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function za({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:s,format:r,refHint:i}=Fa(e,t);return o.jsxs("span",{className:n,children:[r??s,i&&!s.includes(`(${i})`)&&o.jsxs("span",{className:"text-foreground-muted",children:[" (",i,")"]})]})}const To="ml-6";function jr({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return o.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),o.jsx(za,{schema:e})]}),La(e)&&o.jsx(Ba,{schema:e,className:`flex flex-col gap-1 mt-1 ${To}`}),n&&n.split(`
66
+
67
+ `).map((s,r)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${To} leading-relaxed`,children:s},r))]})}function Es({children:e}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:"Should Not match:"}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function Qd({value:e}){const t=e?"any value":"false schema";return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:t})}function Ha({tabs:e,selected:t,onChange:n,ariaLabel:s}){const r=j.useRef([]),i=l=>(l+e.length)%e.length,a=(l,c)=>{var d;let u=c;l.key==="ArrowRight"&&(l.preventDefault(),u=i(c+1)),l.key==="ArrowLeft"&&(l.preventDefault(),u=i(c-1)),l.key==="Home"&&(l.preventDefault(),u=0),l.key==="End"&&(l.preventDefault(),u=e.length-1),u!==c&&(n(e[u].id),(d=r.current[u])==null||d.focus())};return o.jsx("div",{className:"inline-flex items-center gap-0.5 p-0.5 bg-neutral-100 rounded-md border border-border",role:"tablist","aria-label":s,children:e.map(({id:l,label:c},u)=>{const d=l===t;return o.jsx("button",{ref:f=>{r.current[u]=f},type:"button",role:"tab","aria-selected":d,tabIndex:0,onClick:()=>n(l),onKeyDown:f=>a(f,u),className:d?"px-3 py-1 text-xs font-semibold text-foreground bg-surface rounded-md shadow-sm border border-border":"px-3 py-1 text-xs font-medium text-foreground-muted hover:text-foreground-secondary rounded-md",children:c},l)})})}function Gd({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:s,onSelectCase:r,children:i}){if(t===0)return null;const a=(n==null?void 0:n.length)===t?n:Array.from({length:t},(u,d)=>`case ${d+1}`),l=e==="anyOf"?"Any of:":"One of:",c=e==="anyOf"?"Any of cases":"One of cases";return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:l}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),o.jsx(Ha,{tabs:a.map((u,d)=>({id:String(d),label:u})),selected:String(s),onChange:u=>r(Number(u)),ariaLabel:c}),o.jsx("div",{role:"tabpanel",className:"mt-2",children:i})]})}const ef="ml-0 border-dashed border-border";function un({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:s}=dt();return n==="none"?o.jsx("div",{children:t}):n==="muted"?o.jsx("div",{className:`pl-3 border-l-2 ${ef}`,children:t}):o.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Qs(e,s)},children:t})}function tf({depth:e,expanded:t,onToggle:n}){const{depthColors:s}=dt(),r=Qs(e,s);return o.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:[o.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:r,color:r},children:t?"−":"+"}),!t&&o.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const nf="ml-6";function tt({id:e,path:t,depth:n,schema:s,refLabel:r,itemSchema:i,typeLabelOverride:a,required:l,description:c,expandable:u,expanded:d,onToggle:f,showBorder:h=!0}){const{depthColors:g}=dt(),v=Qs(n,g),A=s&&Jd(s,r),I=u?nf:"";let P="",S=t;if(t.endsWith("[]")){const w=t.slice(0,-2),x=w.lastIndexOf(".");x>=0?(P=w.slice(0,x+1),S=`${w.slice(x+1)}[]`):S=t}else{const w=t.lastIndexOf("."),x=t.lastIndexOf("[]"),C=Math.max(w,x);C>=0&&(P=t.slice(0,C+(t[C]==="."?1:2)),S=t.slice(C+(t[C]==="."?1:2)))}return h=h&&!d,o.jsxs("div",{id:e,className:`py-2 ${h?"border-b border-gray-200 last:border-b-0":""}`,children:[o.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[o.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[o.jsxs("span",{className:"truncate min-w-0",children:[P&&o.jsx("span",{className:"text-foreground-muted",children:P}),o.jsx("span",{className:"font-semibold",style:{color:v},children:S})]}),l&&o.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(s==null?void 0:s.readOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(s==null?void 0:s.writeOnly)===!0&&o.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(s==null?void 0:s.deprecated)===!0&&o.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),s?o.jsxs("div",{className:"shrink-0 text-right",children:[o.jsx(za,{schema:s,refLabel:r}),A&&o.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",r,")"]})]}):a&&o.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:a})]}),s&&La(s,i)&&o.jsx(Ba,{schema:s,itemSchema:i,fieldName:S,className:`flex flex-col gap-1 mt-1 ${I}`}),c&&c.split(`
68
+
69
+ `).map((w,x)=>o.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${I} leading-relaxed`,children:w},x)),u&&o.jsx(tf,{depth:n,expanded:d,onToggle:f})]})}function As({label:e,children:t}){return o.jsxs("div",{children:[o.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:o.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),o.jsx("div",{children:t})]})}function rf({ifContent:e,thenContent:t,elseContent:n}){return o.jsxs("div",{className:"py-2 pt-5 px-1",children:[o.jsx("div",{className:"flex flex-col items-start",children:o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border-2 border-dashed border-border rounded-md bg-surface",children:"Conditions apply:"})}),o.jsx(un,{depth:0,lineVariant:"muted",children:o.jsxs("div",{className:"divide-y divide-border",children:[o.jsx(As,{label:"If schema matches:",children:e}),t!=null&&o.jsx(As,{label:"Then schema should follow:",children:t}),n!=null&&o.jsx(As,{label:"Else schema should follow:",children:n})]})})]})}function Sr({label:e,children:t}){return o.jsxs("div",{className:"py-2",children:[o.jsxs("div",{className:"flex flex-col items-start",children:[o.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:e}),o.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const sf=e=>e==="none"?"depth":e;function kt({schema:e,path:t,depth:n,required:s,refStack:r,deref:i,suppressRow:a=!1,branchLineVariant:l="depth",defaultExpanded:c=!1,ancestors:u=Dd,focusTokens:d=null,focusId:f=null}){var ft;const h=sf(l),g=d!=null,A=g&&d.length===0?f??void 0:void 0,[I,P]=j.useState(c||g),[S,w]=j.useState(c);S!==c&&(w(c),P(c||g)),j.useEffect(()=>{g&&P(!0)},[g]);const[x,C]=j.useState(0),N=(ft=d==null?void 0:d[0])==null?void 0:ft.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),_=N?Number(N[1]):-1;j.useEffect(()=>{_>=0&&C(_)},[_]);const Y=Ai(),{schema:E,refLabel:k,circular:L}=j.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:$s(e),circular:!0};const $=zt(e,i,r);return $.circular?$:{...$,schema:Qe($.schema,i,r)}},[e,i,r,u,Y]),ae=j.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),se=Ia(Hd(E)),Ae=!Ra(se)&&(nt(E)||at(E)||lt(E)),fe=()=>{const $=Oa(E);if($===null)return null;if(typeof $=="boolean")return o.jsx(Es,{children:o.jsx(Qd,{value:$})});const oe=zt($,i,r);if(oe.circular)return o.jsx(Es,{children:o.jsx(tt,{path:t,depth:n+1,typeLabelOverride:`↩ ${$.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ge=Qe(oe.schema,i,r),le=jt(ge);return o.jsx(Es,{children:le?o.jsx(jr,{schema:ge,showBorder:!1}):o.jsx(kt,{schema:$,path:t,depth:n+1,refStack:r,deref:i,ancestors:ae,suppressRow:!0,branchLineVariant:h,defaultExpanded:c})})},Ce=($,oe)=>{if(typeof $=="boolean")return o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:$?"any value":"false schema"});const ge=zt($,i,r);if(ge.circular)return o.jsx(tt,{path:oe,depth:n+1,typeLabelOverride:`↩ ${$.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const le=Qe(ge.schema,i,r);return jt(le)?o.jsx(jr,{schema:le,showBorder:!1}):o.jsx(kt,{schema:$,path:oe,depth:n+1,refStack:r,deref:i,ancestors:ae,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},ie=$=>{const oe=ws($.if);if(oe===null)return null;const ge=ws($.then),le=ws($.else);return o.jsx(rf,{ifContent:Ce(oe,t),thenContent:ge!==null?Ce(ge,t):void 0,elseContent:le!==null?Ce(le,t):void 0})},Te=()=>{const $=Ma(E);return $.length===0?null:o.jsx(o.Fragment,{children:$.map((oe,ge)=>o.jsx("div",{children:ie(oe)},ge))})};if(L)return o.jsx(tt,{id:A,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??k??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(Ae){const $=o.jsxs(o.Fragment,{children:[nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]});return a?$:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:t,depth:n,schema:E,refLabel:k,required:s,description:E.description,expandable:!0,expanded:I,onToggle:()=>P(oe=>!oe)}),I&&o.jsx(un,{depth:n,lineVariant:l,children:$})]})}const be=tr(se),$e=nr(se),pe=be??$e,$t=be?"oneOf":"anyOf";if(pe){const $=pe.map((Ue,Le)=>typeof Ue.title=="string"?Ue.title:`case ${Le+1}`),oe=a?1:n+1,ge=pe[x],le=zt(ge,i,r),ke=le.circular?le.schema:Qe(le.schema,i,r),je=!le.circular&&jt(ke),Be=d&&_===x?d.slice(1):null,pt=je?o.jsx(jr,{schema:ke,showBorder:!1}):o.jsx(kt,{schema:ge,path:t,depth:oe-1,refStack:r,deref:i,ancestors:ae,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:Be,focusId:f},x),et=o.jsx(Gd,{variant:$t,caseCount:pe.length,caseLabels:$,selectedCase:x,onSelectCase:C,children:pt}),yt=o.jsxs(o.Fragment,{children:[et,nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]});return a?yt:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:t,depth:n,schema:E,refLabel:k,required:s,description:E.description,expandable:!0,expanded:I,onToggle:()=>P(Ue=>!Ue)}),I&&o.jsx(un,{depth:n,lineVariant:l,children:yt})]})}const te=($,oe,ge)=>{const le=zt($,i,r);if(le.circular)return o.jsx(tt,{path:oe,depth:ge,typeLabelOverride:`↩ ${$.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ke=Qe(le.schema,i,r);return jt(ke)?o.jsx(jr,{schema:ke,showBorder:!1}):o.jsx(kt,{schema:$,path:oe,depth:ge,refStack:r,deref:i,ancestors:ae,branchLineVariant:h,defaultExpanded:c})},Rt=$=>{const oe=se.properties??{},ge=new Set(se.required??[]),le=rr(se),ke=_n(se),je=ji(se);return o.jsxs(o.Fragment,{children:[Object.entries(oe).map(([Be,pt])=>{if(!ee(pt))return null;const et=d&&d[0]==="properties"&&d[1]===Be?d.slice(2):null;return o.jsx(kt,{schema:pt,path:`${t}.${Be}`,depth:$,required:ge.has(Be),refStack:r,deref:i,ancestors:ae,branchLineVariant:h,defaultExpanded:c,focusTokens:et,focusId:f},Be)}),le!==null&&ee(le)&&o.jsx(Sr,{label:"Property names must adhere to:",children:te(le,`${t}.[propertyName]`,$)}),je.map(([Be,pt])=>o.jsx(kt,{schema:pt,path:Ud(t,Be),depth:$,refStack:r,deref:i,ancestors:ae,branchLineVariant:h,defaultExpanded:c},Be)),ke!==null&&ee(ke)&&o.jsx(Sr,{label:"Additional properties must adhere to:",children:te(ke,`${t}.[additionalProperty]`,$)}),nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]})};if(sr(se)||Zr(se))return a?Rt(n+1):o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:t,depth:n,schema:E,refLabel:k,required:s,description:E.description,expandable:!0,expanded:I,onToggle:()=>P($=>!$)}),I&&o.jsx(un,{depth:n,lineVariant:l,children:Rt(n+1)})]});if(se.type==="array"||se.items){const $=_a(se),oe=$!==null,ge=oe?Bd(se):null,le=Fd(se),ke=le!==null,je=oe?null:fn(se),Be=je!==null,pt=oe||Be||ke||nt(E)||at(E)||lt(E),et=`${t}[]`,yt=Be?zt(je,i,r):null,Ue=(yt==null?void 0:yt.schema)??null,Le=Ue?Qe(Ue,i,r):null,qt=Ue!==null&&(ae.objects.has(Ue)||typeof(je==null?void 0:je.$ref)=="string"&&ae.refs.has(je.$ref)),tn=Ue!==null?{objects:new Set(ae.objects).add(Ue),refs:typeof(je==null?void 0:je.$ref)=="string"?new Set(ae.refs).add(je.$ref):ae.refs}:ae,mn=!oe&&!ke&&Le!==null&&jt(Le),gn=Le!=null&&Le.properties?Object.entries(Le.properties).filter(([,Pe])=>ee(Pe)):[],xn=new Set(Le&&Array.isArray(Le.required)?Le.required:[]),Ze=!oe&&d&&d[0]==="items"?d.slice(1):null,Vt=Pe=>o.jsxs(o.Fragment,{children:[oe?o.jsxs(o.Fragment,{children:[$.map((rt,Lt)=>o.jsx(kt,{schema:rt,path:`${t}[${Lt}]`,depth:Pe,refStack:r,deref:i,ancestors:ae,branchLineVariant:h,defaultExpanded:c},Lt)),ge!==null&&typeof ge!="boolean"&&o.jsx(Sr,{label:"Additional items:",children:te(ge,`${t}[*]`,Pe)}),ge===!1&&o.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):Be&&(qt?o.jsx(tt,{path:et,depth:Pe,typeLabelOverride:`↩ ${je.$ref??$s(Ue)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):gn.length>0?gn.map(([rt,Lt])=>{const Cn=Ze&&Ze[0]==="properties"&&Ze[1]===rt?Ze.slice(2):null;return o.jsx(kt,{schema:Lt,path:`${t}[].${rt}`,depth:Pe,required:xn.has(rt),refStack:r,deref:i,ancestors:tn,branchLineVariant:h,defaultExpanded:c,focusTokens:Cn,focusId:f},rt)}):o.jsx(kt,{schema:je,path:et,depth:Pe,refStack:r,deref:i,ancestors:tn,branchLineVariant:h,defaultExpanded:c,focusTokens:Ze,focusId:f})),ke&&o.jsx(Sr,{label:"Contains at least one:",children:typeof le=="boolean"?o.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:le?"any item":"impossible constraint"}):te(le,`${t}[contains]`,Pe)}),nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]});return mn&&!nt(E)&&!at(E)&&!lt(E)?o.jsx(tt,{id:A,path:et,depth:n,schema:E,itemSchema:Le,refLabel:k,required:s,description:Wr(E.description,Le.description),expandable:!1,expanded:!1,onToggle:()=>{}}):mn?o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:et,depth:n,schema:E,itemSchema:Le,refLabel:k,required:s,description:Wr(E.description,Le.description),expandable:!0,expanded:I,onToggle:()=>P(Pe=>!Pe)}),I&&o.jsxs(un,{depth:n,lineVariant:l,children:[nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]})]}):a?pt?Vt(n+1):null:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:et,depth:n,schema:E,itemSchema:Le,refLabel:k,required:s,description:E.description,expandable:oe||Be||ke||nt(E)||at(E)||lt(E),expanded:I,onToggle:()=>P(Pe=>!Pe)}),I&&o.jsx(un,{depth:n,lineVariant:l,children:Vt(n+1)})]})}if(nt(E)||at(E)||lt(E)){const $=o.jsxs(o.Fragment,{children:[nt(E)&&fe(),at(E)&&ie(E),lt(E)&&Te()]});return a?$:o.jsxs(o.Fragment,{children:[o.jsx(tt,{id:A,path:t,depth:n,schema:E,refLabel:k,required:s,description:E.description,expandable:!0,expanded:I,onToggle:()=>P(oe=>!oe)}),I&&o.jsx(un,{depth:n,lineVariant:l,children:$})]})}return a?null:o.jsx(tt,{id:A,path:t,depth:n,schema:E,refLabel:k,required:s,description:E.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Si({schema:e,rootName:t,className:n="",focusTokens:s=null,focusId:r=null}){const{deref:i,defaultSchemaExpanded:a=!1}=dt(),l=j.useMemo(()=>new Set,[]),c=Ft(e),u=j.useMemo(()=>c?Qe(c,i,l):null,[c,i,l]);if(!c||!u)return o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const d=t??(c.$ref?ki(c.$ref):void 0)??"schema",f=!!t;if(!$d(u,i)&&!c.$ref){if(f)return u.type==="array"||u.items?o.jsx("div",{className:n,children:o.jsx(kt,{schema:c,path:d,depth:0,refStack:l,deref:i,defaultExpanded:a,focusTokens:s,focusId:r})}):null;const g=u.type==="array"||u.items?`${d}[]`:d,v=fn(u),A=v?Qe(v,i,l):null,I=A!==null&&jt(A);return o.jsx("div",{className:n,children:o.jsx(tt,{path:g,depth:0,schema:u,itemSchema:I?A:void 0,description:u.type==="array"||u.items?Wr(u.description,v==null?void 0:v.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return o.jsx("div",{className:n,children:o.jsx(kt,{schema:c,path:d,depth:f?-1:0,refStack:l,deref:i,suppressRow:f,defaultExpanded:a,focusTokens:s,focusId:r})})}function of(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 Ua(e){let t=of(e),n={next(){return t()},int(s,r){return s+Math.floor(n.next()*(r-s+1))},bool(s=.5){return n.next()<s},pick(s){return s[n.int(0,s.length-1)]},shuffle(s){let r=[...s];for(let i=r.length-1;i>0;i--){let a=n.int(0,i);[r[i],r[a]]=[r[a],r[i]]}return r},fork(){let s=Math.floor(n.next()*4294967296);return Ua(s)}};return n}function af(e){return null}function lf(e){return e.random.bool()}function Wa(e,t,n=!1){let s=-1e3,r=1e3,i=!1,a=!1;if(e.minimum!==void 0&&(s=e.minimum),e.maximum!==void 0&&(r=e.maximum),e.exclusiveMinimum!==void 0&&(s=e.exclusiveMinimum,i=!0),e.exclusiveMaximum!==void 0&&(r=e.exclusiveMaximum,a=!0),e.multipleOf!==void 0)return cf(e.multipleOf,s,r,i,a,t);if(n){let u=i?Math.floor(s)+1:Math.ceil(s),d=a?Math.ceil(r)-1:Math.floor(r);return t.random.int(u,d)}let l=i?s+Number.EPSILON:s,c=a?r-Number.EPSILON:r;return l+t.random.next()*(c-l)}function cf(e,t,n,s,r,i){let a=Math.ceil(t/e),l=Math.floor(n/e);return s&&a*e===t&&a++,r&&l*e===n&&l--,a>l?a*e:i.random.int(a,l)*e}function uf(e,t){if(e.autoIncrement){let n=e.initialOffset??1,s=df(t.path),r=t.autoIncrementCounters??new Map,i=(r.get(s)??n-1)+1;return r.set(s,i),t.autoIncrementCounters&&t.autoIncrementCounters.set(s,i),i}return Wa(e,t,!0)}function df(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function _o(e,t){let n=$a(e,0);return Vn(n.node,t)}function Vn(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return ff(e,t);case"sequence":return e.nodes.map(n=>Vn(n,t)).join("");case"alternation":return Vn(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},()=>Vn(e.node,t)).join("")}case"group":return Vn(e.node,t)}}function ff(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),s=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(r=>!n.has(r));return s.length>0?t.pick(s):"a"}function $a(e,t){let n=[],s=[];for(;t<e.length;){let r=e[t];if(r===")")break;if(r==="|"){n.push(Co(s)),s=[],t++;continue}if(r==="("){let l=t+1;if(e[l]==="?")if(e[l+1]===":")l+=2;else if(e[l+1]==="="||e[l+1]==="!"){let f=1,h=l;for(;h<e.length&&f>0;)h++,e[h]==="("&&f++,e[h]===")"&&f--;t=h+1;continue}else{for(l+=2;l<e.length&&e[l]!==">";)l++;l++}let c=$a(e,l),u={type:"group",node:c.node};t=c.pos+1;let d=qn(e,t,u);s.push(d.node),t=d.pos;continue}if(r==="["){let l=hf(e,t),c=qn(e,l.pos,l.node);s.push(c.node),t=c.pos;continue}if(r==="."){let l={type:"dot"};t++;let c=qn(e,t,l);s.push(c.node),t=c.pos;continue}if(r==="^"||r==="$"){s.push({type:"anchor"}),t++;continue}if(r==="\\"){t++;let l=pf(e,t);t=l.pos;let c=qn(e,t,l.node);s.push(c.node),t=c.pos;continue}let i={type:"literal",value:r};t++;let a=qn(e,t,i);s.push(a.node),t=a.pos}return n.push(Co(s)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function Co(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function pf(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:[...`
70
+ `],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
71
+ `],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function hf(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let s=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let r=e[t];switch(r){case"d":s.push(..."0123456789");break;case"w":s.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":s.push(...`
72
+ `);break;default:s.push(r)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let r=e.charCodeAt(t),i=e.charCodeAt(t+2);for(let a=r;a<=i;a++)s.push(String.fromCharCode(a));t+=3;continue}s.push(e[t]),t++}return t++,{node:{type:"charClass",chars:s,negated:n},pos:t}}function qn(e,t,n){if(t>=e.length)return{node:n,pos:t};let s=e[t],r,i;switch(s){case"*":r=0,i=5,t++;break;case"+":r=1,i=5,t++;break;case"?":r=0,i=1,t++;break;case"{":{let a=mf(e,t);if(a)r=a.min,i=a.max,t=a.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:i},pos:t}}function mf(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let s=parseInt(n[1],10),r;return n[2]===void 0?r=s:n[2]===""?r=s+5:r=parseInt(n[2],10),{min:s,max:r,pos:t+n[0].length}}function St(e){return e<10?`0${e}`:`${e}`}function gf(e,t){return new Date(e,t,0).getDate()}var qa="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function xf(e){return!(e==="^"||e==="$"||e==="^$")}function bf(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return yf(t);let a=t.formatRegistry.get(e.format);if(a){let l=a(t.random),c=t.minLength??e.minLength,u=t.maxLength??e.maxLength;return c!==void 0&&l.length<c?ks(l,c,t):u!==void 0&&l.length>u?l.slice(0,u):l}}if(e.pattern){let a=t.minLength??e.minLength,l=t.maxLength??e.maxLength;for(let d=0;d<50;d++){let f=_o(e.pattern,t.random);if(!(a!==void 0&&f.length<a)&&!(l!==void 0&&f.length>l))return f}let c=_o(e.pattern,t.random),u=xf(e.pattern);return a!==void 0&&c.length<a&&u?ks(c,a,t):l!==void 0&&c.length>l?c.slice(0,l):c}let n=e.minLength??0,s=e.maxLength??Math.max(n+10,10),r=t.random.int(n,s),i="";for(let a=0;a<r;a++)i+=t.random.pick([...qa]);return t.maxLength!==void 0&&i.length>t.maxLength&&(i=i.slice(0,t.maxLength)),t.minLength!==void 0&&i.length<t.minLength&&(i=ks(i,t.minLength,t)),i}function ks(e,t,n){for(;e.length<t;)e+=n.random.pick([...qa]);return e}function yf(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,s=t.getTime(),r=n.getTime(),i=s+e.random.next()*(r-s),a=new Date(i),l=a.getFullYear(),c=St(a.getMonth()+1),u=St(a.getDate());return`${l}-${c}-${u}T01:01:01.0Z`}function Oo(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,i=e.exclusiveMaximum??e.maximum??1/0,a=e.exclusiveMinimum!==void 0,l=e.exclusiveMaximum!==void 0;n=n.filter(c=>{if(typeof c!="number")return!0;let u=a?c>r:c>=r,d=l?c<i:c<=i;if(!u||!d)return!1;if(e.multipleOf!==void 0){let f=e.multipleOf,h=f.toString().includes(".")?f.toString().split(".")[1].length:0,g=Math.pow(10,h),v=Math.round(c*g),A=Math.round(f*g);if(v%A!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let r=e.minLength??0,i=e.maxLength??1/0;n=n.filter(a=>typeof a!="string"?!0:a.length>=r&&a.length<=i)}if(e.minItems!==void 0||e.maxItems!==void 0){let r=e.minItems??0,i=e.maxItems??1/0;n=n.filter(a=>Array.isArray(a)?a.length>=r&&a.length<=i:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let r=e.minProperties??0,i=e.maxProperties??1/0;n=n.filter(a=>typeof a!="object"||a===null||Array.isArray(a)?!0:Object.keys(a).length>=r&&Object.keys(a).length<=i)}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 s=t.random.pick(n);return typeof s=="object"&&s!==null?structuredClone(s):s}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Mt(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}Xa(t,n)}return t}function Va(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 Xa(n,t),n}function Xa(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=vf(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=[],s=Math.max(e.prefixItems.length,t.prefixItems.length);for(let r=0;r<s;r++){let i=e.prefixItems[r],a=t.prefixItems[r];i!==void 0&&a!==void 0?n.push(Va(i,a)):i!==void 0?n.push(i):a!==void 0&&n.push(a)}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=wf(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(s=>JSON.stringify(s)));e.enum=e.enum.filter(s=>n.has(JSON.stringify(s)))}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 vf(e,t){let n=Array.isArray(e)?e:[e],s=Array.isArray(t)?t:[t],r=n.filter(i=>s.includes(i));return r.length===0?n[0]:r.length===1?r[0]:r}function wf(e,t){let n={...e};for(let[s,r]of Object.entries(t)){let i=e[s];i===void 0?n[s]=r:typeof i=="object"&&typeof r=="object"?n[s]=Va(i,r):n[s]=r}return n}var Kr=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 Za(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>Kr.has(t))}function Io(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(s=>s===e):!1}function Ef(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 Af(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[s,r]of Object.entries(e))Kr.has(s)||(Za(r)?(t[s]=r,n=!0):(t[s]={const:r},n=!0));if(n)return t}return{}}function kf(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function jf(e,t){var S;let n=Af(e),s=kf(e,n);if(t.depth>=t.maxDepth){if(s.length===0)return{};let w={};for(let x of s){let C=n[x];if(C&&typeof C=="object"&&C!==null){let N=C;N.const!==void 0?w[x]=N.const:N.default!==void 0?w[x]=N.default:N.enum!==void 0&&N.enum.length>0?w[x]=N.enum[0]:w[x]=_f(N.type)}else w[x]=null}return w}if(e.additionalProperties===!1){let w=Object.keys(n).length>0,x=e.patternProperties&&Object.keys(e.patternProperties).length>0,C=new Set(Object.keys(n)),N=[...new Set(s)].filter(_=>!C.has(_));if((e.minProperties??0)>0&&!w&&!x)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(N.length>0&&!x&&!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`,i={...t,depth:t.depth+1,path:r},a={},l=new Set,c=new Set(s),u=t.alwaysFakeOptionals??!1,d=t.fillProperties??!0,f=t.fixedProbabilities??!1,h=t.optionalsProbability??.5,g=Object.keys(n).filter(w=>!c.has(w)),v;if(f&&!u&&g.length>0){let w=Math.round(g.length*h);v=new Set(g.slice(0,w))}let A=w=>u?!0:v?v.has(w):t.random.bool(h);if(Object.keys(n).length>0)for(let[w,x]of Object.entries(n)){if(Ef(x))continue;l.add(w);let C=Kt(i,w),N=c.has(w),_=typeof x=="object"&&x!==null&&x.type==="object",Y=x;if(e.patternProperties&&typeof x=="object"&&x!==null){let E=[];for(let[k,L]of Object.entries(e.patternProperties))try{new RegExp(k).test(w)&&E.push(L)}catch{}E.length>0&&(Y=Mt([x,...E]))}if(N){let E=await me(Y,C);E!==void 0&&(a[w]=E)}else if(A(w)){let E=await me(Y,C);E!==void 0&&(a[w]=E)}else if(_&&!d){let E=x.required??[];if(E.length>0){let k={};for(let L of E){let ae=(x.properties??{})[L]??{},se=Kt(C,L),Ae=await me(ae,se);Ae!==void 0&&(k[L]=Ae)}a[w]=k}}}for(let w of c)if(!(a[w]!==void 0||l.has(w))){if(e.patternProperties){let x=[];for(let[C,N]of Object.entries(e.patternProperties))new RegExp(C).test(w)&&x.push(N);if(x.length>0){let C=x.length===1?x[0]:Mt(x),N=Kt(i,w),_=await me(C,N);_!==void 0&&(a[w]=_),l.add(w)}}if(!l.has(w)){let x=e.additionalProperties??!0;if(x!==!1){let C=Kt(i,w),N=await me(x===!0?{}:x,C);N!==void 0&&(a[w]=N),l.add(w)}}}if(e.dependencies){for(let[w,x]of Object.entries(e.dependencies))if(!(typeof x!="object"||x===null||Array.isArray(x))&&a[w]!==void 0&&!l.has(w+"_dep")){l.add(w+"_dep");let C=x.oneOf??x.anyOf??x.allOf??[x],N=null;for(let _ of C){if(typeof _!="object"||_===null)continue;let{properties:Y,not:E}=_;if(Y&&Y[w]){let k=Y[w],L=a[w];if(Io(L,k)){N=_;break}}if(E!=null&&E.properties){let k=E.properties[w];if(k){let L=a[w];if(!Io(L,k)){N=_;break}}}}if(!N&&C.length>0&&typeof C[0]=="object"&&(N=C[0]),N!=null&&N.not){let _=N.not;if(_.required&&Array.isArray(_.required))for(let Y of _.required)delete a[Y]}if(N!=null&&N.required)for(let _ of N.required){if(_===w||a[_]!==void 0)continue;let Y=((S=N.properties)==null?void 0:S[_])??{type:"object"},E=Kt(i,_),k=await me(Y,E);k!==void 0&&(a[_]=k)}if(N&&N.properties)for(let[_,Y]of Object.entries(N.properties)){if(_===w)continue;let E=Kt(i,_),k=await me(Y,E);k!==void 0&&(a[_]=k)}}}let I=e.minProperties??0,P=e.maxProperties;if(Object.keys(a).length<I){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let w=Object.entries(e.patternProperties),x=0,C=1e3;for(;Object.keys(a).length<I&&x<C;){x++;let[N,_]=t.random.pick(w),Y=Tf(N,t);if(Y&&!a[Y]){let E=Kt(i,Y),k=await me(_,E);k!==void 0&&(a[Y]=k),l.add(Y)}}}if(Object.keys(a).length<I){let w=e.additionalProperties,x=w===void 0||w===!0?{type:"string"}:w;if(x!==!1){let C=0,N=1e3;for(;Object.keys(a).length<I&&C<N;){C++;let _=`prop${t.random.int(0,99999)}`;if(!a[_]){let Y=Kt(i,_),E=await me(x,Y);E!==void 0&&(a[_]=E),l.add(_)}}}}if(Object.keys(a).length<I){let w=Object.keys(n).join(", ");throw Error(`properties '${w}' were not found while additionalProperties is false in ${t.path}`)}}if(P!==void 0&&Object.keys(a).length>P){let w=Object.keys(a).filter(x=>!c.has(x));for(t.random.shuffle(w);Object.keys(a).length>P&&w.length>0;){let x=w.pop();delete a[x]}}return t.pruneProperties&&t.pruneProperties.length>0&&qs(a,t.pruneProperties),Nf(a,n),a}function Kt(e,t){let n=Sf(t),s=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:s}}function Sf(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Nf(e,t){for(let[n,s]of Object.entries(t)){if(typeof s!="object"||s===null)continue;let r=s;if(r.template===void 0)continue;let i=r.template;if(typeof i!="string")continue;let a=i.replace(/#\{(\w+)\}/g,(l,c)=>{let u=e[c];return u!==void 0?String(u):""});e[n]=a}}function Tf(e,t){let n=e.match(/^\^([a-zA-Z]+)(\.\*|\(\?\:.*\))?/);if(n){let c=n[1],u=n[2];if(u===".*"||u!=null&&u.includes("?:")){let d=t.random.int(0,10),f="";for(let h=0;h<d;h++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return c+f}return c}let s=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(s){let c=s[2],u=t.random.int(1,10),d="";for(let f=0;f<u;f++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return d+c}let r=e.match(/^\^([a-zA-Z]+)\$$/);if(r)return r[1];let i=t.random.int(3,10),a="abcdefghijklmnopqrstuvwxyz",l="";for(let c=0;c<i;c++)l+=t.random.pick(a.split(""));try{if(new RegExp(e).test(l))return l}catch{}return null}function qs(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let s of e)qs(s,t);return}let n=e;for(let s of Object.keys(n))t.includes(s)?delete n[s]:qs(n[s],t)}function _f(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 Cf(e,t){var P;if(t.depth>=t.maxDepth){let S=e.minItems??0;return S>0?Array.from({length:S},()=>null):[]}if(t.refDepthReached){let S=e.minItems??0;return S>0?Array.from({length:S},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let S=((P=e.prefixItems)==null?void 0:P.length)??0;if((e.minItems??0)>S)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${S})`)}let n=t.path==="/"?"/items":`${t.path}/items`,s={...t,depth:t.depth+1,path:n},r=[],i=t.refDepthMax,a=t.minItems??e.minItems??0,l=t.maxItems??e.maxItems??Math.max(a,t.maxDefaultItems);e.maxItems!==void 0&&l>e.maxItems&&(l=e.maxItems),e.minItems!==void 0&&a<e.minItems&&(a=e.minItems),l<a&&(e.maxItems!==void 0?a=l:l=a),t.alwaysFakeOptionals&&(l=Math.max(a,l));let c=e.uniqueItems?new Set:null,u=async(S,w)=>{let x=await me(S,w);if(x===void 0)return"omitted";if(c){let C=JSON.stringify(x);if(c.has(C)){for(let N=0;N<50;N++){if(x=await me(S,Yt(s,r.length)),x===void 0)continue;let _=JSON.stringify(x);if(!c.has(_))return c.add(_),r.push(x),"added"}return"failed"}c.add(C)}return r.push(x),"added"};if(e.prefixItems)for(let S=0;S<e.prefixItems.length&&r.length<l;S++){let w=Yt(s,S);if(await u(e.prefixItems[S],w)==="failed")break}let d;if(i!==void 0&&t.refDepth>=i-1){let S=e.minItems??0;return S>0?Array.from({length:S},()=>null):[]}let f=t.alwaysFakeOptionals??!1,h=t.fixedProbabilities??!1,g=t.optionalsProbability??.5;if(f)d=l;else if(h){let S=l-Math.max(a,r.length),w=Math.round(S*g);d=Math.max(a,r.length)+w}else d=t.random.int(Math.max(a,r.length),l);e.items;let v=e.prefixItems!==void 0,A=e.additionalItems!==void 0,I;if(v?A?I=e.additionalItems:e.items!==void 0&&(I=e.items):I=e.items,I!==!1&&I!==void 0){let S=I??{},w=0,x=Math.max(d*20,50);for(;r.length<d;){let C=await u(S,Yt(s,r.length));if(C==="added"){w=0;continue}if(w++,C==="failed"||w>=x)break}}if(e.contains){let S=e.minContains??1,w=e.maxContains??Math.max(S,1),x=t.random.int(S,w);for(let C=0;C<x;C++){let N=await me(e.contains,Yt(s,r.length));if(N!==void 0){if(c){let _=JSON.stringify(N);if(c.has(_)){let Y=!1;for(let E=0;E<50;E++){if(N=await me(e.contains,Yt(s,r.length)),N===void 0)continue;let k=JSON.stringify(N);if(!c.has(k)){c.add(k),Y=!0;break}}if(!Y)continue}else c.add(_)}if(r.length<l){let _=t.random.int(0,r.length);r.splice(_,0,N)}else if(r.length>0){let _=t.random.int(0,r.length-1);r[_]=N}}}for(;r.length>l;)r.pop()}if(e.containsAll){let S=new Set;for(let w of e.containsAll){let x=await me(w,Yt(s,r.length));if(x!==void 0){if(c){let C=JSON.stringify(x);if(c.has(C)){let N=!1;for(let _=0;_<50;_++){if(x=await me(w,Yt(s,r.length)),x===void 0)continue;let Y=JSON.stringify(x);if(!c.has(Y)){c.add(Y),N=!0;break}}if(!N)continue}else c.add(C)}if(r.length<l){let C=t.random.int(0,r.length);r.splice(C,0,x);let N=new Set;for(let _ of S)N.add(_>=C?_+1:_);S.clear();for(let _ of N)S.add(_);S.add(C)}else if(r.length>0){let C=Array.from({length:r.length},(N,_)=>_).filter(N=>!S.has(N));if(C.length>0){let N=C[t.random.int(0,C.length-1)];r[N]=x,S.add(N)}else r.push(x),S.add(r.length-1)}}}for(;r.length>l;)r.pop()}return e.uniqueItems&&r.length>0?Of(r,e,s,a,l,c):r}async function Of(e,t,n,s,r,i){let a=t.items??{},l=0,c=100;for(;e.length<s&&l<c;){l++;let u=await me(a,Yt(n,e.length));if(u===void 0)continue;let d=JSON.stringify(u);i.has(d)||(i.add(d),e.push(u))}for(;e.length>r;)e.pop();return e}function Yt(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function Mo(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 If(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function If(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),s=e;for(let r of n){let i=r.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof s!="object"||s===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${i}"`);if(Array.isArray(s)){let a=parseInt(i,10);if(isNaN(a)||a<0||a>=s.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${i}"`);s=s[a]}else{if(!(i in s))throw Error(`Cannot resolve JSON pointer "${t}": property "${i}" not found`);s=s[i]}}return s}function Mf(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,s=n.$id,{$id:r,...i}=n;t.set(s,i)}if(e.$defs)for(let[n,s]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,s);return t}async function $r(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let s=t.refDepth+1;if(t.refDepthMax!==void 0&&s>=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,i;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=Mo(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){i=await t.refResolver(n);let f=n.indexOf("#");if(f!==-1){let h=n.slice(f+1);h?r=Mo(i,h):r=i}else r=i;if(i&&typeof i=="object"&&i!==null){let h=i;if(h.$defs)for(let[g,v]of Object.entries(h.$defs))t.refRegistry.set(`#/$defs/${g}`,v)}}if(r===void 0)throw Error(`Unresolved $ref: ${n}`);let a=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:l,...c}=e,u=Object.fromEntries(Object.entries(c).filter(([f])=>!a.has(f)));Object.keys(u).length>0&&typeof r=="object"&&r!==null&&(r={...r,...u});let d={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:r,ctx:d}}function Rf(e,t){typeof e!="boolean"&&(t.set("#",e),Vs(e,"#",t))}function Vs(e,t,n){if(e.$id){let{$id:s,...r}=e;n.set(s,r)}if(e.$defs)for(let[s,r]of Object.entries(e.$defs)){let i=`${t}/$defs/${s}`;n.set(i,r),typeof r=="object"&&r!==null&&Vs(r,i,n)}if(e.properties)for(let[s,r]of Object.entries(e.properties))typeof r=="object"&&r!==null&&Vs(r,`${t}/properties/${s}`,n)}async function Lf(e,t){return e.$ref?(await $r(e,t)).schema:e}async function Pf(e,t){let n=[];for(let s of e)if(typeof s=="object"&&s!==null&&"$ref"in s){let r=await Lf(s,t);n.push(r)}else typeof s=="object"&&s!==null&&n.push(s);return n}async function Df(e,t){let{allOf:n,anyOf:s,oneOf:r,not:i,if:a,then:l,else:c,...u}=e;if(n){let d=await Pf(n,t),f=Mt([u,...d]);return me(f,t)}if(r){let d=t.random.shuffle([...r]),f=u.required??[];for(let w of d){let x=typeof w=="object"&&w!==null?w:{};x.$ref&&(x=(await $r(x,t)).schema);let C=x.required??[],N=[...new Set([...f,...C])],_={...u,required:N},Y=Mt([_,x]),E={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await me(Y,E)}catch{}}let h=r[0],g=typeof h=="object"&&h!==null?h:{};g.$ref&&(g=(await $r(g,t)).schema);let v=g.required??[],A=[...new Set([...f,...v])],I={...u,required:A},P=Mt([I,g]),S={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return me(P,S)}if(s){let d=t.random.shuffle([...s]);for(let g of d){let v=Mt([u,g]);try{return await me(v,t)}catch{}}let f=s[0],h=Mt([u,f]);return me(h,t)}return a!==void 0?Bf(u,a,l,c,t):i?Ff(u,i,t):me(u,t)}async function Bf(e,t,n,s,r){if(n!==void 0){let i=Mt([e,t,n]);try{return await me(i,r)}catch{}}if(s!==void 0){let i=Mt([e,s]);try{return await me(i,r)}catch{}}return me(e,r)}async function Ff(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return me(e,n)}if(t.type&&!t.enum&&!t.const){let s=Array.isArray(t.type)?t.type:[t.type],r=["string","number","integer","boolean","null","object","array"].filter(i=>!s.includes(i));if(r.length>0){let i=n.random.pick(r),a=Mt([e,{type:i}]);return me(a,n)}}if(t.const!==void 0||t.enum!==void 0){let s=t.enum??[t.const],r=new Set(s.map(i=>JSON.stringify(i)));for(let i=0;i<20;i++){let a=await me(e,n);if(!r.has(JSON.stringify(a)))return a}}return me(e,n)}class zf{constructor(){ve(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 s=Object.keys(t);for(let r=s.length-1;r>=0;r--){let i=s[r],a=i.startsWith("x-")?i.slice(2):i,l=this.extensions.get(a);if(l){let c=t[i],u=l.callback.call(l.context,c,t,n);if(u!==void 0)return u}}}getContext(t){var n;return(n=this.extensions.get(t))==null?void 0:n.context}}var Hf=new zf;function Uf(e,t){return Hf.generate(e,t)}var Wf=["string","number","integer","boolean","null","object","array"];function Ro(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 s=$f(e.faker,t),r=Po(s,n??e.type,t.path);return typeof r=="string"&&e.format?Lo(r,e.format,t):r}catch{}if(e.chance!==void 0)try{let s=qf(e.chance,t),r=Po(s,n??e.type,t.path);return typeof r=="string"&&e.format?Lo(r,e.format,t):r}catch{}}function Lo(e,t,n){if(t==="date"){let s=typeof e=="string"?new Date(e):e;if(s instanceof Date&&!isNaN(s.getTime())){let r=s.getFullYear(),i=St(s.getMonth()+1),a=St(s.getDate());return`${r}-${i}-${a}`}if(typeof e=="string"){let r=Date.parse(e);if(!isNaN(r)){let i=new Date(r),a=i.getFullYear(),l=St(i.getMonth()+1),c=St(i.getDate());return`${a}-${l}-${c}`}}}if(t==="date-time"){let s=typeof e=="string"?new Date(e):e;if(s instanceof Date&&!isNaN(s.getTime()))return s.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function Po(e,t,n){if(t===void 0)return e;let s=Array.isArray(t)?t[0]:t;switch(s){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let r=Number(e);return s==="integer"?Math.floor(r):r;case"boolean":return!!e;case"null":return null;default:return e}}function $f(e,t){var a;if(!((a=t.extensions)!=null&&a.faker)){let l=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${l} in ${t.path}`)}let n,s;if(typeof e=="object"&&e!==null){let l=e,c=Object.keys(l);if(c.length>0)n=c[0],s=l[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let r=n.split("."),i=t.extensions.faker;for(let l of r)try{i=i[l]}catch{throw Error(`failed to resolve .${l} (${n})`)}if(typeof i=="function")return s?i(...s):i();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function qf(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let s=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${s} in ${t.path}`)}if(typeof e=="string"){let s=t.extensions.chance[e];if(typeof s=="function")return s.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let s=e,r=Object.keys(s)[0],i=s[r],a=t.extensions.chance[r];if(typeof a=="function")return i?a.call(t.extensions.chance,i):a.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function Vf(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function Ve(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function me(e,t){if(e===!0)return me({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let i=e,a=null;for(let[l,c]of Object.entries(t.propAliases))l in i&&!(c in i)&&(a||(a={...i}),a[c]=a[l],delete a[l]);a&&(e=a)}let n;if(Array.isArray(e.type)){let i=e.type;n=t.random.pick(i);let a={...t,resolvedType:n},l=Ro(e,a,n);if(l!==void 0)return typeof l=="string"&&a.maxLength!==void 0&&l.length>a.maxLength?Ve(l.slice(0,a.maxLength),e,a):Ve(l,e,a)}else{let i=Ro(e,t,n);if(i!==void 0)return typeof i=="string"&&t.maxLength!==void 0&&i.length>t.maxLength?Ve(i.slice(0,t.maxLength),e,t):Ve(i,e,t)}let s=Uf(e,t);if(s!==void 0)return Ve(s,e,t);if(e.$ref){let i=await $r(e,t);return me(i.schema,Vf(i.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return Df(e,t);if(e.const!==void 0)return Ve(Oo(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return Ve(e.default,e,t);if(e.enum!==void 0)return Ve(Oo(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return Ve(t.random.pick(e.examples),e,t);if(e.example!==void 0)return Ve(e.example,e,t)}let r=Xf(e,t);if(r===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let i=t.defaultInvalidTypeProduct;return typeof i=="string"?Kf(i):i}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(r){case"null":return Ve(af(),e,t);case"boolean":return Ve(lf(t),e,t);case"number":return Ve(Wa(e,t),e,t);case"integer":return Ve(uf(e,t),e,t);case"string":return Ve(bf(e,t),e,t);case"object":return Ve(await jf(e,t),e,t);case"array":return Ve(await Cf(e,t),e,t);default:throw Error(`Unknown type: ${r} at ${t.path}`)}}function Xf(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||Zf(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(Wf)}function Zf(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(Kr.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function Kf(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 Yf(e){let t=Ka(e),n=Ya(e);return`${t}T${n}`}function Ka(e){let t=e.int(2e3,2030),n=e.int(1,12),s=gf(t,n),r=e.int(1,s);return`${t}-${St(n)}-${St(r)}`}function Ya(e){let t=e.int(0,23),n=e.int(0,59),s=e.int(0,59);return`${St(t)}:${St(n)}:${St(s)}Z`}var Jf=["alice","bob","charlie","dave","eve","frank","grace","heidi"],Qf=["example.com","test.org","demo.net","sample.io"];function Do(e){let t=e.pick(Jf),n=e.int(1,999),s=e.pick(Qf);return`${t}${n}@${s}`}var Gf=["https"],ep=["example.com","test.org","demo.net"],tp=["api","v1","users","items","data","resource"];function Nr(e){let t=e.pick(Gf),n=e.pick(ep),s=e.int(1,3),r=[];for(let i=0;i<s;i++)r.push(e.pick(tp));return`${t}://${n}/${r.join("/")}`}var np=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],rp=["com","org","net","io","dev"];function Bo(e){let t=e.int(1,3),n=[];for(let s=0;s<t;s++)n.push(e.pick(np));return n.push(e.pick(rp)),n.join(".")}function sp(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function ip(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function op(e){let t=n=>{let s="";for(let r=0;r<n;r++)s+=e.int(0,15).toString(16);return s};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var ap=["foo","bar","baz","items","0","1","2","name","value"];function Fo(e){let t=e.int(1,4),n=[];for(let s=0;s<t;s++)n.push(e.pick(ap));return"/"+n.join("/")}function lp(e){let t=["P"],n=e.bool(),s=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`)),s&&(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 cp=new Map([["date-time",Yf],["date",Ka],["time",Ya],["duration",lp],["email",Do],["idn-email",Do],["uri",Nr],["uri-reference",Nr],["iri",Nr],["iri-reference",Nr],["hostname",Bo],["idn-hostname",Bo],["ipv4",sp],["ipv6",ip],["uuid",op],["json-pointer",Fo],["relative-json-pointer",e=>`${e.int(0,5)}${Fo(e)}`]]);function Ja(e){let t=new Map(cp);if(e)for(let[n,s]of Object.entries(e))t.set(n,s);return t}function up(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),s=[t];for(let r of n){if(r==="")continue;let i=[];for(let a of s)if(a!=null)if(r==="*")Array.isArray(a)&&i.push(...a);else if(/^\d+$/.test(r)){let l=parseInt(r,10);Array.isArray(a)&&l<a.length&&i.push(a[l])}else r===""?Xs(a,i):typeof a=="object"&&a!==null&&r in a&&i.push(a[r]);s=i}return s}function Xs(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),Xs(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),Xs(n,t)}}function dp(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[s,r]of Object.entries(e))Kr.has(s)||(Za(r)?(t[s]=r,n=!0):(t[s]={const:r},n=!0));if(n)return t}return{}}async function Zs(e,t,n,s){if(!n.resolveJsonPath)return e;let r=s??e;if(t===!0||t===!1||t.$ref)return e;let i=t;if(i.allOf||i.anyOf||i.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let a={...e},l=dp(i);for(let[c,u]of Object.entries(l))if(c in a){let d=a[c];if(typeof u=="object"&&u!==null&&"jsonPath"in u&&typeof u.jsonPath=="string"){let f=up(u.jsonPath,r);f.length>0&&(a[c]=n.random.pick(f))}else{let f=await Zs(d,u,n,r);a[c]=f}}return a}if(Array.isArray(e)&&i.items){let a=[];for(let l of e){let c=await Zs(l,i.items,n,r);a.push(c)}return a}return e}var fp=Ja(),zo=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function pp(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"&&!zo.has(f))throw Error(`Unsupported JSON Schema version: ${f}. Supported versions: ${[...zo].join(", ")}`)}let n=mp(t),s=Ua((t==null?void 0:t.seed)??1),r=n.propAliases?hp(e,n.propAliases):e,i=Mf(r);Rf(r,i);let a=n.formats?Ja(n.formats):new Map(fp),l=n.refDepthMin??n.refDepth,c=n.refDepthMax??n.refDepth;if(l!==void 0&&c!==void 0&&l>c)throw Error(`refDepthMin (${l}) cannot be greater than refDepthMax (${c})`);let u={random:s,maxDepth:n.maxDepth??(c?c+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:i,refStack:new Set,formatRegistry:a,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:l,refDepthMax:c,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 me(r,u);return n.resolveJsonPath?Zs(d,e,u,d):d}function hp(e,t){if(typeof e!="object"||e===null)return e;let n=e,s=null;for(let[r,i]of Object.entries(t))r in n&&!(i in n)&&(s||(s={...n}),s[i]=s[r],delete s[r]);return s??e}function mp(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:gp(n.outputTransform,xp(t.ignoreProperties))}),n}function gp(e,t){return e?t?async(n,s,r)=>{let i=await e(n,s,r);return t(i,s,r)}:e:t}function xp(e){return(t,n,s)=>{if(s==="/")return t;let r=bp(s.slice(s.lastIndexOf("/")+1));return e.some(i=>typeof i=="string"?i===r:i instanceof RegExp?i.test(r):i(n))?void 0:t}}function bp(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qa(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[s,r]of Object.entries(e.properties)){const i=/id$/i.test(s)&&r.type==="string"&&!r.format&&!r.examples,a=r.type==="string"&&!r.format&&!r.examples&&!r.enum;n[s]=i?{...r,format:"uuid"}:a?{...r,examples:["string"]}:Qa(r,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}function yp({schema:e}){const[t,n]=j.useState(null);if(j.useEffect(()=>{let r=!1;try{pp(Qa(e),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(i=>{r||n(i)}).catch(()=>{})}catch{}return()=>{r=!0}},[e]),t===null)return null;const s=JSON.stringify(t,null,2);return o.jsxs("div",{children:[o.jsx(ka,{code:s}),o.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function Ks({schema:e,label:t,description:n,schemaFormat:s,originalSchema:r,conversionError:i,pendingConversion:a}){const l=Na(s),c=!a&&Id(s,i),[u,d]=j.useState(c?"example":"schema");return j.useEffect(()=>{!c&&u==="example"&&d("schema")},[c,u]),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center justify-between mb-2",children:[o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),l&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:l})]}),n&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:n})]}),o.jsx(Ha,{tabs:[...c?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:u,onChange:f=>d(f),ariaLabel:"Schema view toggle"})]}),i&&o.jsxs("p",{className:"text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5 mb-2",children:["Could not convert ",Ta(s)??"the"," schema, showing raw definition. ",i]}),a?o.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):o.jsxs(o.Fragment,{children:[u==="schema"&&o.jsx(Si,{schema:e,rootName:t}),u==="json"&&o.jsx(ja,{schema:r??e}),u==="example"&&c&&o.jsx(yp,{schema:e})]})]})}function Ga({message:e,expanded:t,onToggleExpanded:n,paddingX:s="px-4",focusSection:r=null}){const[i,a]=j.useState("payload");j.useEffect(()=>{(r==="headers"||r==="payload")&&a(r)},[r]);const{deref:l}=dt(),c=Ai(),u=j.useMemo(()=>e.payload?Ur(e.payload,l):null,[e.payload,l,c]),d=j.useMemo(()=>e.headers?Ur(e.headers,l):null,[e.headers,l,c]),f=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsxs("div",{className:`${s} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&o.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&o.jsxs("div",{children:[e.payload&&e.headers&&o.jsx(ri,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:i,onChange:h=>a(h)}),o.jsxs("div",{className:"mt-4",children:[(i==="payload"||!e.headers)&&u&&o.jsx(Ks,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion}),(i==="headers"||!e.payload)&&d&&o.jsx(Ks,{schema:d.schema,label:"Headers",description:d.description,schemaFormat:d.schemaFormat,originalSchema:d.originalSchema,conversionError:d.conversionError,pendingConversion:d.pendingConversion})]})]}),e.tags&&e.tags.length>0&&o.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((h,g)=>o.jsx(yi,{name:`#${h.name}`},g))})]})})}),f&&o.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:[o.jsx("span",{children:t?"Show less":"Show more"}),o.jsx(Xr,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function vp({messageKey:e,message:t,first:n,isSelected:s,focusSection:r}){const[i,a]=j.useState(!1);return j.useEffect(()=>{s&&a(!0)},[s]),o.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${s?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[o.jsxs("tr",{className:"",children:[o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col gap-1.5",children:[o.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),o.jsx("span",{className:"w-fit text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 px-1.5 py-0.5 rounded",children:e})]})}),o.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),o.jsx("td",{className:"px-6 py-4",children:o.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:t.contentType??"—"})})]}),t.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),o.jsxs("div",{className:"flex justify-between w-full",children:[o.jsx("div",{}),o.jsx("div",{children:t.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:t.correlationId.description??t.correlationId.location,children:t.correlationId.location})})]})]})})]}),o.jsx("tr",{children:o.jsx("td",{colSpan:3,className:"p-0",children:o.jsx(Ga,{message:t,expanded:i,onToggleExpanded:()=>a(l=>!l),paddingX:"px-6",focusSection:s?r:null})})})]})}function el({messages:e,selectedKey:t,focusSection:n}){const s=Object.entries(e),r=s.length?o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),s.map(([i,a],l)=>o.jsx(vp,{messageKey:i,message:a,first:l===0,isSelected:t===i,focusSection:n},i))]})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No messages defined in this AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Tn,{content:r,stickySideContent:!1})})}function wp({serverNames:e=[],current:t,setCurrent:n}){return o.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(s=>o.jsx("button",{type:"button",onClick:()=>n(s),"aria-current":t===s?"page":void 0,className:jn(t===s?"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 w-full text-left"),children:o.jsx("span",{className:"truncate",children:s})},s))})}function tl({className:e,children:t,...n}){return o.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 Ep(e){return o.jsx(tl,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"})})}function Ap(e){return o.jsx(tl,{...e,children:o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"})})}function Ni({className:e}){return o.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:o.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}const kp=[{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 nl({securities:e}){var a;const t=j.useMemo(()=>kp.filter(l=>{const c=l.id;return e==null?void 0:e.some(u=>u.type.toLowerCase()===c.toLowerCase())}),[e]),[n,s]=j.useState(t.length>0?t[0].id:null);j.useEffect(()=>{t.length>0&&s(t[0].id)},[t]);function r(l){return e.find(c=>c.type===l)}const i=n?(a=r(n))==null?void 0:a.description:void 0;return o.jsxs("div",{children:[t.length>1&&o.jsx(ri,{tabs:t,current:n,onChange:s}),o.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[n==="userPassword"&&o.jsxs(Tr,{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),n&&["scramSha256","scramSha512","plain"].includes(n)&&o.jsxs(Tr,{description:i,children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),n==="gssapi"&&o.jsxs(Tr,{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),n==="X509"&&o.jsxs(Tr,{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),n==="apiKey"&&o.jsx(jp,{security:r("apiKey")}),n==="openIdConnect"&&o.jsx(Sp,{security:r("openIdConnect")}),n==="oauth2"&&o.jsx(Np,{security:r("oauth2")})]})]})}const Tr=({description:e,children:t})=>e?o.jsx(o.Fragment,{children:o.jsx(hn,{children:e})}):o.jsx("span",{children:t}),jp=({security:e})=>e!=null&&e.description?o.jsx(hn,{children:e.description}):(e==null?void 0:e.in)==="password"?o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the password and leave the user name empty"})," ","to connect to this server."]}):o.jsxs("span",{children:["You have to"," ",o.jsx("strong",{className:"text-foreground-secondary",children:"provide your API key as the user name and leave the password empty"})," ","to connect to this server."]}),Sp=({security:e})=>o.jsxs(o.Fragment,{children:[e!=null&&e.description?o.jsx(hn,{children:e.description}):o.jsx("p",{children:"You can use OpenID to connect to this server."}),o.jsxs("p",{children:["The OpenID Connect URL is"," ",o.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),(e==null?void 0:e.scopes)&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("code",{children:nc(e.scopes)})})]})]}),Np=({security:e})=>{const t=e==null?void 0:e.flows;return o.jsxs(o.Fragment,{children:[(e==null?void 0:e.description)&&o.jsx(hn,{children:e.description}),t&&Object.entries(t).map(([n,s])=>{let r="",i="";switch(n){case"clientCredentials":r=Dl,i=Bl;break;case"implicit":r=Ll,i=Pl;break;case"password":r=Fl,i=zl;break;case"authorizationCode":r=Hl,i=Ul;break}return o.jsxs("div",{children:[o.jsxs("div",{children:[o.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:r}),o.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:i})]}),o.jsx("div",{className:"mt-5 border-t border-border",children:o.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[s.authorizationUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:s.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.authorizationUrl})})]}),s.tokenUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:s.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.tokenUrl})})]}),s.refreshUrl&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("a",{href:s.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:s.refreshUrl})})]}),s.availableScopes&&o.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[o.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Scopes"}),o.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:o.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(s.availableScopes)?s.availableScopes:Object.keys(s.availableScopes)).map(a=>o.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:a},a))})})]})]})})]},n)})]})};function Tp({className:e}){return o.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 6.873a9 9 0 011 4.127 9 9 0 01-1 4.127M5 6.873a9 9 0 00-1 4.127 9 9 0 001 4.127"}),o.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}function _p(e){return e.startsWith("http://")||e.startsWith("https://")}function rl(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function sl({value:e}){if(e==null)return null;if(typeof e=="string"&&_p(e))return o.jsx("a",{href:e,target:"_blank",rel:"noreferrer",className:"text-xs text-blue-600 underline underline-offset-2 break-all hover:text-blue-800",children:e});if(typeof e=="boolean")return o.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return o.jsx("span",{className:"text-xs font-mono text-blue-600",children:e});if(typeof e=="object"){const t=e;return"type"in t&&Array.isArray(t.enum)?o.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,s)=>o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},s))}):o.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,s])=>o.jsxs("div",{className:"flex items-start gap-2",children:[o.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:rl(n)}),o.jsx(sl,{value:s})]},n))})}return o.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function il({bindings:e,expand:t=!1,protocol:n,focused:s}){const[r,i]=j.useState(t);j.useEffect(()=>{s&&i(!0)},[s]);const a=Vl[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},l=Object.entries(e??{}).filter(([u,d])=>u!=="bindingVersion"&&d!==void 0&&d!==null),c=j.useId();return l.length===0?null:o.jsxs("div",{className:"mt-2 rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":r,"aria-controls":c,onClick:()=>i(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[o.jsx("div",{className:"flex items-center gap-2",children:o.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${a.color}`,children:a.label})}),r?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted"}):o.jsx(Ni,{className:"w-4 h-4 text-foreground-muted"})]}),o.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${r?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"divide-y divide-neutral-100",children:l.length===0?o.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):l.map(([u,d])=>o.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[o.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:rl(u)}),o.jsx("div",{className:"flex-1 min-w-0",children:o.jsx(sl,{value:d})})]},u))})})})]})}function Cp({host:e,protocol:t,description:n,tags:s,variables:r,security:i,bindings:a,serverKey:l,focusSection:c=null}){const u=r,[d,f]=j.useState(!1),h=j.useId(),g=j.useId();return j.useEffect(()=>{c==="security"&&f(!0)},[c]),o.jsxs("div",{children:[o.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[o.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[o.jsx(Ep,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&o.jsx(Zn,{address:e,parameters:u,className:"font-bold leading-tight tracking-tight px-0"})]}),o.jsx("div",{className:"mt-2",children:s&&s.map((v,A)=>{const I=v,P=I.externalDocs;return o.jsx(yi,{href:P&&P.url,title:I.description||(P&&P.description?P.description:void 0),name:I.name},A)})})]}),o.jsx(hn,{children:n}),i&&i.length>0&&o.jsxs("div",{id:l?`server-${l}-security`:void 0,children:[o.jsxs("h3",{id:h,className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Ap,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),o.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",i.length>1?"s":"",":"]}),o.jsxs("div",{className:"mt-4 rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":g,"aria-labelledby":h,onClick:()=>f(v=>!v),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:i.length}),d?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Ni,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:g,className:`grid transition-all duration-200 ease-in-out ${d?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(nl,{securities:i})})})})]})]}),(()=>{const v=a==null?void 0:a[t];return v&&Object.keys(v).some(I=>I!=="bindingVersion")?o.jsxs("div",{id:l?`server-${l}-bindings`:void 0,children:[o.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[o.jsx(Tp,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),o.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),o.jsx(il,{bindings:v,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function ol({servers:e,selectedServer:t,onSelectServer:n,focusSection:s=null}){const r=Object.keys(e),[i,a]=j.useState(void 0),l=[t,i].find(d=>!!d&&r.includes(d))??r[0],c=d=>{a(d),n==null||n(d)},u=o.jsx(Cp,{...e[l],serverKey:l,focusSection:t||i?s:null});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Tn,{title:Wl,content:u,sideContent:o.jsx(wp,{serverNames:r,current:l,setCurrent:c}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function al({message:e,messageId:t,i:n}){const[s,r]=j.useState(!1);return o.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-3",children:[o.jsxs("div",{className:"flex items-start justify-between gap-3",children:[o.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&o.jsx("span",{className:"text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200 p-0.5 rounded shrink-0",children:t??e.name})]}),e.summary&&o.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),o.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&o.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",children:e.contentType}),e.correlationId&&o.jsx("span",{className:"text-xs bg-secondary-50 text-secondary-500 px-1.5 py-0.5 rounded border border-secondary-200",title:e.correlationId.description??e.correlationId.location,children:e.correlationId.location}),e.deprecated&&o.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),o.jsx(Ga,{message:e,expanded:s,onToggleExpanded:()=>r(i=>!i)})]})}function Op({requestMessages:e,reply:t,isSend:n,operationId:s}){const[r,i]=j.useState("request"),a=t.messages??[],l=t.channel,c=t.address,u=r==="request"?e:a,d=r==="request"?n?"accepts":"expects":o.jsxs(o.Fragment,{children:["replies to"," ",c?o.jsxs(o.Fragment,{children:["a channel in"," ",o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:c.location})]}):(l==null?void 0:l.address)&&o.jsx(Zn,{address:l.address,parameters:l.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return o.jsxs("div",{children:[o.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(f=>o.jsx("button",{onClick:()=>i(f),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
73
+ ${r===f?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:f},f))}),o.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?o.jsxs(o.Fragment,{children:[o.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary",children:s})," ",d,u.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):o.jsxs("span",{children:[" "," with the following message:"]})]}),o.jsx("div",{className:"space-y-2",children:u.map((f,h)=>o.jsx(al,{message:f,messageId:f.name,i:h},h))})]}):o.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function Ip({op:e,id:t,focusSection:n=null}){var P;const[s,r]=j.useState(!1),i=j.useId(),a=j.useId();j.useEffect(()=>{n==="security"&&r(!0)},[n]);const l=e.messages??[],c=e.tags??[],u=e.bindings,d=e.traits,f=e.reply,h=e.externalDocs,g=e.security,v=u??(Array.isArray(d)?(P=d.find(S=>S.bindings))==null?void 0:P.bindings:void 0),A=e.action===Qt.SEND,I=o.jsx("div",{className:"space-y-2",children:l.map((S,w)=>o.jsx(al,{message:S,messageId:S.name,i:w},w))});return o.jsxs("div",{className:"space-y-6",id:`operation-${t}-detail`,children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("span",{className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-mono bg-primary-50 text-primary-600 border border-primary-200",children:["ID: ",t]}),(h==null?void 0:h.url)&&o.jsxs("a",{href:h.url,target:"_blank",rel:"noreferrer",title:h.description||h.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",o.jsx(Ea,{className:"w-3.5 h-3.5"})]})]}),e.description&&o.jsx("div",{children:o.jsx(hn,{children:e.description})}),e.summary&&o.jsx("div",{children:o.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),g&&g.length>0&&o.jsxs("div",{id:`operation-${t}-security`,children:[o.jsx("p",{id:i,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),o.jsxs("div",{className:"rounded-lg border border-border overflow-hidden",children:[o.jsxs("button",{type:"button","aria-expanded":s,"aria-controls":a,"aria-labelledby":i,onClick:()=>r(S=>!S),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[o.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:g.length}),s?o.jsx(Xr,{className:"w-4 h-4 text-foreground-muted shrink-0"}):o.jsx(Ni,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),o.jsx("div",{id:a,className:`grid transition-all duration-200 ease-in-out ${s?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:o.jsx("div",{className:"overflow-hidden",children:o.jsx("div",{className:"px-4 py-2 border-t border-border",children:o.jsx(nl,{securities:g})})})})]})]}),v&&Object.entries(v).map(([S,w])=>w?o.jsxs("div",{id:`operation-${t}-bindings-${S}`,children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),o.jsx(il,{protocol:S,bindings:w,focused:n===`binding:${S}`})]},S):null),f?o.jsx(Op,{requestMessages:l,reply:f,isSend:A,operationId:t}):l.length>0&&o.jsxs("div",{children:[o.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[o.jsx("span",{className:"font-bold",children:t})," ",A?"accepts":"expects",l.length>1?o.jsxs(o.Fragment,{children:[o.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),I]}),c.length>0&&o.jsxs("div",{children:[o.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),o.jsx("div",{className:"flex flex-wrap gap-1.5",children:c.map((S,w)=>o.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:S.name},w))})]})]})}function ll({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:s=null}){const r=h=>n==null?void 0:n(h);if(!Object.keys(e).length)return null;const i=t?e[t]:null,a=Object.keys(e).map(h=>{var C;const g=e[h],v=g.channel,A=v==null?void 0:v.address,I=v==null?void 0:v.parameters,P=g.action===Qt.SEND,S=((C=g.action)==null?void 0:C.toUpperCase())??"",w=P?"bg-green-100 text-green-800":g.action===Qt.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",x=t===h;return o.jsxs("tr",{id:`operation-${h}`,onClick:()=>r(h),role:"button",tabIndex:0,"aria-label":`${S||"Operation"} ${A??h}`,"aria-current":x?"true":void 0,onKeyDown:N=>{N.key!=="Enter"&&N.key!==" "||(N.preventDefault(),r(h))},className:`group cursor-pointer ${x?"bg-neutral-50":""}`,children:[o.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:A&&o.jsx(Zn,{address:A,parameters:I,truncate:!0})}),o.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:o.jsx("div",{className:`inline-flex w-24 items-center justify-center px-2 py-1 text-center rounded-md text-xs font-medium uppercase ${w}`,children:S})}),o.jsx("td",{className:"group-hover:bg-neutral-50"})]},h)}),l=i?i.channel:null,u=(i==null?void 0:i.action)===Qt.SEND?"bg-green-100 text-green-800":(i==null?void 0:i.action)===Qt.RECEIVE?"bg-blue-100 text-blue-800":"bg-neutral-100 text-foreground-secondary",d=i&&(l!=null&&l.address)?o.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[o.jsx("span",{className:`inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium uppercase ${u}`,children:i.action}),o.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:o.jsx(Zn,{address:l.address,parameters:l.parameters})})]}):t??"Operation",f=o.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:o.jsxs("table",{className:"w-full",children:[o.jsx("thead",{className:"bg-neutral-100 w-full",children:o.jsxs("tr",{children:[o.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),o.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),o.jsx("tbody",{className:"bg-surface divide-y divide-border",children:a})]})});return o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Tn,{title:$l,content:f,stickySideContent:!1})}),o.jsx(Vo,{isOpen:!!i,side:"right",onClose:()=>r(null),title:d,children:i&&o.jsx(Ip,{op:i,id:t,focusSection:s})})]})}function cl({schemas:e,selectedKey:t,focusTarget:n}){const{deref:s}=dt(),r=Ai(),i=j.useMemo(()=>Object.entries(e).map(([l,c])=>[l,Ur(c,s)]),[e,s,r]),a=i.length?o.jsx("div",{className:"grid gap-6 w-full",children:i.map(([l,c])=>{const u=c.schema,d=Na(c.schemaFormat),f=u.properties?Object.keys(u.properties).length:0;return o.jsxs("article",{id:`schema-${l}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===l?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[o.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[o.jsxs("div",{children:[o.jsx("h3",{className:"text-base font-semibold text-foreground",children:l}),c.description&&o.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:c.description})]}),o.jsx("span",{className:"inline-flex rounded-full bg-neutral-100 px-3 py-1 text-xs font-semibold uppercase tracking-wide text-foreground-secondary",children:u.type??"unknown"})]}),(u.format||d||f>0)&&o.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[u.format&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",u.format]}),d&&o.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:c.schemaFormat,children:d}),f>0&&o.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[f," properties"]})]}),c.conversionError&&o.jsxs("p",{className:"mt-4 text-xs text-amber-700 bg-amber-50 border border-amber-200 rounded px-2 py-1.5",children:["Could not convert"," ",Ta(c.schemaFormat)??"the"," schema — showing raw definition. ",c.conversionError]}),c.pendingConversion&&o.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),c.pendingConversion?null:c.conversionError&&typeof c.originalSchema=="string"?o.jsx("div",{className:"mt-4",children:o.jsx(ja,{schema:c.originalSchema})}):o.jsx(Si,{schema:u,rootName:l,className:"mt-4",focusTokens:l===t?(n==null?void 0:n.tokens)??null:null,focusId:l===t?(n==null?void 0:n.id)??null:null})]},l)})}):o.jsx("div",{className:"mt-10 rounded-xl border border-dashed border-neutral-300 bg-surface p-8 text-center text-sm text-foreground-muted",children:"No schemas defined in this AsyncAPI document."});return o.jsx("div",{className:"flex justify-center w-full",children:o.jsx(Tn,{content:a,stickySideContent:!1})})}const Mp=e=>e==="operations"||e==="messages"||e==="schemas";function Rp({asyncapi:e,config:t}){var $e,pe,$t,te,Rt;const n=t.show??{},s=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Xo}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Zo}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:Ko}]:[]],r=(($e=s[0])==null?void 0:$e.id)??"operations",[i,a]=j.useState(r),[l,c]=j.useState(null),u=V=>{a(V),c(V)},[d,f]=j.useState(null),[h,g]=j.useState(null),[v,A]=j.useState(null),[I,P]=j.useState(null),S=s.some(V=>V.id===i)?i:r,w=n.operations!==!1?d:null,x=n.messages!==!1?h:null,C=n.schemas!==!1?v:null,N=n.servers!==!1?I:null,_=e.servers?Object.keys(e.servers):[],{query:Y,setQuery:E,results:k}=tu(e,{threshold:.3,limit:20}),[L,ae]=j.useState(null),[se,Ae]=j.useState(null),[fe,Ce]=j.useState(null),ie=j.useRef(null),Te=V=>{V.tab==="operations"||V.tab==="messages"||V.tab==="schemas"?u(V.tab):V.tab==="servers"&&c("servers"),f(V.tab==="operations"?V.key:null),g(V.tab==="messages"?V.key:null),A(V.tab==="schemas"?V.key:null),P(V.tab==="servers"?V.key:null),ae(V.focusSection??null),Ae(V.tab==="schemas"&&V.schemaFocusTokens?{tokens:V.schemaFocusTokens,id:V.targetId}:null),V.tab==="schemas"&&gs(),Ce({targetId:V.targetId,query:Y,highlight:V.tab!=="schemas"})};j.useEffect(()=>{if(!fe)return;const{targetId:V,query:ft,highlight:$}=fe;let oe=!1;const ge=ke=>{if(oe)return;const je=document.getElementById(V);if(!je){ke<40&&setTimeout(()=>ge(ke+1),50);return}if(ie.current!==V){try{je.scrollIntoView({behavior:"smooth",block:"start"})}catch{}ie.current=V}$&&le(0)},le=ke=>{if(oe)return;const je=document.getElementById(V);je&&ru(je,ft),ke<6&&setTimeout(()=>le(ke+1),100)};return setTimeout(()=>ge(0),50),()=>{oe=!0}},[fe,S,w,x,C,N,L,se]),j.useEffect(()=>{Y.trim()||(Ce(null),gs())},[Y]),j.useEffect(()=>gs,[]);const be=S==="operations"?o.jsx(ll,{operations:e.operations??{},selectedKey:w,onSelectKey:f,focusSection:L}):S==="messages"?o.jsx(el,{messages:((pe=e.components)==null?void 0:pe.messages)??{},selectedKey:x,focusSection:L}):S==="schemas"?o.jsx(cl,{schemas:(($t=e.components)==null?void 0:$t.schemas)??{},selectedKey:C,focusTarget:se}):null;return o.jsx(ni,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:o.jsxs("div",{className:"px-4",children:[n.search!==!1&&o.jsx(oc,{query:Y,onQueryChange:E,results:k,onSelectResult:Te}),n.info!==!1&&o.jsx("div",{id:"info-panel",children:o.jsx(Aa,{...e.info})}),n.servers!==!1&&_.length>0&&o.jsx("div",{id:`server-${N??_[0]}`,children:o.jsx(ol,{servers:e.servers,selectedServer:N,onSelectServer:P,focusSection:L})}),n.sidebar!==!1&&o.jsx(sc,{info:e.info,operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(te=e.components)==null?void 0:te.messages:void 0,schemas:n.schemas!==!1?(Rt=e.components)==null?void 0:Rt.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,sidebarConfig:t.sidebar,activeTab:l,onTabChange:u,onItemSelect:(V,ft)=>{u(V),f(V==="operations"?ft:null),g(V==="messages"?ft:null),A(V==="schemas"?ft:null)},onSelectServer:V=>{c("servers"),f(null),g(null),A(null),P(V)},selectedItem:w?{tab:"operations",key:w}:x?{tab:"messages",key:x}:C?{tab:"schemas",key:C}:N?{tab:"servers",key:N}:null}),o.jsx(Jl,{tabs:s,current:S,onChange:V=>{Mp(V)&&u(V)}}),S&&o.jsx("div",{id:`panel-${S}`,role:"tabpanel","aria-labelledby":`tab-${S}`,children:be})]})})}const Ti=e=>{const t=e.asyncapi,n=j.useMemo(()=>ei(t),[t]),s=e.config??Gs;return o.jsx(Rp,{asyncapi:n,config:s})};function ul(e,t,n){e.registerSchemaParser(t);const s=e.parserRegistry,r=s.get.bind(s);s.get=i=>{const a=r(i);return a!==void 0?a:n(i)?t:void 0}}const Lp=["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 Pp(){return{validate:Bp,parse:Fp,getMimeTypes:()=>Lp}}function Dp(e){ul(e,Pp(),Gn)}function Bp(e){return Ei(e.data).map(t=>({message:t,path:e.path}))}function Fp(e){var n,s;const t=Ei(e.data);if(t.length>0)return{[Hr]:t[0]};try{const r=Us(e.data),i=e.meta.message,a=(s=(n=i==null?void 0:i.bindings)==null?void 0:n.kafka)==null?void 0:s.key;return a&&i&&(i["x-parser-original-bindings-kafka-key"]=a,i.bindings.kafka.key=Us(a)),r}catch(r){return{[Hr]:r instanceof Error?r.message:"Failed to convert Avro schema"}}}async function zp(){try{const e=await Promise.resolve().then(()=>require("./index-BcNlIoEF.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 dl(e){const t=await zp(),n=new t;Dp(n);const{registerProtobufSchemaParser:s}=await Promise.resolve().then(()=>require("./protobufSchemaParser-sEw46uRx.cjs"));s(n);try{const{document:r,diagnostics:i}=await n.parse(e);return{diagnostics:i,document:r?Up(r):null}}catch(r){return{diagnostics:[{message:r instanceof Error?r.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function Hp(e,t){const{diagnostics:n,document:s}=await dl(e);return{diagnostics:n,view:s?o.jsx(Ti,{kind:"resolved",asyncapi:s,config:t}):null}}function Up(e){return e.json()}function Wp({raw:e,config:t,onDiagnostics:n}){const[s,r]=j.useState(null),i=j.useRef(n);return i.current=n,j.useEffect(()=>{let a=!0;return dl(e).then(({document:l,diagnostics:c})=>{var u;a&&(r(l),(u=i.current)==null||u.call(i,c))}),()=>{a=!1}},[e]),s?o.jsx(Ti,{kind:"resolved",asyncapi:s,config:t}):null}function $p({document:e,config:t,children:n}){const s=j.useMemo(()=>ei(e),[e]);return o.jsx(ni,{document:s,config:t,children:n})}function ir({document:e,config:t,children:n}){const s=j.useContext(ti),r=j.useMemo(()=>e?ei(e):null,[e]);if(s)return o.jsx(o.Fragment,{children:n});if(!r)throw new Error("This AsyncAPI section needs a `document` prop unless it is rendered inside <AsyncAPIProvider> or <AsyncAPI>.");return o.jsx(ni,{document:r,config:t,children:n})}function or(){return dt().document}function qp(){const e=or();return!e.servers||Object.keys(e.servers).length===0?null:o.jsx(ol,{servers:e.servers})}function Vp(e){return o.jsx(ir,{...e,children:o.jsx(qp,{})})}function Xp(){const e=or(),[t,n]=j.useState(null);return o.jsx(ll,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function Zp(e){return o.jsx(ir,{...e,children:o.jsx(Xp,{})})}function Kp(){var t;const e=or();return o.jsx(el,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function Yp(e){return o.jsx(ir,{...e,children:o.jsx(Kp,{})})}function Jp(){var t;const e=or();return o.jsx(cl,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function Qp(e){return o.jsx(ir,{...e,children:o.jsx(Jp,{})})}function Gp(){const e=or();return e.info?o.jsx(Aa,{...e.info}):null}function eh(e){return o.jsx(ir,{...e,children:o.jsx(Gp,{})})}exports.AsyncAPI=Ti;exports.AsyncAPIProvider=$p;exports.AsyncAPIRenderer=Wp;exports.Info=eh;exports.Messages=Yp;exports.Operations=Zp;exports.SchemaTabs=Ks;exports.SchemaTree=Si;exports.Schemas=Qp;exports.Servers=Vp;exports.X_LIB_CONVERSION_ERROR=Hr;exports.commonjsGlobal=iu;exports.defaultConfig=Gs;exports.getAugmentedNamespace=ou;exports.getDefaultExportFromCjs=ci;exports.isProtobufSchemaFormat=er;exports.parseAndRender=Hp;exports.registerSchemaParserWithFallback=ul;exports.useAsyncAPIDocument=dt;