apiuikit 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/CodeSamples-CXtSA6EK.js +4298 -0
- package/dist/CodeSamples-D7dq1xEM.cjs +50 -0
- package/dist/apiuikit.cjs.js +1 -1
- package/dist/apiuikit.es.js +30 -22
- package/dist/config/config.d.ts +48 -0
- package/dist/contexts/useSpec.d.ts +3 -0
- package/dist/helpers/jsonPointer.d.ts +5 -0
- package/dist/helpers/llmsTxt.d.ts +51 -0
- package/dist/helpers/specAdapters.d.ts +32 -0
- package/dist/helpers/toMarkdown.d.ts +5 -6
- package/dist/hooks/useDocumentProviderValue.d.ts +3 -1
- package/dist/index-BJ0X8yP3.cjs +133 -0
- package/dist/{index-DM2MTkYV.js → index-BMRPdMaB.js} +1 -1
- package/dist/{index-EeGvEXPN.cjs → index-BoAORjov.cjs} +1 -1
- package/dist/{index-B5IBIM-V.cjs → index-CZjVUeK4.cjs} +1 -1
- package/dist/index-DCDYBZcY.js +1461 -0
- package/dist/index-DwzxTmOd.js +13614 -0
- package/dist/index-d8kJa7YD.cjs +4 -0
- package/dist/{index-iXpNcBcP.js → index-ib-tk7y5.js} +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/markdown-assets/protoToJsonSchema-CBPWaboT.js +6193 -0
- package/dist/markdown-assets/protoToJsonSchema-CgkcluFJ.js +83 -0
- package/dist/markdown.cjs +91 -0
- package/dist/markdown.d.ts +8 -0
- package/dist/markdown.es.js +2101 -0
- package/dist/{protoToJsonSchema-CcEvAEt4.js → protoToJsonSchema-Btyc_WLL.js} +112 -108
- package/dist/{protoToJsonSchema-BNZrP3Fa.cjs → protoToJsonSchema-wxazjeYy.cjs} +10 -10
- package/dist/{protobufSchemaParser-BaWs_7UI.js → protobufSchemaParser-9KjS7p8W.js} +2 -2
- package/dist/{protobufSchemaParser-7sU6XBEb.cjs → protobufSchemaParser-G1NujZ28.cjs} +1 -1
- package/dist/shims/utilInspect.d.ts +2 -0
- package/package.json +8 -3
- package/dist/components/Navigation/tests/spineTicks.test.d.ts +0 -1
- package/dist/components/schema/tests/SchemaTab.test.d.ts +0 -1
- package/dist/components/schema/tests/schemaUtils.test.d.ts +0 -1
- package/dist/components/tests/Authorization.test.d.ts +0 -1
- package/dist/components/tests/Bindings.test.d.ts +0 -1
- package/dist/components/tests/ChannelAddress.test.d.ts +0 -1
- package/dist/components/tests/CodeBlock.test.d.ts +0 -1
- package/dist/components/tests/CodeSamples.test.d.ts +0 -1
- package/dist/components/tests/CopyMarkdownButton.test.d.ts +0 -1
- package/dist/components/tests/ErrorBoundary.test.d.ts +0 -1
- package/dist/components/tests/MarkdownExportMenu.test.d.ts +0 -1
- package/dist/components/tests/RenderExtensions.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPI.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPIErrorBoundary.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/AsyncAPIRenderer.test.d.ts +0 -1
- package/dist/containers/AsyncAPI/tests/searchHighlight.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPI.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPIErrorBoundary.test.d.ts +0 -1
- package/dist/containers/OpenAPI/tests/OpenAPIRenderer.test.d.ts +0 -1
- package/dist/containers/Path/tests/PathOperation.test.d.ts +0 -1
- package/dist/containers/Path/tests/Paths.test.d.ts +0 -1
- package/dist/helpers/avro/tests/avroToJsonSchema.test.d.ts +0 -1
- package/dist/helpers/protobuf/tests/protoToJsonSchema.test.d.ts +0 -1
- package/dist/helpers/protobuf/tests/protobufSchemaParser.test.d.ts +0 -1
- package/dist/helpers/tests/codeSamples.test.d.ts +0 -1
- package/dist/helpers/tests/exampleSchema.test.d.ts +0 -1
- package/dist/helpers/tests/openapiSearchIndex.test.d.ts +0 -1
- package/dist/helpers/tests/resolveDocument.test.d.ts +0 -1
- package/dist/helpers/tests/schemaFormat.test.d.ts +0 -1
- package/dist/helpers/tests/toMarkdown.test.d.ts +0 -1
- package/dist/index-BqogUhNO.js +0 -19011
- package/dist/index-mYBY1Eu8.cjs +0 -177
- package/dist/public/tests/sections.test.d.ts +0 -1
- package/dist/stories/AsyncAPI.stories.d.ts +0 -14
- package/dist/stories/AsyncAPIRenderer.stories.d.ts +0 -17
- package/dist/stories/Authorization.stories.d.ts +0 -13
- package/dist/stories/Bindings.stories.d.ts +0 -12
- package/dist/stories/ChannelAddress.stories.d.ts +0 -13
- package/dist/stories/CodeBlock.stories.d.ts +0 -11
- package/dist/stories/Examples.stories.d.ts +0 -11
- package/dist/stories/Information.stories.d.ts +0 -9
- package/dist/stories/Message.stories.d.ts +0 -11
- package/dist/stories/Messages.stories.d.ts +0 -11
- package/dist/stories/Operation.stories.d.ts +0 -10
- package/dist/stories/Operations.stories.d.ts +0 -16
- package/dist/stories/SchemaTab.stories.d.ts +0 -12
- package/dist/stories/SchemaTree.stories.d.ts +0 -24
- package/dist/stories/SearchPanel.stories.d.ts +0 -16
- package/dist/stories/Server.stories.d.ts +0 -12
- package/dist/stories/TabToggle.stories.d.ts +0 -10
- package/dist/stories/Tabs.stories.d.ts +0 -11
- package/dist/stories/documentContextDecorator.d.ts +0 -25
- package/dist/stories/noCanvasDocsPage.d.ts +0 -9
- package/dist/utils/tests/hasRef.test.d.ts +0 -1
- package/dist/utils/tests/theme.test.d.ts +0 -1
- package/dist/utils/tests/useElementRect.test.d.ts +0 -1
package/dist/index-mYBY1Eu8.cjs
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";var Hp=Object.defineProperty;var qp=(e,t,n)=>t in e?Hp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>qp(e,typeof t!="symbol"?t+"":t,n);const l=require("react/jsx-runtime"),A=require("react"),Ar=require("react-dom"),Ji=["#14b8a6","#22c55e","#84cc16","#3b82f6","#06b6d4","#8b5cf6"],Yi=(e,t)=>{const n=t.length>0?t:Ji,r=(e%n.length+n.length)%n.length;return n[r]},zn={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:Ji},expand:{schemas:!1},sidebar:{useChannelAddressAsIdentifier:!0}},Zi=e=>typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string",ds=e=>typeof e=="object"&&e!==null,zp=e=>e.replace(/^#\//,"").split("/").pop()??e,Xi=(e,t=new Set)=>typeof e!="object"||e===null||t.has(e)?!1:(t.add(e),Zi(e)?!0:(Array.isArray(e)?e:Object.values(e)).some(r=>Xi(r,t))),wu=(e,t=new Set,n=new Set)=>{if(typeof e!="object"||e===null)return!1;if(t.has(e))return!0;if(n.has(e))return!1;if(n.add(e),Zi(e))return!0;t.add(e);try{return(Array.isArray(e)?e:Object.values(e)).some(s=>wu(s,t,n))}finally{t.delete(e)}},Wp=(e,t)=>{if(!t.startsWith("#"))return;const n=t.replace(/^#\//,"").split("/").filter(Boolean);let r=e;for(const s of n){if(!ds(r)&&!Array.isArray(r))return;const o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(r=r[o],r==null)return}return r},Vp=e=>e.replace(/~/g,"~0").replace(/\//g,"~1"),El=e=>e.length?`#/${e.map(Vp).join("/")}`:"#";function Tr(e){if(!wu(e))return e;const t=new Map,n=new Set,r=new Map,s=(o,i)=>{if(Array.isArray(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const c=[];r.set(o,El(i)),t.set(o,c),n.add(o);try{o.forEach((u,f)=>c.push(s(u,[...i,String(f)])))}finally{n.delete(o)}return c}if(Zi(o)){const a=Wp(e,o.$ref),c=ds(a)||Array.isArray(a);if(c&&!n.has(a)){const u=s(a,i);return ds(u)&&u["x-parser-schema-id"]===void 0&&(u["x-parser-schema-id"]=zp(o.$ref)),u}if(a!==void 0&&!c)return a}if(ds(o)){if(n.has(o))return{$ref:r.get(o)};const a=t.get(o);if(a!==void 0)return a;const c={};r.set(o,El(i)),t.set(o,c),n.add(o);try{for(const[u,f]of Object.entries(o))c[u]=s(f,[...i,u])}finally{n.delete(o)}return c}return o};return s(e,[])}class Qi extends A.Component{constructor(){super(...arguments);je(this,"state",{error:null});je(this,"reset",()=>{this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var s,o;console.error("[apiuikit] Rendering error:",n,r.componentStack),(o=(s=this.props).onError)==null||o.call(s,n,r)}render(){const{error:n}=this.state;if(!n)return this.props.children;const{fallback:r}=this.props;return typeof r=="function"?r(n,this.reset):r!==void 0?r:l.jsxs("div",{role:"alert",className:"flex flex-col items-start gap-3 rounded-lg border border-border bg-surface p-6 text-foreground",children:[l.jsx("p",{className:"font-semibold text-foreground",children:"Something went wrong rendering this API specification."}),l.jsx("p",{className:"text-sm text-foreground-secondary break-words",children:n.message}),l.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md bg-primary-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600",children:"Try again"})]})}}const Vs=A.createContext(null),Gi=()=>{const e=A.useContext(Vs);if(!e)throw new Error("useDocumentContext must be used within a document provider (AsyncAPIDocumentProvider or OpenAPIDocumentProvider)");return e},Ve=Gi;var ks=(e=>(e.SEND="send",e.RECEIVE="receive",e))(ks||{});const Kp="Contact",Jp="Email",kl="License",Al="External Documentation",Yp="Tags",Zp="Implicit",Xp=`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.`,Qp="Client Credentials",Gp="The Client Credentials grant type is used by clients to obtain an access token outside of the context of a user.",eh="Password",th="The Password grant type is a legacy way to exchange a user's credentials for an access token.",nh="Authorization Code",rh="The Authorization Code grant type is used by confidential and public clients to exchange an authorization code for an access token.",Su="Connecting to a server",sh="",Tl=["text-blue-600","text-indigo-600","text-purple-600","text-pink-600","text-green-700"],oh=[50,100,200,300,500,600,700],ih={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"}},ah=[{location:"path",label:"Path Parameters"},{location:"query",label:"Query Parameters"},{location:"header",label:"Header Parameters"},{location:"cookie",label:"Cookie Parameters"}],lh={get:"bg-blue-100 text-blue-800",post:"bg-green-100 text-green-800",put:"bg-yellow-100 text-yellow-800",patch:"bg-orange-100 text-orange-800",delete:"bg-red-100 text-red-800",options:"bg-neutral-100 text-foreground-secondary",head:"bg-neutral-100 text-foreground-secondary",trace:"bg-neutral-100 text-foreground-secondary",[ks.SEND]:"bg-green-100 text-green-800",[ks.RECEIVE]:"bg-blue-100 text-blue-800"};function ju(e){const t=e.replace("#","").padEnd(6,"0"),n=parseInt(t.slice(0,2),16),r=parseInt(t.slice(2,4),16),s=parseInt(t.slice(4,6),16);return`${n} ${r} ${s}`}function Ro(e,t,n){if(e)for(const r of oh){const s=e[r];s&&(n[`--color-${t}-${r}`]=ju(s))}}const ch=[["background","--color-background"],["surface","--color-surface"],["border","--color-border"],["textPrimary","--color-text-primary"],["textSecondary","--color-text-secondary"],["textMuted","--color-text-muted"]],uh={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 fh(e){const t={},n=e.light?"light":e.dark?"dark":null,r=n==="dark"?e.dark:n==="light"?e.light:void 0;if(n==="dark")for(const[s,o]of Object.entries(uh))t[`--color-neutral-${s}`]=o;if(r)for(const[s,o]of ch){const i=r[s];i&&(t[o]=ju(i))}return e.colors&&(Ro(e.colors.primary,"primary",t),Ro(e.colors.secondary,"secondary",t),Ro(e.colors.neutral,"neutral",t)),t}const dh=e=>typeof e=="object"&&e!==null;function Eu(e,t,n=zn){var g,v,j,y,b;const r=A.useMemo(()=>new Map,[]),[s,o]=A.useState(null),[i,a]=A.useState(null);A.useEffect(()=>{r.clear()},[t,r]);const c=A.useCallback(S=>{if(r.has(S))return r.get(S);const k=S.replace(/^#\//,"").split("/");let w=t;for(const E of k){if(!dh(w)){w=void 0;break}const C=E.replace(/~1/g,"/").replace(/~0/g,"~");if(w=w[C],w==null)break}return w!==void 0&&r.set(S,w),w},[t,r]),u=((g=n.expand)==null?void 0:g.schemas)===!0,f=(j=(v=n.theme)==null?void 0:v.depthColors)!=null&&j.length?n.theme.depthColors:Ji,d=((y=n.show)==null?void 0:y.extensions)!==!1,p=((b=n.show)==null?void 0:b.codeSamples)!==!1,h=A.useMemo(()=>({specType:e,document:t,deref:c,portalHost:s,rootElement:i,defaultSchemaExpanded:u,depthColors:f,showExtensions:d,showCodeSamples:p}),[e,t,c,s,i,u,f,d,p]),m=n.theme?fh(n.theme):{};return{contextValue:h,themeVars:m,setPortalHost:o,setRootElement:a}}function ea({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Eu("asyncapi",e,t);return l.jsx(Vs.Provider,{value:s,children:l.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[l.jsx("div",{ref:i,className:"asyncapi-portal-root"}),r]})})}function Gt({title:e,content:t,sideContent:n,stickySideContent:r=!1,info:s=!1,reverseLayoutOnMobile:o=!1,mobileLeadContent:i}){return l.jsxs("div",{className:"w-full @lg:max-w-[calc(70ch+28rem)] @lg:mx-auto mt-6",children:[i&&l.jsx("div",{className:"@lg:hidden mb-3",children:i}),e&&l.jsx("h1",{className:`${s?"text-4xl inline-block text-3xl font-extrabold text-foreground tracking-tight":"text-2xl"} mb-4 @lg:mb-0 font-bold`,children:e}),l.jsxs("section",{className:`border-border text-lg flex gap-6 @lg:gap-0 ${n&&o?"flex-col-reverse @lg:flex-row":"flex-col @lg:flex-row"}`,children:[l.jsx("div",{className:"@lg:w-prose min-w-0",children:t}),l.jsx("div",{className:"@lg:pl-12 @lg:w-[400px] shrink-0",children:l.jsx("div",{className:`${r&&"@lg:sticky @lg:top-4"}`,children:n})})]})]})}function Cn(...e){return e.filter(Boolean).join(" ")}function Wn({tabs:e,current:t,onChange:n=()=>{},ariaLabel:r="Tabs",selectLabel:s="Select a tab",placeholder:o}){var h;const i=A.useId(),a=A.useRef([]),c=t??(o?"":((h=e[0])==null?void 0:h.id)??""),u=e.some(m=>!!m.icon),f=t?e.findIndex(m=>m.id===t):-1,d=f>=0?f:0,p=(m,g)=>{var y;if(e.length===0)return;const v=b=>(b+e.length)%e.length;let j=g;if(m.key==="ArrowRight"&&(m.preventDefault(),j=v(g+1)),m.key==="ArrowLeft"&&(m.preventDefault(),j=v(g-1)),m.key==="Home"&&(m.preventDefault(),j=0),m.key==="End"&&(m.preventDefault(),j=e.length-1),j!==g){const b=e[j];n(b.id),(y=a.current[j])==null||y.focus()}};return e.length?l.jsxs("div",{children:[l.jsxs("div",{className:"@sm:hidden",children:[l.jsx("label",{htmlFor:i,className:"sr-only",children:s}),l.jsxs("select",{id:i,name:"tabs",value:c,onChange:m=>n(m.target.value),className:Cn("block w-full rounded-md border-neutral-300 bg-neutral-200 focus:border-secondary-500 focus:ring-secondary-500",u?"mt-0":"mt-4"),children:[o&&l.jsx("option",{value:"",children:o}),e.map(m=>l.jsx("option",{value:m.id,children:m.name},m.id))]})]}),l.jsx("div",{className:Cn("hidden @sm:block",u?"":"mt-6"),children:u?l.jsx("div",{className:"border-b border-border",role:"tablist","aria-label":r,children:l.jsx("div",{className:"flex flex-wrap gap-6",children:e.map((m,g)=>{const v=m.id===t,j=m.icon;return l.jsx("button",{ref:y=>{a.current[g]=y},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:y=>p(y,g),className:Cn("cursor-pointer border-b-2 px-1 py-3 text-sm font-semibold transition-colors",v?"border-primary-500 text-primary-600":"border-transparent text-foreground-muted hover:text-foreground"),children:l.jsxs("span",{className:"inline-flex items-center gap-2",children:[j?l.jsx(j,{className:"h-4 w-4 shrink-0"}):null,l.jsx("span",{children:m.name})]})},m.id)})})}):l.jsx("nav",{className:"relative z-0 flex divide-x divide-border rounded-lg shadow",role:"tablist","aria-label":r,children:e.map((m,g)=>{const v=m.id===t;return l.jsxs("button",{ref:j=>{a.current[g]=j},id:`tab-${m.id}`,type:"button",role:"tab",tabIndex:g===d?0:-1,"aria-selected":v,"aria-controls":`panel-${m.id}`,onClick:()=>n(m.id),onKeyDown:j=>p(j,g),className:Cn(v?"text-foreground":"text-foreground-muted hover:text-foreground-secondary",g===0?"rounded-l-lg":"",g===e.length-1?"rounded-r-lg":"","group relative min-w-0 flex-1 cursor-pointer overflow-hidden bg-surface px-4 py-4 text-center text-sm font-medium hover:bg-neutral-50 focus:z-10"),children:[l.jsx("span",{children:m.name}),l.jsx("span",{"aria-hidden":"true",className:Cn(v?"bg-primary-500":"bg-transparent","absolute inset-x-0 bottom-0 h-0.5")})]},m.id)})})})]}):null}function ku({tabs:e,current:t,onChange:n}){if(!e.length)return null;const r=l.jsx("div",{className:"w-full mt-10 @lg:mt-0",children:l.jsx(Wn,{tabs:e,current:t,onChange:n,ariaLabel:"AsyncAPI sections",selectLabel:"Select an AsyncAPI section"})});return l.jsx("div",{className:"sticky top-0 z-10 flex w-full justify-center bg-background",children:l.jsx(Gt,{content:r,stickySideContent:!1})})}function ph(e){if(e.length===0)return l.jsx("span",{children:"No allowed values."});if(e.length===1)return l.jsxs("span",{children:["Allowed value is ",l.jsx("code",{children:e[0]})]});const t=e.slice(0,-1).map((r,s)=>l.jsxs(A.Fragment,{children:[l.jsx("code",{children:r}),", "," "]},s)),n=l.jsx("code",{children:e[e.length-1]},"last");return l.jsxs("span",{children:["Allowed values are ",t," and ",n]})}function hh(e){return e.map(t=>`\`${t}\``).join(", ")}function mh(e){const t=[],n=/\{([^}]+)\}/g;let r=0,s;for(;(s=n.exec(e))!==null;)s.index>r&&t.push({type:"text",value:e.slice(r,s.index)}),t.push({type:"param",value:s[1]}),r=s.index+s[0].length;return r<e.length&&t.push({type:"text",value:e.slice(r)}),t}function Xt({address:e,parameters:t,className:n="text-xs",truncate:r=!1,padded:s=!0}){const{portalHost:o}=Ve(),[i,a]=A.useState(null),[c,u]=A.useState({top:0,left:0,placement:"top"}),[f,d]=A.useState(!1),p=A.useRef(null),h=mh(e);let m=0;const g=40;A.useEffect(()=>{if(!r)return;const S=p.current;if(!S)return;const k=()=>d(S.scrollWidth>S.clientWidth);k();const w=new ResizeObserver(k);return w.observe(S),()=>w.disconnect()},[r,e]);const v=(S,k)=>{const w=k.getBoundingClientRect(),E=w.top<g?"bottom":"top";u({top:E==="top"?w.top-8:w.bottom+8,left:w.left+w.width/2,placement:E}),a(S)},j=()=>a(null),y=h.map((S,k)=>{if(S.type==="text")return l.jsx("span",{children:S.value},k);const w=t==null?void 0:t[S.value],E=Tl[m++%Tl.length],C=i===k,O=!!w&&(w.description||w.type||w.default||w.enum&&w.enum.length>0||w.examples&&w.examples.length>0),T=`channel-address-tooltip-${k}`,P=O&&C?T:void 0;return l.jsxs("span",{className:"inline-block",onMouseEnter:R=>O&&v(k,R.currentTarget),onMouseLeave:j,children:[l.jsx("span",{className:`font-semibold ${E} ${O?"cursor-help underline decoration-dotted":""}`,role:O?"button":void 0,tabIndex:O?0:void 0,"aria-expanded":O?C:void 0,"aria-describedby":P,onFocus:R=>O&&v(k,R.currentTarget),onBlur:j,onKeyDown:R=>{O&&((R.key==="Enter"||R.key===" ")&&(R.preventDefault(),v(k,R.currentTarget)),R.key==="Escape"&&(R.preventDefault(),j(),R.currentTarget.blur()))},children:`{${S.value}}`}),O&&C&&o&&Ar.createPortal(l.jsxs("div",{id:T,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 ${c.placement==="top"?"-translate-y-full":""}`,style:{top:c.top,left:c.left},children:[w.description&&l.jsx("div",{children:w.description}),w.type&&l.jsx("div",{className:"mt-1",children:l.jsx("code",{children:w.type})}),w.default&&l.jsxs("div",{className:"mt-1",children:[l.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Default:"})," ",l.jsx("code",{children:w.default})]}),w.enum&&w.enum.length>0&&l.jsx("div",{className:"mt-1",children:ph(w.enum)}),w.examples&&w.examples.length>0&&l.jsxs("div",{className:"mt-1",children:[l.jsx("span",{className:"font-semibold text-foreground-secondary",children:"Examples:"})," ",w.examples.join(", ")]})]}),o)]},k)}),b=s?"px-2 py-1 ":"";return r?l.jsxs("code",{className:`${b}rounded text-foreground-secondary flex items-center min-w-0 ${n}`,children:[l.jsx("span",{ref:p,className:"overflow-hidden whitespace-nowrap min-w-0",children:y}),f&&l.jsx("span",{"aria-hidden":!0,className:"shrink-0",children:"..."})]}):l.jsx("code",{className:`${b}rounded text-foreground-secondary break-all ${n}`,children:y})}const gh={sm:"px-2.5 py-1 rounded-md text-xs",xs:"px-1.5 py-0.5 rounded text-[10px]"};function Qt({method:e,size:t="sm",className:n=""}){return e?l.jsx("span",{className:`inline-flex items-center justify-center font-medium uppercase ${gh[t]} ${lh[e]} ${n}`,children:e}):null}function Ks(e,t){const[n,r]=A.useState(null);return A.useLayoutEffect(()=>{if(!e||!t){r(null);return}let s=null;const o=()=>{s===null&&(s=requestAnimationFrame(()=>{s=null,r(e.getBoundingClientRect())}))};r(e.getBoundingClientRect());const i=new ResizeObserver(o);return i.observe(e),window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{s!==null&&cancelAnimationFrame(s),i.disconnect(),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[e,t]),n}const Ol=6,yh=12,xh=8,bh=.7;function vh(e,t){if(e===0)return 1/0;const n=e*bh-xh*2,r=t*Ol+Math.max(0,t-1)*yh;return Math.max(1,Math.floor((n-r)/Ol))}function wh(e,t){const n=e.reduce((s,o)=>s+o,0);if(n<=t)return e;if(t<=e.length)return e.map(()=>1);const r=t-e.length;return e.map(s=>Math.min(s,1+Math.floor(s/n*r)))}const Nl=20;function Sh({sections:e,activeSection:t,onTabChange:n,onItemSelect:r,selectedItem:s}){const[o,i]=A.useState(!1),[a,c]=A.useState(!1),u=o||a,{rootElement:f,portalHost:d}=Ve(),p=A.useRef(null),h=A.useRef(null),m=A.useMemo(()=>e.filter(D=>D.items.length>0),[e]),g=A.useMemo(()=>m.filter(D=>D.isTab===!1||D.id===t),[m,t]),v=A.useMemo(()=>m.filter(D=>D.showInPopover!==!1),[m]),[j,y]=A.useState(null),b=A.useRef(null),S=A.useRef(null),k=A.useCallback((D,L)=>{y({section:D,key:L}),b.current={section:D,key:L},S.current&&clearTimeout(S.current),S.current=setTimeout(()=>{b.current=null},600)},[]);A.useEffect(()=>()=>{S.current&&clearTimeout(S.current)},[]),A.useEffect(()=>{const L=e.filter(I=>I.items.length>0).flatMap(I=>I.items.map(Q=>({section:I.id,key:I.itemKey(Q),id:I.targetId(Q)}))).map(I=>({...I,el:document.getElementById(I.id)})).filter(I=>!!I.el);if(L.length===0)return;const re=new Map(L.map(I=>[I.el,I])),te=new Map,me=new IntersectionObserver(I=>{for(const fe of I)fe.isIntersecting?te.set(fe.target,fe.boundingClientRect.top):te.delete(fe.target);if(te.size===0)return;let Q=null,ae=-1/0;for(const[fe,pe]of te)pe>ae&&(Q=fe,ae=pe);const se=Q&&re.get(Q);if(!se)return;const ue=b.current;if(ue){if(se.section!==ue.section||se.key!==ue.key)return;b.current=null}y({section:se.section,key:se.key})},{rootMargin:"-10% 0px -75% 0px",threshold:0});return L.forEach(I=>me.observe(I.el)),()=>me.disconnect()},[e]);const w=(j==null?void 0:j.section)??t,E=j??s,C=Ks(f,!0),O=typeof window>"u"?0:window.innerWidth,T=typeof window>"u"?0:window.innerHeight,P=!!C&&C.bottom>0&&C.top<T,R=!!C&&C.width<1024,U={opacity:P?1:0,pointerEvents:P?"auto":"none",transition:"opacity 0.2s ease"},J={position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+Nl,transform:"translateY(-50%)",zIndex:51,...U},Z=Math.min((C==null?void 0:C.right)??0,O)-60,_={position:"fixed",bottom:16,left:Z,zIndex:51,...U},M=R?{position:"fixed",bottom:68,right:O-(Z+44),zIndex:52}:{position:"fixed",top:"50%",left:((C==null?void 0:C.left)??0)+Nl,transform:"translateY(-50%)",zIndex:52};A.useEffect(()=>{if(!o)return;const D=re=>{re.key==="Escape"&&i(!1)},L=re=>{var me,I;const te=re.target;(me=p.current)!=null&&me.contains(te)||(I=h.current)!=null&&I.contains(te)||i(!1)};return document.addEventListener("keydown",D),document.addEventListener("mousedown",L),()=>{document.removeEventListener("keydown",D),document.removeEventListener("mousedown",L)}},[o]);const K=A.useCallback((D,L)=>{D.isTab!==!1&&n(D.id),L&&setTimeout(()=>{var re;(re=document.getElementById(L))==null||re.scrollIntoView({behavior:"smooth",block:"start"})},50)},[n]),Y=A.useMemo(()=>v.map(D=>{const L=w===D.id,re=(E==null?void 0:E.section)===D.id,te=D.icon;return l.jsxs("div",{className:"pb-1",children:[l.jsxs("button",{onClick:()=>{K(D),k(D.id,""),R&&i(!1)},className:`group flex w-full items-center gap-2 rounded-md px-2 py-2 text-left transition-colors ${L?"bg-primary-50":"hover:bg-neutral-50"}`,children:[l.jsx(te,{className:`h-3.5 w-3.5 shrink-0 transition-colors ${L?"text-primary-500":"text-foreground-muted group-hover:text-foreground-secondary"}`}),l.jsx("span",{className:`text-xs font-semibold uppercase tracking-wider transition-colors ${L?"text-primary-600":"text-foreground-muted group-hover:text-foreground-secondary"}`,children:D.label}),l.jsx("span",{className:`ml-auto inline-flex h-4 min-w-4 shrink-0 items-center justify-center rounded-full px-1 font-mono text-[10px] transition-colors ${L?"border border-primary-200 bg-primary-100 text-primary-500":"bg-neutral-100 text-foreground-muted"}`,children:D.items.length})]}),D.items.length>0&&l.jsx("ul",{className:"ml-4 mt-0.5 border-l border-border pl-3",children:D.items.map(me=>{const I=D.itemKey(me),Q=re&&(E==null?void 0:E.key)===I;return l.jsx("li",{children:l.jsx("button",{onClick:()=>{K(D,D.targetId(me)),r(D.id,I),k(D.id,I),R&&i(!1)},className:`flex w-full items-center gap-2 rounded-md px-2 py-0.5 text-left text-xs transition-colors ${Q?"bg-primary-50 font-medium text-primary-500":L?"text-foreground-secondary hover:bg-primary-50 hover:text-foreground":"text-foreground-muted hover:bg-neutral-50 hover:text-foreground-secondary"}`,children:D.renderItem(me,{isSelected:Q,isSectionActive:L})})},I)})})]},D.id)}),[v,w,E,R,K,r,k]),$=vh(T,g.length),B=A.useMemo(()=>{const D=wh(g.map(L=>L.items.length),$);return g.map((L,re)=>{const te=w===L.id,me=L.items.length,I=D[re];let Q=-1;if((E==null?void 0:E.section)===L.id){const ae=L.items.findIndex(se=>L.itemKey(se)===E.key);ae>=0&&(Q=Math.min(I-1,Math.floor(ae*I/me)))}return l.jsxs("div",{className:"flex flex-col items-start gap-1",children:[l.jsx("span",{className:`block h-[2px] rounded-full transition-all duration-150 ${te?"w-6 bg-foreground-secondary":"w-4 bg-neutral-300 group-hover:bg-neutral-400"}`}),l.jsx("div",{className:"flex flex-col items-start gap-1",children:Array.from({length:I},(ae,se)=>l.jsx("span",{className:`block h-[2px] w-3 rounded-full transition-colors duration-150 ${se===Q?"bg-neutral-500":"bg-neutral-200 group-hover:bg-neutral-300"}`},se))})]},L.id)})},[g,w,E,$]);return l.jsxs(l.Fragment,{children:[!R&&l.jsx("button",{ref:p,onClick:()=>i(D=>!D),onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),title:u?"Close navigation":"Open navigation","aria-label":u?"Close navigation":"Open navigation",className:"group flex flex-col items-start gap-3 p-2",style:J,children:B}),R&&l.jsx("button",{ref:p,onClick:()=>i(D=>!D),title:o?"Close navigation":"Open navigation","aria-label":o?"Close navigation":"Open navigation",className:"flex h-11 w-11 items-center justify-center rounded-full border border-border bg-background shadow-lg",style:_,children:l.jsxs("span",{className:"flex flex-col items-start gap-1",children:[l.jsx("span",{className:"block h-[2px] w-4 rounded-full bg-foreground-secondary"}),l.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-400"}),l.jsx("span",{className:"block h-[2px] w-3 rounded-full bg-neutral-300"})]})}),d&&Ar.createPortal(l.jsx("div",{ref:h,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),className:`max-h-[70vh] w-96 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-border bg-background p-2 shadow-xl transition-all duration-150 ${R?"origin-bottom-right":""} ${u?"opacity-100 scale-100 pointer-events-auto":"opacity-0 scale-95 pointer-events-none"}`,style:M,children:Y}),d)]})}function Au({sections:e,activeTab:t,onTabChange:n,onItemSelect:r,onSelectServer:s,selectedItem:o}){return l.jsx(Sh,{sections:e,activeSection:t,onTabChange:i=>n(i),onItemSelect:(i,a)=>{i!=="info"&&(i==="servers"?s==null||s(a):r==null||r(i,a))},selectedItem:o?{section:o.tab,key:o.key}:null})}function ta({className:e,children:t,...n}){return l.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 jh(e){return l.jsxs(ta,{stroke:"url(#icon-book-open-gradient)",...e,children:[l.jsxs("linearGradient",{id:"icon-book-open-gradient",x2:"1",y2:"1",children:[l.jsx("stop",{offset:"0%",className:"primary-gradient-color-stop"}),l.jsx("stop",{offset:"100%",className:"secondary-gradient-color-stop"})]}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6.253v13m0-13C10.832 5.477 9.246 5 7.5 5S4.168 5.477 3 6.253v13C4.168 18.477 5.754 18 7.5 18s3.332.477 4.5 1.253m0-13C13.168 5.477 14.754 5 16.5 5c1.747 0 3.332.477 4.5 1.253v13C19.832 18.477 18.247 18 16.5 18c-1.746 0-3.332.477-4.5 1.253"})]})}function na({className:e}){return l.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 28 28",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[l.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"}),l.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 Tu(e){return{id:"info",label:"Info",icon:jh,isTab:!1,showInPopover:!1,items:e?["info"]:[],itemKey:()=>"info",targetId:()=>"info-panel",renderItem:()=>l.jsx("span",{className:"truncate",children:"Overview"})}}function Ou(e){return{id:"schemas",label:"Schemas",icon:na,items:Object.keys(e),itemKey:t=>t,targetId:t=>`schema-${t}`,renderItem:t=>l.jsx("span",{className:"truncate",children:t})}}function Nu({className:e}){return l.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:l.jsx("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5.948 1.5H18.052C18.9505 1.49997 19.6997 1.49995 20.2945 1.57991C20.9223 1.66432 21.4891 1.84999 21.9445 2.30546C22.4 2.76093 22.5857 3.32773 22.6701 3.95552C22.7501 4.5503 22.75 5.29953 22.75 6.19801V6.302C22.75 7.20048 22.7501 7.9497 22.6701 8.54448C22.5857 9.17228 22.4 9.73907 21.9445 10.1945C21.4891 10.65 20.9223 10.8357 20.2945 10.9201C19.6997 11.0001 18.9505 11 18.052 11H5.94801C5.04953 11 4.3003 11.0001 3.70552 10.9201C3.07773 10.8357 2.51093 10.65 2.05546 10.1945C1.59999 9.73907 1.41432 9.17228 1.32991 8.54448C1.24995 7.9497 1.24997 7.20048 1.25 6.302V6.198C1.24997 5.29952 1.24995 4.5503 1.32991 3.95552C1.41432 3.32773 1.59999 2.76093 2.05546 2.30546C2.51093 1.84999 3.07773 1.66432 3.70552 1.57991C4.3003 1.49995 5.04952 1.49997 5.948 1.5ZM3.90539 3.06654C3.44393 3.12858 3.24644 3.2358 3.11612 3.36612C2.9858 3.49643 2.87858 3.69393 2.81654 4.15539C2.7516 4.63843 2.75 5.28599 2.75 6.25C2.75 7.21401 2.7516 7.86157 2.81654 8.34461C2.87858 8.80607 2.9858 9.00357 3.11612 9.13388C3.24644 9.2642 3.44393 9.37142 3.90539 9.43347C4.38843 9.49841 5.03599 9.5 6 9.5H18C18.964 9.5 19.6116 9.49841 20.0946 9.43347C20.5561 9.37142 20.7536 9.2642 20.8839 9.13388C21.0142 9.00357 21.1214 8.80607 21.1835 8.34461C21.2484 7.86157 21.25 7.21401 21.25 6.25C21.25 5.28599 21.2484 4.63843 21.1835 4.15539C21.1214 3.69393 21.0142 3.49643 20.8839 3.36612C20.7536 3.2358 20.5561 3.12858 20.0946 3.06654C19.6116 3.00159 18.964 3 18 3H6C5.03599 3 4.38843 3.00159 3.90539 3.06654ZM5.25 6.25C5.25 5.83579 5.58579 5.5 6 5.5H8C8.41422 5.5 8.75 5.83579 8.75 6.25C8.75 6.66422 8.41422 7 8 7H6C5.58579 7 5.25 6.66422 5.25 6.25ZM10.25 6.25C10.25 5.83579 10.5858 5.5 11 5.5H18C18.4142 5.5 18.75 5.83579 18.75 6.25C18.75 6.66422 18.4142 7 18 7H11C10.5858 7 10.25 6.66422 10.25 6.25ZM5.94801 12.5H18.052C18.9505 12.5 19.6997 12.4999 20.2945 12.5799C20.9223 12.6643 21.4891 12.85 21.9445 13.3055C22.4 13.7609 22.5857 14.3277 22.6701 14.9555C22.7501 15.5503 22.75 16.2995 22.75 17.198V17.302C22.75 18.2005 22.7501 18.9497 22.6701 19.5445C22.5857 20.1723 22.4 20.7391 21.9445 21.1945C21.4891 21.65 20.9223 21.8357 20.2945 21.9201C19.6997 22.0001 18.9505 22 18.052 22H5.94801C5.04953 22 4.30031 22.0001 3.70552 21.9201C3.07773 21.8357 2.51093 21.65 2.05546 21.1945C1.59999 20.7391 1.41432 20.1723 1.32991 19.5445C1.24995 18.9497 1.24997 18.2005 1.25 17.302V17.198C1.24997 16.2995 1.24995 15.5503 1.32991 14.9555C1.41432 14.3277 1.59999 13.7609 2.05546 13.3055C2.51093 12.85 3.07773 12.6643 3.70552 12.5799C4.30031 12.4999 5.04953 12.5 5.94801 12.5ZM3.90539 14.0665C3.44393 14.1286 3.24644 14.2358 3.11612 14.3661C2.9858 14.4964 2.87858 14.6939 2.81654 15.1554C2.7516 15.6384 2.75 16.286 2.75 17.25C2.75 18.214 2.7516 18.8616 2.81654 19.3446C2.87858 19.8061 2.9858 20.0036 3.11612 20.1339C3.24644 20.2642 3.44393 20.3714 3.90539 20.4335C4.38843 20.4984 5.03599 20.5 6 20.5H18C18.964 20.5 19.6116 20.4984 20.0946 20.4335C20.5561 20.3714 20.7536 20.2642 20.8839 20.1339C21.0142 20.0036 21.1214 19.8061 21.1835 19.3446C21.2484 18.8616 21.25 18.214 21.25 17.25C21.25 16.286 21.2484 15.6384 21.1835 15.1554C21.1214 14.6939 21.0142 14.4964 20.8839 14.3661C20.7536 14.2358 20.5561 14.1286 20.0946 14.0665C19.6116 14.0016 18.964 14 18 14H6C5.03599 14 4.38843 14.0016 3.90539 14.0665ZM5.25 17.25C5.25 16.8358 5.58579 16.5 6 16.5H8C8.41422 16.5 8.75 16.8358 8.75 17.25C8.75 17.6642 8.41422 18 8 18H6C5.58579 18 5.25 17.6642 5.25 17.25ZM10.25 17.25C10.25 16.8358 10.5858 16.5 11 16.5H18C18.4142 16.5 18.75 16.8358 18.75 17.25C18.75 17.6642 18.4142 18 18 18H11C10.5858 18 10.25 17.6642 10.25 17.25Z",fill:"currentColor"})})}function Js({className:e}){return l.jsx("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:l.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 Cu({className:e}){return l.jsxs("svg",{className:e||"inline-block",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",fill:"currentColor","aria-hidden":"true",children:[l.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"}),l.jsx("path",{d:"M904 224 656.512 506.88a192 192 0 0 1-289.024 0L120 224h784zm-698.944 0 210.56 240.704a128 128 0 0 0 192.704 0L818.944 224H205.056z"})]})}const Gr={};function Eh({operations:e=Gr,messages:t=Gr,schemas:n=Gr,servers:r=Gr,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:c,selectedItem:u,sidebarConfig:f}){const d=A.useMemo(()=>{const p=h=>{var g;return f!=null&&f.useChannelAddressAsIdentifier?((g=e[h])==null?void 0:g.channel)??null:null};return[Tu(s),{id:"servers",label:"Servers",icon:Nu,isTab:!1,items:Object.keys(r),itemKey:h=>h,targetId:h=>`server-${h}`,renderItem:h=>l.jsx("span",{className:"truncate",children:h})},{id:"operations",label:"Operations",icon:Js,items:Object.keys(e),itemKey:h=>h,targetId:h=>`operation-${h}`,renderItem:h=>{var g;const m=p(h);return m!=null&&m.address?l.jsx(Xt,{address:m.address,parameters:m.parameters,truncate:!0,padded:!1,className:"text-xs bg-transparent"}):l.jsxs(l.Fragment,{children:[l.jsx(Qt,{method:(g=e[h])==null?void 0:g.action,size:"xs",className:"shrink-0"}),l.jsx("span",{className:"truncate",children:h})]})}},{id:"messages",label:"Messages",icon:Cu,items:Object.keys(t),itemKey:h=>h,targetId:h=>`message-${h}`,renderItem:h=>l.jsx("span",{className:"truncate",children:h})},Ou(n)]},[e,t,n,r,s,f]);return l.jsx(Au,{sections:d,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:c,selectedItem:u})}const ra=["get","put","post","delete","options","head","patch","trace"],kh=(e,t)=>`${e} ${t}`;function Cl(e,t){const n=new Map;for(const r of(e==null?void 0:e.parameters)??[])n.set(`${r.in}:${r.name}`,r);for(const r of(t==null?void 0:t.parameters)??[])n.set(`${r.in}:${r.name}`,r);return Array.from(n.values())}function As(e){return Object.keys(e).sort().flatMap(t=>{const n=e[t];return n?ra.filter(r=>n[r]).map(r=>({key:kh(r,t),method:r,path:t})):[]})}function sa({className:e}){return l.jsxs("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m7-7H5m10-3l-3 3 3 3m-6-6l3 3-3 3"}),l.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"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 8.873a6 6 0 011 3.127 6 6 0 01-1 3.127M8 8.873a6 6 0 00-1 3.127 6 6 0 001 3.127"})]})}const _l={},Ah={},Th=[];function Oh({paths:e=_l,webhooks:t=_l,schemas:n=Ah,servers:r=Th,hasInfo:s=!0,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:c,selectedItem:u}){const f=A.useMemo(()=>As(e),[e]),d=A.useMemo(()=>As(t),[t]),p=A.useMemo(()=>{const h=r.map((m,g)=>({key:`server-${g}`,url:m}));return[Tu(s),{id:"servers",label:"Servers",icon:Nu,isTab:!1,items:h,itemKey:m=>m.key,targetId:m=>m.key,renderItem:m=>l.jsx("span",{className:"truncate",children:m.url})},{id:"endpoints",label:"Endpoints",icon:Js,items:f,itemKey:m=>m.key,targetId:m=>`endpoint-${m.key}`,renderItem:m=>l.jsxs(l.Fragment,{children:[l.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),l.jsx(Xt,{address:m.path,className:"text-[10px] bg-transparent p-0"})]})},{id:"webhooks",label:"Webhooks",icon:sa,items:d,itemKey:m=>m.key,targetId:m=>`webhook-${m.key}`,renderItem:m=>l.jsxs(l.Fragment,{children:[l.jsx(Qt,{method:m.method,size:"xs",className:"shrink-0"}),l.jsx("span",{className:"truncate",children:m.path})]})},Ou(n)]},[f,d,n,r,s]);return l.jsx(Au,{sections:p,activeTab:o,onTabChange:i,onItemSelect:a,onSelectServer:c,selectedItem:u})}const Nh=e=>l.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:[l.jsx("circle",{cx:"7",cy:"7",r:"5"}),l.jsx("path",{d:"M14 14l-3.5-3.5"})]});function _u(e,t){const[n,r]=A.useState("docked"),s=A.useRef(t);return s.current=t,A.useEffect(()=>{if(!e)return;let o=null,i=null;const a=()=>{i=null;const u=e.getBoundingClientRect().top,f=o===null?0:u-o;o=u,u>=0?r("docked"):s.current||f>0?r("pinned"):f<0?r("hidden"):r(d=>d==="docked"?"hidden":d)},c=()=>{i===null&&(i=requestAnimationFrame(a))};return a(),window.addEventListener("scroll",c,!0),window.addEventListener("resize",c),()=>{i!==null&&cancelAnimationFrame(i),window.removeEventListener("scroll",c,!0),window.removeEventListener("resize",c)}},[e]),A.useEffect(()=>{t&&r(o=>o==="hidden"?"pinned":o)},[t]),n}function Ch(e){const t=getComputedStyle(e).overflowY;return(t==="auto"||t==="scroll")&&e.scrollHeight>e.clientHeight}function Ru(e){let t=e;for(;t&&t!==document.body;){if(Ch(t))return t;t=t.parentElement}return document.documentElement}function Iu(e){const t=e.style.overflow,n=e.style.paddingRight,r=e.offsetWidth-e.clientWidth;if(e.style.overflow="hidden",r>0){const s=parseFloat(getComputedStyle(e).paddingRight)||0;e.style.paddingRight=`${s+r}px`}return()=>{e.style.overflow=t,e.style.paddingRight=n}}const Rl=12;function Pu({query:e,onQueryChange:t,results:n,onSelectResult:r}){const s=A.useRef(null),o=A.useRef(null),[i,a]=A.useState(!1),[c,u]=A.useState(-1),f="asyncapi-search-results",{portalHost:d,rootElement:p}=Ve(),h=_u(p,i),m=h!=="docked",g=Ks(p,m),v={left:m?((g==null?void 0:g.left)??0)+Rl:Rl,transform:`translateY(${h==="hidden"?"-150%":"0px"})`,zIndex:40,...m?{position:"fixed",top:10,pointerEvents:h==="hidden"?"none":void 0}:{}},j=()=>{a(!1),u(-1)},y=A.useRef(!1),b=A.useRef(!1);A.useEffect(()=>{if(!p)return;const T=()=>{y.current=!0},P=()=>{y.current=!1};return p.addEventListener("mouseenter",T),p.addEventListener("mouseleave",P),()=>{p.removeEventListener("mouseenter",T),p.removeEventListener("mouseleave",P)}},[p]),A.useEffect(()=>{if(!p)return;const T=P=>{b.current=p.contains(P.target)};return document.addEventListener("mousedown",T,!0),()=>document.removeEventListener("mousedown",T,!0)},[p]),A.useEffect(()=>{if(!p)return;const T=P=>{!(P.metaKey||P.ctrlKey)||P.key.toLowerCase()!=="k"||!(p.contains(document.activeElement)||y.current||b.current)||(P.preventDefault(),a(!0))};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[p]),A.useEffect(()=>{if(!i)return;const T=requestAnimationFrame(()=>{var P;return(P=o.current)==null?void 0:P.focus()});return()=>cancelAnimationFrame(T)},[i]),A.useEffect(()=>{if(!(!i||!d))return Iu(Ru(d))},[i,d]),A.useEffect(()=>{if(!i)return;const T=P=>{P.key==="Escape"&&j()};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[i]),A.useEffect(()=>{if(!i)return;const T=P=>{s.current&&!s.current.contains(P.target)&&j()};return document.addEventListener("mousedown",T),()=>document.removeEventListener("mousedown",T)},[i]),A.useEffect(()=>{c>=n.length&&u(n.length-1)},[c,n.length]);const S=i&&e.trim().length>0,k=T=>{j(),r(T)},w=T=>{if(T.key==="Escape"){T.preventDefault(),j();return}if(S){if(T.key==="ArrowDown"){T.preventDefault(),u(P=>n.length===0?-1:Math.min(P+1,n.length-1));return}if(T.key==="ArrowUp"){T.preventDefault(),u(P=>n.length===0?-1:P<=0?n.length-1:P-1);return}if(T.key==="Home"){T.preventDefault(),n.length>0&&u(0);return}if(T.key==="End"){T.preventDefault(),n.length>0&&u(n.length-1);return}if(T.key==="Enter"&&c>=0&&n[c]){T.preventDefault(),k(n[c]);return}}},E=T=>`asyncapi-search-result-${T}`,C=S?`${n.length} result${n.length===1?"":"s"} found`:"",O=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.userAgent);return l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>a(!0),title:"Search","aria-label":"Search",className:"panel-toggle-btn bg-neutral-100",style:v,children:l.jsx(Nh,{})}),i&&d&&Ar.createPortal(l.jsxs("div",{className:"fixed inset-0 z-[60] flex justify-center px-4 pt-24",children:[l.jsx("div",{className:"absolute inset-0 bg-black/30"}),l.jsxs("div",{ref:s,className:"relative h-fit w-full max-w-[36rem] overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[l.jsx("div",{className:"p-4",children:l.jsx("input",{ref:o,id:"asyncapi-search",type:"search",value:e,onChange:T=>t(T.target.value),onKeyDown:w,placeholder:"Search document...","aria-label":"Search document",role:"combobox","aria-haspopup":"listbox","aria-expanded":S,"aria-controls":f,"aria-autocomplete":"list","aria-activedescendant":c>=0?E(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"})}),l.jsx("div",{"aria-live":"polite",className:"sr-only",children:C}),S&&l.jsx("div",{id:f,role:"listbox",className:"max-h-80 overflow-y-auto",children:n.length>0?l.jsx("ul",{className:"divide-y divide-border",children:n.map((T,P)=>l.jsx("li",{children:l.jsxs("button",{id:E(P),type:"button",role:"option","aria-selected":c===P,onClick:()=>k(T),className:"w-full text-left px-4 py-3 hover:bg-neutral-50 "+(c===P?"bg-neutral-100":""),children:[l.jsx("div",{className:"text-sm font-semibold text-foreground",children:T.name}),l.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-foreground-muted",children:[l.jsx("span",{children:T.location}),T.subtitle&&l.jsxs("span",{children:["• ",T.subtitle]})]})]})},T.id))}):l.jsx("div",{className:"px-4 py-4 text-sm text-foreground-muted",children:"No results found."})}),l.jsxs("div",{className:"flex items-center justify-center gap-1 px-4 py-1.5 text-xs text-foreground-muted",children:["Press",l.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:O?"⌘ Cmd":"Ctrl"}),l.jsx("kbd",{className:"rounded border border-border bg-neutral-50 px-1 font-mono text-[10px]",children:"K"}),"to search"]})]})]}),d)]})}function oa({className:e}){return l.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),l.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})}function ia({className:e}){return l.jsx("svg",{className:e||"inline-block",fill:"currentColor",viewBox:"0 0 20 20",children:l.jsx("path",{d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"})})}function Ys({className:e}){return l.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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 Or({className:e}){return l.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:l.jsx("polygon",{points:"47.25,15 45.164,12.914 25,33.078 4.836,12.914 2.75,15 25,37.25 "})})}function $u({serialize:e,leftOffset:t}){const[n,r]=A.useState(!1),[s,o]=A.useState(!1),i=A.useRef(null),a=A.useRef(void 0),{portalHost:c,rootElement:u,deref:f}=Ve(),d=()=>e(f),p=_u(u,n),h=p!=="docked",m=Ks(u,h),g={left:h?((m==null?void 0:m.left)??0)+t:t,transform:`translateY(${p==="hidden"?"-150%":"0px"})`,zIndex:40,...h?{position:"fixed",top:10,pointerEvents:p==="hidden"?"none":void 0}:{}};A.useEffect(()=>()=>{a.current&&clearTimeout(a.current)},[]),A.useEffect(()=>{if(!n)return;const y=b=>{b.key==="Escape"&&r(!1)};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[n]),A.useEffect(()=>{if(!n)return;const y=b=>{i.current&&!i.current.contains(b.target)&&r(!1)};return document.addEventListener("mousedown",y),()=>document.removeEventListener("mousedown",y)},[n]);const v=async()=>{const y=d();console.log("[MarkdownExportMenu] Copy for LLM clicked",{markdownLength:y.length,hasClipboardApi:!!navigator.clipboard,isSecureContext:window.isSecureContext});try{if(!navigator.clipboard)throw new Error("navigator.clipboard is unavailable (requires a secure context: https or localhost)");await navigator.clipboard.writeText(y),console.log("[MarkdownExportMenu] clipboard.writeText succeeded"),o(!0),a.current&&clearTimeout(a.current),a.current=setTimeout(()=>o(!1),2e3)}catch(b){console.error("[MarkdownExportMenu] Copy for LLM failed:",b)}r(!1)},j=()=>{const y=d(),b=new Blob([y],{type:"text/markdown"}),S=URL.createObjectURL(b);console.log("[MarkdownExportMenu] View as Markdown clicked",{markdownLength:y.length,blobUrl:S}),window.open(S,"_blank")||console.error("[MarkdownExportMenu] window.open returned null — the popup was likely blocked by the browser's popup blocker."),setTimeout(()=>URL.revokeObjectURL(S),3e4),r(!1)};return l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",onClick:()=>r(y=>!y),title:"Copy as Markdown","aria-label":"Copy as Markdown","aria-haspopup":"menu","aria-expanded":n,className:"panel-toggle-btn panel-toggle-btn--labeled bg-neutral-100 hover:bg-neutral-200",style:g,children:[s?l.jsx(ia,{className:"w-4 h-4 shrink-0 text-green-600"}):l.jsx(oa,{className:"w-4 h-4 shrink-0"}),l.jsx("span",{children:s?"Copied!":"Copy as Markdown"}),l.jsx(Or,{className:`w-3 h-3 shrink-0 transition-transform duration-200 ${n?"rotate-180":""}`})]}),n&&c&&Ar.createPortal(l.jsxs("div",{ref:i,role:"menu",style:{position:h?"fixed":"absolute",top:54,left:g.left,zIndex:41},className:"w-56 overflow-hidden rounded-lg border border-border bg-surface shadow-xl",children:[l.jsxs("button",{type:"button",role:"menuitem",onClick:v,className:"flex w-full flex-col items-start gap-0.5 px-3 py-2 text-left hover:bg-neutral-100",children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:s?"Copied!":"Copy for LLM"}),l.jsx("span",{className:"text-xs text-foreground-muted",children:"Copy page as Markdown"})]}),l.jsxs("button",{type:"button",role:"menuitem",onClick:j,className:"flex w-full items-start justify-between gap-2 px-3 py-2 text-left hover:bg-neutral-100 border-t border-border",children:[l.jsxs("span",{className:"flex flex-col items-start gap-0.5",children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:"View as Markdown"}),l.jsx("span",{className:"text-xs text-foreground-muted",children:"Open this page as Markdown"})]}),l.jsx(Ys,{className:"w-3.5 h-3.5 mt-0.5 shrink-0 text-foreground-muted"})]})]}),c)]})}const Dt=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),ps=(e,t=new Set)=>e==null?"":typeof e=="string"||typeof e=="number"||typeof e=="boolean"?String(e):Array.isArray(e)?e.map(n=>ps(n,t)).join(" "):e instanceof Map?Array.from(e.entries()).flatMap(([n,r])=>[n,ps(r,t)]).join(" "):Dt(e)?t.has(e)?"":(t.add(e),Object.entries(e).flatMap(([n,r])=>[n,ps(r,t)]).join(" ")):"",st=e=>ps(e).trim().replace(/\s+/g," "),_h=(e,t)=>t.length?`schema-${e}-${t.join("-")}`:`schema-${e}`,Rh=new Set(["properties","items","allOf","oneOf","anyOf","additionalProperties","patternProperties","propertyNames","not","if","then","else","contains","additionalItems","prefixItems","definitions","$defs"]),Ih=e=>{if(!Dt(e))return e;const t={};for(const[n,r]of Object.entries(e))Rh.has(n)||(t[n]=r);return t},Mu=(e,t,n,r)=>{const s=`schema-${n}`,o=(a,c,u,f)=>{const d=`components.schemas.${n}${c.length?`.${c.join(".")}`:""}`,p=`Schemas > ${r}${u.length?` > ${u.join(" > ")}`:""}`,h=Dt(a)?a.description:void 0,m=c.length?`${r}.${c.join(".")}`:r;e.push({id:`schema-${n}-${c.join("-")||"root"}`,targetId:f?_h(n,f):s,type:"schema",tab:"schemas",key:n,name:m,path:d,location:p,subtitle:h,text:st([Ih(a)]),schemaFocusTokens:f&&f.length>0?f:void 0})},i=(a,c=[],u=[],f=[],d=new Set)=>{if(o(a,c,u,f),!Dt(a)||d.has(a))return;if(d.add(a),Dt(a.properties))for(const[h,m]of Object.entries(a.properties))i(m,[...c,"properties",h],[...u,h],f?[...f,"properties",h]:null,d);const p=a.items;Dt(p)?i(p,[...c,"items"],[...u,"items"],f?[...f,"items"]:null,d):Array.isArray(p)&&p.forEach((h,m)=>{i(h,[...c,`items[${m}]`],[...u,`items[${m}]`],null,d)});for(const h of["allOf","oneOf","anyOf"]){const m=a[h];Array.isArray(m)&&m.forEach((g,v)=>{i(g,[...c,`${h}[${v}]`],[...u,`${h}[${v}]`],f&&h!=="allOf"?[...f,`${h}[${v}]`]:null,d)})}Dt(a.additionalProperties)&&i(a.additionalProperties,[...c,"additionalProperties"],[...u,"additionalProperties"],null,d)};i(t)};function Ph(e){var n,r;const t=[];if(e.info){const s=e.info.title??"Info",o=e.info.description??void 0;t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:o,text:st([e.info,e.info.title,e.info.description,e.info.license,e.info.externalDocs,e.info.contact,e.info.tags])})}if(e.servers)for(const[s,o]of Object.entries(e.servers)){const i=o,a=i.description??s,c=[i.protocol,i.host].filter(Boolean).join(" ");t.push({id:`server-${s}`,targetId:`server-${s}`,type:"server",tab:"servers",key:s,name:s,path:`servers.${s}`,location:`Servers > ${s}`,subtitle:c,text:st([s,a,c,i.description,i.protocol,i.host,i.variables,i.security,i.bindings])});const u=i.security;Array.isArray(u)&&u.length>0&&t.push({id:`server-${s}-security`,targetId:`server-${s}-security`,type:"server",tab:"servers",key:s,name:`${s} > Authorization`,path:`servers.${s}.security`,location:`Servers > ${s} > Authorization`,focusSection:"security",text:st(u)});const f=i.bindings,d=Dt(f)&&i.protocol?f[i.protocol]:void 0;d!=null&&t.push({id:`server-${s}-bindings`,targetId:`server-${s}-bindings`,type:"server",tab:"servers",key:s,name:`${s} > ${i.protocol} configuration`,path:`servers.${s}.bindings.${i.protocol}`,location:`Servers > ${s} > ${i.protocol} configuration`,focusSection:`binding:${i.protocol}`,text:st(d)})}if(e.operations)for(const[s,o]of Object.entries(e.operations)){const i=o.title??s,a=o.summary??o.description??o.action??"";t.push({id:`operation-${s}`,targetId:`operation-${s}-detail`,type:"operation",tab:"operations",key:s,name:i,path:`operations.${s}`,location:`Operations > ${i}`,subtitle:a,text:st([s,i,a,o.action,o.channel,o.messages,o.reply,o.traits,o.bindings,o.security,o.tags])});const c=o.security;Array.isArray(c)&&c.length>0&&t.push({id:`operation-${s}-security`,targetId:`operation-${s}-security`,type:"operation",tab:"operations",key:s,name:`${i} > Authorization`,path:`operations.${s}.security`,location:`Operations > ${i} > Authorization`,focusSection:"security",text:st(c)});const u=o.bindings;if(Dt(u))for(const[f,d]of Object.entries(u))d!=null&&t.push({id:`operation-${s}-bindings-${f}`,targetId:`operation-${s}-bindings-${f}`,type:"operation",tab:"operations",key:s,name:`${i} > ${f} configuration`,path:`operations.${s}.bindings.${f}`,location:`Operations > ${i} > ${f} configuration`,focusSection:`binding:${f}`,text:st(d)})}if((n=e.components)!=null&&n.messages)for(const[s,o]of Object.entries(e.components.messages)){const i=o.title??o.name??s,a=o.summary??o.description??o.contentType??"";t.push({id:`message-${s}`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:i,path:`components.messages.${s}`,location:`Messages > ${i}`,subtitle:a,text:st([s,i,a,o.contentType,o.payload,o.headers,o.correlationId,o.tags,o.externalDocs,o.bindings])}),o.payload&&t.push({id:`message-${s}-payload`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Payload`,path:`components.messages.${s}.payload`,location:`Messages > ${i} > Payload`,focusSection:"payload",text:st(o.payload)}),o.headers&&t.push({id:`message-${s}-headers`,targetId:`message-${s}`,type:"message",tab:"messages",key:s,name:`${i} > Headers`,path:`components.messages.${s}.headers`,location:`Messages > ${i} > Headers`,focusSection:"headers",text:st(o.headers)})}if((r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Mu(t,o,s,s);return t}function en(e){return Array.isArray?Array.isArray(e):Du(e)==="[object Array]"}function $h(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 di(e){return e==null?"":$h(e)}function Ye(e){return typeof e=="string"}function hs(e){return typeof e=="number"}function Mh(e){return e===!0||e===!1||Lh(e)&&Du(e)=="[object Boolean]"}function Lu(e){return typeof e=="object"}function Lh(e){return Lu(e)&&e!==null}function ct(e){return e!=null}function es(e){return!e.trim().length}function Du(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}const Dh="Incorrect 'index' type",pi="Invalid doc index: must be a non-negative integer within the bounds of the docs array",Bh=e=>`Invalid value for key ${e}`,Fh=e=>`Pattern length exceeds max of ${e}.`,Uh=e=>`Missing ${e} property in key`,Hh=e=>`Property 'weight' in key '${e}' must be a positive integer`,qh="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.",Il=Object.prototype.hasOwnProperty;var zh=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(n=>{const r=Bu(n);this._keys.push(r),this._keyMap[r.id]=r,t+=r.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 Bu(e){let t=null,n=null,r=null,s=1,o=null;if(Ye(e)||en(e))r=e,t=Pl(e),n=ms(e);else{if(!Il.call(e,"name"))throw new Error(Uh("name"));const i=e.name;if(r=i,Il.call(e,"weight")&&e.weight!==void 0&&(s=e.weight,s<=0))throw new Error(Hh(ms(i)));t=Pl(i),n=ms(i),o=e.getFn??null}return{path:t,id:n,weight:s,src:r,getFn:o}}function Pl(e){return en(e)?e:e.split(".")}function ms(e){return en(e)?e.join("."):e}function Wh(e,t){const n=[];let r=!1;const s=(o,i,a,c)=>{if(ct(o))if(!i[a])n.push(c!==void 0?{v:o,i:c}:o);else{const u=o[i[a]];if(!ct(u))return;if(a===i.length-1&&(Ye(u)||hs(u)||Mh(u)||typeof u=="bigint"))n.push(c!==void 0?{v:di(u),i:c}:di(u));else if(en(u)){r=!0;for(let f=0,d=u.length;f<d;f+=1)s(u[f],i,a+1,f)}else i.length&&s(u,i,a+1,c)}};return s(e,Ye(t)?t.split("."):t,0),r?n:n[0]}const Vh={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Kh={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},Jh={location:0,threshold:.6,distance:100},Yh={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:"any",getFn:Wh,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},ie=Object.freeze({...Kh,...Vh,...Jh,...Yh});function Zh(e){return e>=9&&e<=13||e===32||e===160}function Xh(e=1,t=3){const n=new Map,r=Math.pow(10,t);return{get(s){let o=0,i=!1;for(let c=0;c<s.length;c++)Zh(s.charCodeAt(c))?i=!1:i||(o++,i=!0);if(o===0&&(o=1),n.has(o))return n.get(o);const a=Math.round(r/Math.pow(o,.5*e))/r;return n.set(o,a),a},clear(){n.clear()}}}var aa=class{constructor({getFn:e=ie.getFn,fieldNormWeight:t=ie.fieldNormWeight}={}){this.norm=Xh(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(Ye(this.docs[0]))for(let n=0;n<e;n++){const r=this._createStringRecord(this.docs[n],n);r&&(this.records[t++]=r)}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(pi);if(Ye(e)){const r=this._createStringRecord(e,t);return r&&this.records.push(r),r}const n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw new Error(pi);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 r of e)Number.isInteger(r)&&r>=0&&t.add(r);if(t.size===0)return;this.records=this.records.filter(r=>!t.has(r.i));const n=Array.from(t).sort((r,s)=>r-s);for(const r of this.records){let s=0,o=n.length;for(;s<o;){const i=s+o>>>1;n[i]<r.i?s=i+1:o=i}r.i-=s}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ct(e)||es(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){const n={i:t,$:{}};for(let r=0,s=this.keys.length;r<s;r++){const o=this.keys[r],i=o.getFn?o.getFn(e):this.getFn(e,o.path);if(ct(i)){if(en(i)){const a=[];for(let c=0,u=i.length;c<u;c+=1){const f=i[c];if(ct(f)){if(Ye(f)){if(!es(f)){const d={v:f,i:c,n:this.norm.get(f)};a.push(d)}}else if(ct(f.v)){const d=Ye(f.v)?f.v:di(f.v);if(!es(d)){const p={v:d,i:f.i,n:this.norm.get(d)};a.push(p)}}}}n.$[r]=a}else if(Ye(i)&&!es(i)){const a={v:i,n:this.norm.get(i)};n.$[r]=a}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function Fu(e,t,{getFn:n=ie.getFn,fieldNormWeight:r=ie.fieldNormWeight}={}){const s=new aa({getFn:n,fieldNormWeight:r});return s.setKeys(e.map(Bu)),s.setSources(t),s.create(),s}function Qh(e,{getFn:t=ie.getFn,fieldNormWeight:n=ie.fieldNormWeight}={}){const{keys:r,records:s}=e,o=new aa({getFn:t,fieldNormWeight:n});return o.setKeys(r),o.setIndexRecords(s),o}function Gh(e=[],t=ie.minMatchCharLength){const n=[];let r=-1,s=-1,o=0;for(let i=e.length;o<i;o+=1){const a=e[o];a&&r===-1?r=o:!a&&r!==-1&&(s=o-1,s-r+1>=t&&n.push([r,s]),r=-1)}return e[o-1]&&o-r>=t&&n.push([r,o-1]),n}function em(e,t,n,{location:r=ie.location,distance:s=ie.distance,threshold:o=ie.threshold,findAllMatches:i=ie.findAllMatches,minMatchCharLength:a=ie.minMatchCharLength,includeMatches:c=ie.includeMatches,ignoreLocation:u=ie.ignoreLocation}={}){if(t.length>32)throw new Error(Fh(32));const f=t.length,d=e.length,p=Math.max(0,Math.min(r,d));let h=o,m=p;const g=(O,T)=>{const P=O/f;if(u)return P;const R=Math.abs(p-T);return s?P+R/s:R?1:P},v=a>1||c,j=v?Array(d):[];let y;for(;(y=e.indexOf(t,m))>-1;){const O=g(0,y);if(h=Math.min(O,h),m=y+f,v){let T=0;for(;T<f;)j[y+T]=1,T+=1}}m=-1;let b=[],S=1,k=0,w=f+d;const E=1<<f-1;for(let O=0;O<f;O+=1){let T=0,P=w;for(;T<P;)g(O,p+P)<=h?T=P:w=P,P=Math.floor((w-T)/2+T);w=P;let R=Math.max(1,p-P+1);const U=i?d:Math.min(p+P,d)+f,J=Array(U+2);J[U+1]=(1<<O)-1;for(let Z=U;Z>=R;Z-=1){const _=Z-1,M=n[e[_]];if(J[Z]=(J[Z+1]<<1|1)&M,O&&(J[Z]|=(b[Z+1]|b[Z])<<1|1|b[Z+1]),J[Z]&E&&(S=g(O,_),S<=h)){if(h=S,m=_,k=O,m<=p)break;R=Math.max(1,2*p-m)}}if(g(O+1,p)>h)break;b=J}if(v&&m>=0){const O=Math.min(d-1,m+f-1+k);for(let T=m;T<=O;T+=1)n[e[T]]&&(j[T]=1)}const C={isMatch:m>=0,score:Math.max(.001,S)};if(v){const O=Gh(j,a);O.length?c&&(C.indices=O):C.isMatch=!1}return C}function tm(e){const t={};for(let n=0,r=e.length;n<r;n+=1){const s=e.charAt(n);t[s]=(t[s]||0)|1<<r-n-1}return t}function la(e){if(e.length<=1)return e;e.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){const s=t[t.length-1],o=e[n];o[0]<=s[1]+1?s[1]=Math.max(s[1],o[1]):t.push(o)}return t}const Uu={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},nm=new RegExp("["+Object.keys(Uu).join("")+"]","g"),yr=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(nm,t=>Uu[t]):e=>e;var ca=class{constructor(e,{location:t=ie.location,threshold:n=ie.threshold,distance:r=ie.distance,includeMatches:s=ie.includeMatches,findAllMatches:o=ie.findAllMatches,minMatchCharLength:i=ie.minMatchCharLength,isCaseSensitive:a=ie.isCaseSensitive,ignoreDiacritics:c=ie.ignoreDiacritics,ignoreLocation:u=ie.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:s,findAllMatches:o,minMatchCharLength:i,isCaseSensitive:a,ignoreDiacritics:c,ignoreLocation:u},e=a?e:e.toLowerCase(),e=c?yr(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const f=(p,h)=>{this.chunks.push({pattern:p,alphabet:tm(p),startIndex:h})},d=this.pattern.length;if(d>32){let p=0;const h=d%32,m=d-h;for(;p<m;)f(this.pattern.substr(p,32),p),p+=32;if(h){const g=d-32;f(this.pattern.substr(g),g)}}else f(this.pattern,0)}searchIn(e){const{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};const m={isMatch:!0,score:0};return r&&(m.indices=[[0,e.length-1]]),m}const{location:s,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:c,ignoreLocation:u}=this.options,f=[];let d=0,p=!1;this.chunks.forEach(({pattern:m,alphabet:g,startIndex:v})=>{const{isMatch:j,score:y,indices:b}=em(e,m,g,{location:s+v,distance:o,threshold:i,findAllMatches:a,minMatchCharLength:c,includeMatches:r,ignoreLocation:u});j&&(p=!0),d+=y,j&&b&&f.push(...b)});const h={isMatch:p,score:p?d/this.chunks.length:1};return p&&r&&(h.indices=la(f)),h}};const rm=new Set(["fuzzy","include"]);function sm(e){return e.startsWith("inverse")}const hi=[{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,r;const s=[],o=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+o,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}})},{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 ca(e,{location:t.location??ie.location,threshold:t.threshold??ie.threshold,distance:t.distance??ie.distance,includeMatches:t.includeMatches??ie.includeMatches,findAllMatches:t.findAllMatches??ie.findAllMatches,minMatchCharLength:t.minMatchCharLength??ie.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??ie.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??ie.ignoreDiacritics,ignoreLocation:t.ignoreLocation??ie.ignoreLocation});return{type:"fuzzy",search(r){return n.searchIn(r)}}}}],$l=hi.length,om="\0",im="|";function am(e){const t=[],n=e.length;let r=0;for(;r<n;){for(;r<n&&e[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&e[s]!==" "&&e[s]!=='"';)s++;if(s<n&&e[s]==='"'){for(s++;s<n;){if(e[s]==='"'){const o=s+1;if(o>=n||e[o]===" "){s++;break}if(e[o]==="$"&&(o+1>=n||e[o+1]===" ")){s+=2;break}}s++}t.push(e.substring(r,s)),r=s}else{for(;s<n&&e[s]!==" ";)s++;t.push(e.substring(r,s)),r=s}}return t}function Ml(e,t){const n=e.match(t);return n?n[1]:null}function lm(e,t={}){return e.replace(/\\\|/g,om).split(im).map(n=>{const r=am(n.replace(/\u0000/g,"|").trim()).filter(o=>o&&!!o.trim()),s=[];for(let o=0,i=r.length;o<i;o+=1){const a=r[o];let c=!1,u=-1;for(;!c&&++u<$l;){const f=hi[u],d=Ml(a,f.multiRegex);d&&(s.push(f.create(d,t)),c=!0)}if(!c)for(u=-1;++u<$l;){const f=hi[u],d=Ml(a,f.singleRegex);if(d){s.push(f.create(d,t));break}}}return s})}var cm=class{constructor(e,{isCaseSensitive:t=ie.isCaseSensitive,ignoreDiacritics:n=ie.ignoreDiacritics,includeMatches:r=ie.includeMatches,minMatchCharLength:s=ie.minMatchCharLength,ignoreLocation:o=ie.ignoreLocation,findAllMatches:i=ie.findAllMatches,location:a=ie.location,threshold:c=ie.threshold,distance:u=ie.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:s,findAllMatches:i,ignoreLocation:o,location:a,threshold:c,distance:u},e=t?e:e.toLowerCase(),e=n?yr(e):e,this.pattern=e,this.query=lm(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:r,ignoreDiacritics:s}=this.options;e=r?e:e.toLowerCase(),e=s?yr(e):e;let o=0;const i=[];let a=0,c=!1;for(let u=0,f=t.length;u<f;u+=1){const d=t[u];i.length=0,o=0,c=!1;for(let p=0,h=d.length;p<h;p+=1){const m=d[p],{isMatch:g,indices:v,score:j}=m.search(e);if(g)o+=1,a+=j,sm(m.type)&&(c=!0),n&&(rm.has(m.type)?i.push(...v):i.push(v));else{a=0,o=0,i.length=0,c=!1;break}}if(o){const p={isMatch:!0,score:a/o};return c&&(p.hasInverse=!0),n&&(p.indices=la(i)),p}}return{isMatch:!1,score:1}}};const mi=[];function ua(...e){mi.push(...e)}function Ts(e,t){for(let n=0,r=mi.length;n<r;n+=1){const s=mi[n];if(s.condition(e,t))return new s(e,t)}return new ca(e,t)}const Os={AND:"$and",OR:"$or"},gi={PATH:"$path",PATTERN:"$val"},yi=e=>!!(e[Os.AND]||e[Os.OR]),um=e=>!!e[gi.PATH],fm=e=>!en(e)&&Lu(e)&&!yi(e),Ll=e=>({[Os.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function Hu(e,t,{auto:n=!0}={}){const r=s=>{if(Ye(s)){const c={keyId:null,pattern:s};return n&&(c.searcher=Ts(s,t)),c}const o=Object.keys(s),i=um(s);if(!i&&o.length>1&&!yi(s))return r(Ll(s));if(fm(s)){const c=i?s[gi.PATH]:o[0],u=i?s[gi.PATTERN]:s[c];if(!Ye(u))throw new Error(Bh(c));const f={keyId:ms(c),pattern:u};return n&&(f.searcher=Ts(u,t)),f}const a={children:[],operator:o[0]};return o.forEach(c=>{const u=s[c];en(u)&&u.forEach(f=>{a.children.push(r(f))})}),a};return yi(e)||(e=Ll(e)),r(e)}function xi(e,{ignoreFieldNorm:t=ie.ignoreFieldNorm}){let n=1;return e.forEach(({key:r,norm:s,score:o})=>{const i=r?r.weight:null;n*=Math.pow(o===0&&i?Number.EPSILON:o,(i||1)*(t?1:s))}),n}function dm(e,{ignoreFieldNorm:t=ie.ignoreFieldNorm}){e.forEach(n=>{n.score=xi(n.matches,{ignoreFieldNorm:t})})}var pm=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 r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){const t=this.heap,n=t.length;let r=e;do{e=r;const s=2*e+1,o=2*e+2;if(s<n&&this.comparator(t[s],t[r])>0&&(r=s),o<n&&this.comparator(t[o],t[r])>0&&(r=o),r!==e){const i=t[e];t[e]=t[r],t[r]=i}}while(r!==e)}};function hm(e){const t=[];return e.matches.forEach(n=>{if(!ct(n.indices)||!n.indices.length)return;const r={indices:n.indices,value:n.value};n.key&&(r.key=n.key.id),n.idx>-1&&(r.refIndex=n.idx),t.push(r)}),t}function mm(e,t,{includeMatches:n=ie.includeMatches,includeScore:r=ie.includeScore}={}){return e.map(s=>{const{idx:o}=s,i={item:t[o],refIndex:o};return n&&(i.matches=hm(s)),r&&(i.score=s.score),i})}const gm=/[\p{L}\p{M}\p{N}_]+/gu,Dl=new WeakSet;function ym(e){Dl.has(e)||(Dl.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 xm(e){if(typeof e=="function"){let t=!1;return n=>{const r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(s=>typeof s!="string")))throw new Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?"array containing non-strings":typeof r}.`);return r}}return e instanceof RegExp?(e.global||ym(e),t=>t.match(e)||[]):t=>t.match(gm)||[]}function bi({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){const r=xm(n);return{tokenize(s){return e||(s=s.toLowerCase()),t&&(s=yr(s)),r(s)}}}var bm=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=bi({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});const n=this.analyzer.tokenize(e),{df:r,fieldCount:s}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(const o of n){this.termSearchers.push(new ca(o,{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 i=r.get(o)||0,a=Math.log(1+(s-i+.5)/(i+.5));this.idfWeights.push(a)}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,r=0,s=0,o=0;const i=this.combineAll&&!this.useMask?new Set:null;for(let u=0;u<this.termSearchers.length;u++){const f=this.termSearchers[u].searchIn(e),d=this.idfWeights[u];r+=d,f.isMatch&&(s++,n+=d*(1-f.score),f.indices&&t.push(...f.indices),this.combineAll&&(this.useMask?o|=1<<u:i.add(u)))}if(s===0)return{isMatch:!1,score:1};const a=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,a)};return this.options.includeMatches&&t.length&&(c.indices=la(t)),this.combineAll&&(this.useMask?c.matchedMask=o:c.matchedTerms=i,c.termCount=this.numTerms),c}};function Io(e,t,n,r){const s=r.tokenize(t);if(!s.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);const o=new Set(s);let i=e.docTermFieldHits.get(n);i||(i=new Map,e.docTermFieldHits.set(n,i));for(const a of o)i.set(a,(i.get(a)||0)+1),e.df.set(a,(e.df.get(a)||0)+1)}function qu(e,t,n,r){const{i:s,v:o,$:i}=t;if(o!==void 0){Io(e,o,s,r);return}if(i)for(let a=0;a<n;a++){const c=i[a];if(c)if(Array.isArray(c))for(const u of c)Io(e,u.v,s,r);else Io(e,c.v,s,r)}}function vm(e,t,n){const r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(const s of e)qu(r,s,t,n);return r}function wm(e,t,n,r){qu(e,t,n,r)}function Sm(e,t){const n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);const r=e.docTermFieldHits.get(t);if(r){for(const[s,o]of r){const i=(e.df.get(s)||0)-o;i<=0?e.df.delete(s):e.df.set(s,i)}e.docTermFieldHits.delete(t)}}function Bl(e,t){if(t.length===0)return;const n=Array.from(new Set(t)).sort((a,c)=>a-c);for(const a of n)Sm(e,a);const r=a=>{let c=0,u=n.length;for(;c<u;){const f=c+u>>>1;n[f]<a?c=f+1:u=f}return a-c},s=n[0],o=new Map;for(const[a,c]of e.docFieldCount)o.set(a>s?r(a):a,c);e.docFieldCount=o;const i=new Map;for(const[a,c]of e.docTermFieldHits)i.set(a>s?r(a):a,c);e.docTermFieldHits=i}var tn=class{constructor(e,t,n){this.options={...ie,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new zh(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=Ts(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 aa))throw new Error(Dh);if(this._myIndex=t||Fu(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const n=bi({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=vm(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=bi({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});wm(this._invertedIndex,t,this._myIndex.keys.length,n)}this._invalidateSearcherCache()}remove(e=()=>!1){const t=[],n=[];for(let r=0,s=this._docs.length;r<s;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&Bl(this._invertedIndex,n);const r=new Set(n);this._docs=this._docs.filter((s,o)=>!r.has(o)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw new Error(pi);this._invertedIndex&&Bl(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:r,includeScore:s,shouldSort:o,sortFn:i,ignoreFieldNorm:a}=this.options;if(Ye(e)&&!e.trim()){let p=this._docs.map((h,m)=>({item:h,refIndex:m}));return hs(n)&&n>-1&&(p=p.slice(0,n)),p}const c=o&&hs(n)&&n>0&&Ye(e),u=i,f=(p,h)=>u(p,h)||p.idx-h.idx;let d;if(c){const p=new pm(n,f);Ye(this._docs[0])?this._searchStringList(e,{heap:p,ignoreFieldNorm:a}):this._searchObjectList(e,{heap:p,ignoreFieldNorm:a}),d=p.extractSorted()}else d=Ye(e)?Ye(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),dm(d,{ignoreFieldNorm:a}),o&&d.sort(Ye(e)?f:u),hs(n)&&n>-1&&(d=d.slice(0,n));return mm(d,this._docs,{includeMatches:r,includeScore:s})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:o}=this._myIndex,i=t?null:[];return o.forEach(({v:a,i:c,n:u})=>{if(!ct(a))return;const f=r.searchIn(a);if(f.isMatch){const d={score:f.score,value:a,norm:u,indices:f.indices};s&&(d.matchedMask=f.matchedMask,d.matchedTerms=f.matchedTerms,d.termCount=f.termCount);const p=[d];if(!s||this._coversAllTokens(p)){const h={item:a,idx:c,matches:p};t?(h.score=xi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):i.push(h)}}}),i}_searchLogical(e){const t=Hu(e,this.options),n=this._normalizedKeys(),r=(a,c,u)=>{if(!("children"in a)){const{keyId:h,searcher:m}=a;let g;return h===null?(g=[],n.forEach((v,j)=>{g.push(...this._findMatches({key:v,value:c[j],searcher:m}))})):g=this._findMatches({key:this._keyStore.get(h),value:this._myIndex.getValueForItemAtKeyId(c,h),searcher:m}),g&&g.length?[{idx:u,item:c,matches:g}]:[]}const{children:f,operator:d}=a,p=[];for(let h=0,m=f.length;h<m;h+=1){const g=f[h],v=r(g,c,u);if(v.length)p.push(...v);else if(d===Os.AND)return[]}return p},s=this._myIndex.records,o=new Map,i=[];return s.forEach(({$:a,i:c})=>{if(ct(a)){const u=r(t,a,c);u.length&&(o.has(c)||(o.set(c,{idx:c,item:a,matches:[]}),i.push(o.get(c))),u.forEach(({matches:f})=>{o.get(c).matches.push(...f)}))}}),i}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){const r=this._getSearcher(e),s=this.options.useTokenSearch&&this.options.tokenMatch==="all",{records:o}=this._myIndex,i=this._normalizedKeys(),a=t?null:[];return o.forEach(({$:c,i:u})=>{if(!ct(c))return;const f=[];let d=!1,p=!1;if(i.forEach((h,m)=>{const g=this._findMatches({key:h,value:c[m],searcher:r});g.length?(f.push(...g),g[0].hasInverse&&(p=!0)):d=!0}),!(p&&d)&&f.length&&(!s||this._coversAllTokens(f))){const h={idx:u,item:c,matches:f};t?(h.score=xi(h.matches,{ignoreFieldNorm:n}),t.insert(h)):a.push(h)}}),a}_findMatches({key:e,value:t,searcher:n}){if(!ct(t))return[];const r=[];if(en(t))t.forEach(({v:s,i:o,n:i})=>{if(!ct(s))return;const a=n.searchIn(s);if(a.isMatch){const c={score:a.score,key:e,value:s,idx:o,norm:i,indices:a.indices,hasInverse:a.hasInverse};a.termCount!==void 0&&(c.matchedMask=a.matchedMask,c.matchedTerms=a.matchedTerms,c.termCount=a.termCount),r.push(c)}});else{const{v:s,n:o}=t,i=n.searchIn(s);if(i.isMatch){const a={score:i.score,key:e,value:s,norm:o,indices:i.indices,hasInverse:i.hasInverse};i.termCount!==void 0&&(a.matchedMask=i.matchedMask,a.matchedTerms=i.matchedTerms,a.termCount=i.termCount),r.push(a)}}return r}_coversAllTokens(e){const t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let r=0;for(let s=0;s<e.length;s++)r|=e[s].matchedMask||0;return r===2**t-1}const n=new Set;for(let r=0;r<e.length;r++){const s=e[r].matchedTerms;if(s)for(const o of s)n.add(o)}return n.size===t}};tn.version="7.5.0";tn.createIndex=Fu;tn.parseIndex=Qh;tn.config=ie;tn.match=function(e,t,n){if(n&&n.useTokenSearch)throw new Error(qh);return Ts(e,{...ie,...n}).searchIn(t)};tn.parseQuery=Hu;ua(cm);ua(bm);tn.use=function(...e){e.forEach(t=>ua(t))};var jm=tn;function zu(e,t,n={}){const[r,s]=A.useState(""),[o,i]=A.useState(""),a=n.debounceMs??150;A.useEffect(()=>{const d=setTimeout(()=>i(r),a);return()=>clearTimeout(d)},[r,a]);const c=A.useMemo(()=>t(e),[e,t]),u=A.useMemo(()=>new jm(c,{keys:[{name:"name",weight:2},{name:"text",weight:1}],threshold:n.threshold??.3,ignoreLocation:!0,ignoreFieldNorm:!0,includeScore:!0}),[c,n.threshold]),f=A.useMemo(()=>o.trim()?u.search(o.trim(),{limit:n.limit??20}).map(d=>d.item):[],[u,o,n.limit]);return{query:r,setQuery:s,results:f,searchIndex:c}}function Em(e,t={}){return zu(e,Ph,t)}const vi="search-match",Wu=()=>typeof CSS<"u"&&"highlights"in CSS&&typeof Highlight<"u";function km(e,t){const n=t.trim().toLowerCase();if(!n)return[];const r=[],s=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=s.nextNode();o;o=s.nextNode()){const i=(o.textContent??"").toLowerCase();let a=0;for(let c=i.indexOf(n);c!==-1;c=i.indexOf(n,a)){const u=document.createRange();u.setStart(o,c),u.setEnd(o,c+n.length),r.push(u),a=c+n.length}}return r}function Am(e,t){if(!Wu())return;const n=km(e,t);if(!n.length){CSS.highlights.delete(vi);return}CSS.highlights.set(vi,new Highlight(...n))}function Po(){Wu()&&CSS.highlights.delete(vi)}function Tm(e,t){const n=A.useRef(null);A.useEffect(()=>{if(!e)return;const{targetId:r,query:s,highlight:o}=e;let i=!1;const a=u=>{if(i)return;const f=document.getElementById(r);if(!f){u<40&&setTimeout(()=>a(u+1),50);return}if(n.current!==r){try{f.scrollIntoView({behavior:"smooth",block:"start"})}catch{}n.current=r}o&&c(0)},c=u=>{if(i)return;const f=document.getElementById(r);f&&Am(f,s),u<6&&setTimeout(()=>c(u+1),100)};return setTimeout(()=>a(0),50),()=>{i=!0}},[e,...t])}function Vu({tabs:e,defaultTab:t,isTabKey:n,sections:r,searchQuery:s}){var P;const o=((P=e[0])==null?void 0:P.id)??t,[i,a]=A.useState(o),[c,u]=A.useState(null),f=R=>{a(R),u(R)},[d,p]=A.useState({}),h=e.some(R=>R.id===i)?i:o,m={};for(const R of r)m[R.id]=R.visible?d[R.id]??null:null;const g=(R,U)=>p(J=>({...J,[R]:U})),[v,j]=A.useState(null),[y,b]=A.useState(null),[S,k]=A.useState(null),w=R=>{n(R.tab)?f(R.tab):R.tab==="servers"&&u("servers");const U={};for(const J of r)U[J.id]=J.id===R.tab?R.key:null;p(U),j(R.focusSection??null),b(R.tab==="schemas"&&R.schemaFocusTokens?{tokens:R.schemaFocusTokens,id:R.targetId}:null),R.tab==="schemas"&&Po(),k({targetId:R.targetId,query:s,highlight:R.tab!=="schemas"})},E=(R,U)=>{f(R),p(J=>{const Z={...J};for(const _ of r)_.id!=="servers"&&(Z[_.id]=_.id===R?U:null);return Z})},C=R=>{u("servers");const U={};for(const J of r)U[J.id]=J.id==="servers"?R:null;p(U)},O=R=>{n(R)&&f(R)},T=(()=>{for(const R of r){const U=m[R.id];if(U)return{tab:R.id,key:U}}return null})();return Tm(S,[h,v,y,...r.map(R=>m[R.id])]),A.useEffect(()=>{s.trim()||(k(null),Po())},[s]),A.useEffect(()=>Po,[]),{effectiveTab:h,focusTab:f,navActiveSection:c??h,selected:m,setSelectedKey:g,selectedNavItem:T,handleSearchSelect:w,handleNavItemSelect:E,handleNavServerSelect:C,handleContentTabChange:O,focusSection:v,schemaFocusTarget:y}}const ce=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),$t=e=>ce(e)?e:null,Fl="^[\0-ÿ]*$",Om=Math.pow(-2,31),Nm=Math.pow(2,31)-1,Cm=Math.pow(-2,63),_m=Math.pow(2,63)-1,Rm={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"},fa=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)?e:{};function xr(e){const t=fa(e);if(typeof t.name=="string")return typeof t.namespace=="string"?`${t.namespace}.${t.name}`:t.name}function wi(e,t,n){e.doc&&(t.description=e.doc),e.default!==void 0&&(t.default=e.default);const r=xr(e);r!==void 0&&n[r]&&(t["x-parser-schema-id"]=r)}function Ul(e,t,n){!(Array.isArray(e.type)&&e.type.includes("null"))&&!n&&(t.required=t.required||[],t.required.push(e.name))}function Im(e,t){let n=e,r=t;if(Array.isArray(e)&&e.length>0){const s=e.length>1&&e[0]==="null";n=e[+s],r.oneOf!==void 0&&(r=r.oneOf[0])}return{type:n,jsonSchema:r}}function Pm(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 Si(e){return Object.keys(e).some(t=>t!=="type"&&t!=="name"&&t!=="namespace")}function ji(e,t,n){const{type:r,jsonSchema:s}=Im(e,n);Pm(r,t.example,s);function o(...i){i.forEach(a=>{let c=!0;a==="minLength"||a==="maxLength"?c=t[a]>-1:a==="multipleOf"&&(c=t[a]>0),t[a]!==void 0&&c&&(s[a]=t[a])})}switch(r){case"int":case"long":case"float":case"double":o("minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf");break;case"string":t.logicalType&&(s.format=t.logicalType),o("pattern","minLength","maxLength");break;case"array":o("minItems","maxItems","uniqueItems");break}}function da(e,t,n){t!==void 0&&(e[t]=n)}function br(e,t){let n={};if(Array.isArray(e))return Mm(n,e,t);const r=fa(e),s=typeof e=="string"?e:r.type;switch(n.type=Rm[s],s){case"int":{n.minimum=Om,n.maximum=Nm;break}case"long":{n.minimum=Cm,n.maximum=_m;break}case"bytes":{n.pattern=Fl;break}case"fixed":{n.pattern=Fl,n.minLength=r.size,n.maxLength=r.size;break}case"map":{n.additionalProperties=br(r.values,t);break}case"array":{n.items=br(r.items,t);break}case"enum":{n.enum=r.symbols;break}case"float":case"double":{n.format=s;break}case"record":{const o=$m(r,t,n);da(t,xr(e),n),n.properties=Object.fromEntries(o.entries());break}default:{const o=t[xr(e)]??(typeof s=="string"?t[s]:void 0);o&&(n=Si(r)?{...o}:o);break}}return wi(r,n,t),ji(s,r,n),n}function $m(e,t,n){const r=new Map;for(const s of e.fields??[]){const o=typeof s.type=="string"?t[s.type]:void 0;if(o){const i=Si(s)?{...o}:o;Ul(s,n,s.default!==void 0),Si(s)&&(wi(s,i,t),ji(s.type,s,i)),r.set(s.name,i)}else{const i=br(s.type,t);Ul(s,n,s.default!==void 0),wi(s,i,t),ji(s.type,s,i),r.set(s.name,i),da(t,xr(s.type),i)}}return r}function Mm(e,t,n){const r=[];let s=null;for(const o of t){const i=br(o,n);(typeof o=="string"?o:fa(o).type)==="null"?s=i:(r.push(i),da(n,xr(o),i))}return s&&r.push(s),e.oneOf=r,e}function Ei(e){return br(e,{})}const Hl=new Set(["null","boolean","int","long","float","double","bytes","string","uuid"]),Lm=new Set(["record","enum","array","map","fixed"]),ql=/^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/;function pa(e){const t=[];return _n(e,"schema",t,new Set),t}function _n(e,t,n,r){if(typeof e=="string"){!Hl.has(e)&&!ql.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((o,i)=>_n(o,`${t}[${i}]`,n,r));return}if(!ce(e)){n.push(`${t}: expected an Avro type string, object, or union`);return}if(r.has(e))return;r.add(e);const s=e.type;if(typeof s!="string"){Array.isArray(s)||ce(s)?_n(s,`${t}.type`,n,r):n.push(`${t}: missing "type"`);return}if(!Hl.has(s)&&!Lm.has(s)&&!ql.test(s)){n.push(`${t}: unknown Avro type "${s}"`);return}switch(s){case"record":{if(!Array.isArray(e.fields)){n.push(`${t}: record must have a "fields" array`);return}e.fields.forEach((o,i)=>{const a=`${t}.fields[${i}]`;if(!ce(o)||typeof o.name!="string"){n.push(`${a}: field must have a string "name"`);return}_n(o.type,`${a}.type`,n,r)});break}case"enum":{const o=e.symbols;(!Array.isArray(o)||o.some(i=>typeof i!="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"`):_n(e.items,`${t}.items`,n,r);break}case"map":{e.values===void 0?n.push(`${t}: map must have "values"`):_n(e.values,`${t}.values`,n,r);break}case"fixed":{typeof e.size!="number"&&n.push(`${t}: fixed must have a numeric "size"`);break}}}let Ns=null,$o=null;const ki=new Set;function Dm(){return $o||($o=Promise.resolve().then(()=>require("./protoToJsonSchema-BNZrP3Fa.cjs")).then(e=>{Ns=e.protoToJsonSchema,ki.forEach(t=>t())})),$o}function Bm(){return Ns||Dm(),Ns}function Fm(e){return ki.add(e),()=>ki.delete(e)}function zl(){return Ns!==null}function ha(){return A.useSyncExternalStore(Fm,zl,zl)}const Um="x-parser-original-payload",Cs="x-lib-conversion-error",Hm=/^application\/vnd\.apache\.avro(\+(json|yaml))?(\s*;\s*version=.+)?$/i,qm=/^application\/vnd\.google\.protobuf(\s*;\s*version=.+)?$/i;function Nr(e){return typeof e=="string"&&Hm.test(e)}function Cr(e){return typeof e=="string"&&qm.test(e)}function Ku(e){return ce(e)&&typeof e.schemaFormat=="string"&&"schema"in e}function Ju(e){var t,n;if(typeof e!="string")return null;if(Nr(e)){const r=(t=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:t[1];return r?`avro ${r}`:"avro"}if(Cr(e)){const r=(n=/;\s*version=([^;\s]+)/.exec(e))==null?void 0:n[1];return r?`protobuf ${r}`:"protobuf"}return e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")?null:e}function Yu(e){return Nr(e)?"Avro":Cr(e)?"Protobuf":null}function zm(e,t){return t?!1:!e||Nr(e)||Cr(e)?!0:e.startsWith("application/vnd.aai.asyncapi")||e.startsWith("application/schema")}const Wm=["properties","oneOf","anyOf","allOf","not","$ref","additionalProperties","patternProperties","x-parser-schema-id"],Vm=new Set(["record","enum","fixed","map","int","long","float","double","bytes","uuid"]);function Km(e){return typeof e=="string"||Array.isArray(e)?!0:ce(e)?typeof e.type=="string"&&Vm.has(e.type)||Array.isArray(e.fields)||Array.isArray(e.symbols)?!0:!Wm.some(t=>t in e):!1}function vr(e,t){let n=e;if(t&&ce(n)&&typeof n.$ref=="string"){const i=t(n.$ref);i!==void 0&&(n=i)}const r=Jm(n),s=r.schema.description;if(typeof s=="string")return{...r,description:s};const o=Ku(n)?n.description:void 0;return typeof o=="string"?{...r,description:o}:r}function Jm(e){var i;if(!Ku(e))return{schema:$t(e)??e};const{schemaFormat:t}=e,n=e.schema,r=e[Um],s=(i=$t(n))==null?void 0:i[Cs];if(typeof s=="string")return{schema:$t(r)??{},schemaFormat:t,originalSchema:r,conversionError:s};if(r!==void 0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:r};if(Nr(t)&&Km(n)){const a=pa(n);if(a.length>0)return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:a[0]};try{return{schema:Ei(n),schemaFormat:t,originalSchema:n}}catch(c){return{schema:$t(n)??{},schemaFormat:t,originalSchema:n,conversionError:c instanceof Error?c.message:"Failed to convert Avro schema"}}}if(Cr(t)&&typeof n=="string"){const a=Bm();if(!a)return{schema:{},schemaFormat:t,originalSchema:n,pendingConversion:!0};try{return{schema:a(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 o=$t(n);return o?{schema:o,schemaFormat:t}:{schema:{},schemaFormat:t,originalSchema:n}}const De=(e,t)=>`${"#".repeat(e)} ${t}`,ne=e=>typeof e=="string"?e.replace(/`/g,"'"):String(e??""),rr=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),Ym={objects:new Set,refs:new Set};function gs(e,t,n=Ym){if(e===null||typeof e!="object")return e;if(n.objects.has(e)||rr(e)&&typeof e.$ref=="string"&&n.refs.has(e.$ref)){const o=rr(e)?e["x-parser-schema-id"]:void 0;return typeof o=="string"?{$ref:`#/components/schemas/${o} (circular)`}:"[circular reference]"}const r={objects:new Set(n.objects).add(e),refs:rr(e)&&typeof e.$ref=="string"?new Set(n.refs).add(e.$ref):n.refs};if(Array.isArray(e))return e.map(o=>gs(o,t,r));if(rr(e)&&typeof e.$ref=="string"){const o=t==null?void 0:t(e.$ref);return rr(o)||Array.isArray(o)?gs(o,t,r):{$ref:e.$ref}}const s={};for(const[o,i]of Object.entries(e))s[o]=gs(i,t,r);return s}function _s(e,t,n){if(!t)return"";const r=gs(t,n);return`${De(4,`\`${ne(e)}\``)}
|
|
4
|
-
|
|
5
|
-
\`\`\`json
|
|
6
|
-
${JSON.stringify(r,null,2)}
|
|
7
|
-
\`\`\``}function fr(e,t,n){if(!t||typeof t=="boolean")return"";const{schema:r,description:s,conversionError:o,pendingConversion:i}=vr(t,n);if(i)return`${De(4,`\`${ne(e)}\``)}
|
|
8
|
-
|
|
9
|
-
_(schema conversion still in progress)_`;if(o)return`${De(4,`\`${ne(e)}\``)}
|
|
10
|
-
|
|
11
|
-
_(could not convert schema: ${ne(o)})_`;const a=s&&!r.description?{...r,description:s}:r;return _s(e,a,n)}function Zu(e){const t=[],{info:n}=e;t.push(De(1,ne(n.title)));const r=[`**Version:** ${ne(n.version)}`];if(n.license&&r.push(`**License:** ${ne(n.license.name)}${n.license.url?` (${ne(n.license.url)})`:""}`),n.contact){const s=[n.contact.name,n.contact.email].filter(Boolean).map(ne).join(" ");s&&r.push(`**Contact:** ${s}`)}if(t.push(r.join(`
|
|
12
|
-
`)),n.description&&t.push(ne(n.description)),e.servers&&Object.keys(e.servers).length){const s=[De(2,"Servers")];for(const[o,i]of Object.entries(e.servers)){s.push(De(3,ne(o)));const a=[`**Host:** \`${ne(i.host)}${i.pathname?ne(i.pathname):""}\``];a.push(`**Protocol:** ${ne(i.protocol)}${i.protocolVersion?` ${ne(i.protocolVersion)}`:""}`),i.description&&a.push(ne(i.description)),s.push(a.join(`
|
|
13
|
-
`))}t.push(s.join(`
|
|
14
|
-
|
|
15
|
-
`))}return t}function Zm(e,t){var o,i,a;const n=Zu(e);if(e.operations&&Object.keys(e.operations).length){const c=[De(2,"Operations")];for(const[u,f]of Object.entries(e.operations)){const d=f.channel;c.push(De(3,`${ne((o=f.action)==null?void 0:o.toUpperCase())} \`${ne(u)}\``));const p=[];d!=null&&d.address&&p.push(`**Channel:** \`${ne(d.address)}\``),f.summary&&p.push(ne(f.summary)),f.description&&p.push(ne(f.description));const h=f.messages??[];h.length&&p.push(`**Messages:** ${h.map(m=>`\`${ne(m.name??m.title??"message")}\``).join(", ")}`),c.push(p.join(`
|
|
16
|
-
|
|
17
|
-
`))}n.push(c.join(`
|
|
18
|
-
|
|
19
|
-
`))}const r=(i=e.components)==null?void 0:i.messages;if(r&&Object.keys(r).length){const c=[De(2,"Messages")];for(const[u,f]of Object.entries(r)){c.push(De(3,ne(f.title??f.name??u)));const d=[];f.summary&&d.push(ne(f.summary)),f.description&&d.push(ne(f.description)),f.contentType&&d.push(`**Content-Type:** \`${ne(f.contentType)}\``),c.push(d.join(`
|
|
20
|
-
|
|
21
|
-
`)),f.payload&&c.push(fr("payload",f.payload,t)),f.headers&&c.push(fr("headers",f.headers,t))}n.push(c.join(`
|
|
22
|
-
|
|
23
|
-
`))}const s=(a=e.components)==null?void 0:a.schemas;if(s&&Object.keys(s).length){const c=[De(2,"Schemas")];for(const[u,f]of Object.entries(s))c.push(fr(u,f,t));n.push(c.join(`
|
|
24
|
-
|
|
25
|
-
`))}return n.filter(Boolean).join(`
|
|
26
|
-
|
|
27
|
-
`)}function Xm(e,t,n){var a;const r=t.channel,s=[De(3,`${ne((a=t.action)==null?void 0:a.toUpperCase())} \`${ne(e)}\``)],o=[];r!=null&&r.address&&o.push(`**Channel:** \`${ne(r.address)}\``),t.summary&&o.push(ne(t.summary)),t.description&&o.push(ne(t.description)),s.push(o.join(`
|
|
28
|
-
|
|
29
|
-
`));const i=t.messages??[];for(const c of i){const u=[De(4,ne(c.title??c.name??"Message"))],f=[];c.summary&&f.push(ne(c.summary)),c.description&&f.push(ne(c.description)),c.contentType&&f.push(`**Content-Type:** \`${ne(c.contentType)}\``),f.length&&u.push(f.join(`
|
|
30
|
-
|
|
31
|
-
`)),s.push(u.join(`
|
|
32
|
-
|
|
33
|
-
`)),c.payload&&s.push(fr("payload",c.payload,n)),c.headers&&s.push(fr("headers",c.headers,n))}return s.filter(Boolean).join(`
|
|
34
|
-
|
|
35
|
-
`)}function Qm(e,t,n){var o;const r=(o=e.operations)==null?void 0:o[t];if(!r)return"";const s=Zu(e);return s.push(Xm(t,r,n)),s.filter(Boolean).join(`
|
|
36
|
-
|
|
37
|
-
`)}function Xu(e,t,n,r){var c;const s=[De(3,`${e.toUpperCase()} \`${ne(t)}\``)],o=[];n.summary&&o.push(ne(n.summary)),n.description&&o.push(ne(n.description)),n.deprecated&&o.push("**Deprecated**");for(const u of["path","query","header","cookie"]){const f=(n.parameters??[]).filter(d=>d.in===u);if(f.length){o.push(`**${u[0].toUpperCase()}${u.slice(1)} Parameters:**`);for(const d of f){const p=d.schema;o.push(`- \`${ne(d.name)}\`${d.required?" (required)":""}${p!=null&&p.type?` — ${ne(p.type)}`:""}${d.description?`: ${ne(d.description)}`:""}`)}}}s.push(o.join(`
|
|
38
|
-
|
|
39
|
-
`));const i=((c=n.requestBody)==null?void 0:c.content)??{};for(const[u,f]of Object.entries(i))s.push([`**Request Body** (\`${ne(u)}\`)`,_s("body",f.schema,r)].join(`
|
|
40
|
-
|
|
41
|
-
`));const a=n.responses??{};for(const[u,f]of Object.entries(a)){const d=[De(4,`${u}${f.description?`: ${ne(f.description)}`:""}`)];for(const[p,h]of Object.entries(f.content??{}))d.push([`**Body** (\`${ne(p)}\`)`,_s("body",h.schema,r)].join(`
|
|
42
|
-
|
|
43
|
-
`));s.push(d.join(`
|
|
44
|
-
|
|
45
|
-
`))}return s.join(`
|
|
46
|
-
|
|
47
|
-
`)}function Gm(e,t){var i,a,c,u;const n=[],{info:r}=e;if(n.push(De(1,ne(r.title))),n.push(`**Version:** ${ne(r.version)}`),r.description&&n.push(ne(r.description)),(i=e.servers)!=null&&i.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${ne(d.url)}\`${d.description?` — ${ne(d.description)}`:""}`);n.push(f.join(`
|
|
48
|
-
`))}const s=e.paths?As(e.paths):[];if(s.length){const f=[De(2,"Endpoints")];for(const{method:d,path:p}of s){const h=(c=(a=e.paths)==null?void 0:a[p])==null?void 0:c[d];h&&f.push(Xu(d,p,h,t))}n.push(f.join(`
|
|
49
|
-
|
|
50
|
-
`))}const o=(u=e.components)==null?void 0:u.schemas;if(o&&Object.keys(o).length){const f=[De(2,"Schemas")];for(const[d,p]of Object.entries(o))f.push(_s(d,p,t));n.push(f.join(`
|
|
51
|
-
|
|
52
|
-
`))}return n.filter(Boolean).join(`
|
|
53
|
-
|
|
54
|
-
`)}function eg(e,t,n,r){var a,c,u;const s=(c=(a=e.paths)==null?void 0:a[n])==null?void 0:c[t];if(!s)return"";const o=[],{info:i}=e;if(o.push(De(1,ne(i.title))),o.push(`**Version:** ${ne(i.version)}`),i.description&&o.push(ne(i.description)),(u=e.servers)!=null&&u.length){const f=[De(2,"Servers")];for(const d of e.servers)f.push(`- \`${ne(d.url)}\`${d.description?` — ${ne(d.description)}`:""}`);o.push(f.join(`
|
|
55
|
-
`))}return o.push(Xu(t,n,s,r)),o.filter(Boolean).join(`
|
|
56
|
-
|
|
57
|
-
`)}const Qu={"x-x":()=>Promise.resolve().then(()=>require("./XExtension-jAiATfg-.cjs")),"x-linkedin":()=>Promise.resolve().then(()=>require("./LinkedInExtension-6xekO5bX.cjs"))},tg=()=>Promise.resolve().then(()=>require("./LogoExtension-BOYrY_RE.cjs"));var wr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ng(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?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(r){var s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return e[r]}})}),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 Mo,Wl;function Vl(){if(Wl)return Mo;Wl=1;function e(F,H){(H==null||H>F.length)&&(H=F.length);for(var G=0,le=Array(H);G<H;G++)le[G]=F[G];return le}function t(F){if(Array.isArray(F))return F}function n(F,H){var G=F==null?null:typeof Symbol<"u"&&F[Symbol.iterator]||F["@@iterator"];if(G!=null){var le,xe,Te,Je,Jn=[],ot=!0,Yn=!1;try{if(Te=(G=G.call(F)).next,H!==0)for(;!(ot=(le=Te.call(G)).done)&&(Jn.push(le.value),Jn.length!==H);ot=!0);}catch(uo){Yn=!0,xe=uo}finally{try{if(!ot&&G.return!=null&&(Je=G.return(),Object(Je)!==Je))return}finally{if(Yn)throw xe}}return Jn}}function r(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
58
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function s(F,H){return t(F)||n(F,H)||o(F,H)||r()}function o(F,H){if(F){if(typeof F=="string")return e(F,H);var G={}.toString.call(F).slice(8,-1);return G==="Object"&&F.constructor&&(G=F.constructor.name),G==="Map"||G==="Set"?Array.from(F):G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G)?e(F,H):void 0}}const i=Object.entries,a=Object.setPrototypeOf,c=Object.isFrozen,u=Object.getPrototypeOf,f=Object.getOwnPropertyDescriptor;let d=Object.freeze,p=Object.seal,h=Object.create,m=typeof Reflect<"u"&&Reflect,g=m.apply,v=m.construct;d||(d=function(H){return H}),p||(p=function(H){return H}),g||(g=function(H,G){for(var le=arguments.length,xe=new Array(le>2?le-2:0),Te=2;Te<le;Te++)xe[Te-2]=arguments[Te];return H.apply(G,xe)}),v||(v=function(H){for(var G=arguments.length,le=new Array(G>1?G-1:0),xe=1;xe<G;xe++)le[xe-1]=arguments[xe];return new H(...le)});const j=B(Array.prototype.forEach),y=B(Array.prototype.lastIndexOf),b=B(Array.prototype.pop),S=B(Array.prototype.push),k=B(Array.prototype.splice),w=Array.isArray,E=B(String.prototype.toLowerCase),C=B(String.prototype.toString),O=B(String.prototype.match),T=B(String.prototype.replace),P=B(String.prototype.indexOf),R=B(String.prototype.trim),U=B(Number.prototype.toString),J=B(Boolean.prototype.toString),Z=typeof BigInt>"u"?null:B(BigInt.prototype.toString),_=typeof Symbol>"u"?null:B(Symbol.prototype.toString),M=B(Object.prototype.hasOwnProperty),K=B(Object.prototype.toString),Y=B(RegExp.prototype.test),$=D(TypeError);function B(F){return function(H){H instanceof RegExp&&(H.lastIndex=0);for(var G=arguments.length,le=new Array(G>1?G-1:0),xe=1;xe<G;xe++)le[xe-1]=arguments[xe];return g(F,H,le)}}function D(F){return function(){for(var H=arguments.length,G=new Array(H),le=0;le<H;le++)G[le]=arguments[le];return v(F,G)}}function L(F,H){let G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:E;if(a&&a(F,null),!w(H))return F;let le=H.length;for(;le--;){let xe=H[le];if(typeof xe=="string"){const Te=G(xe);Te!==xe&&(c(H)||(H[le]=Te),xe=Te)}F[xe]=!0}return F}function re(F){for(let H=0;H<F.length;H++)M(F,H)||(F[H]=null);return F}function te(F){const H=h(null);for(const le of i(F)){var G=s(le,2);const xe=G[0],Te=G[1];M(F,xe)&&(w(Te)?H[xe]=re(Te):Te&&typeof Te=="object"&&Te.constructor===Object?H[xe]=te(Te):H[xe]=Te)}return H}function me(F){switch(typeof F){case"string":return F;case"number":return U(F);case"boolean":return J(F);case"bigint":return Z?Z(F):"0";case"symbol":return _?_(F):"Symbol()";case"undefined":return K(F);case"function":case"object":{if(F===null)return K(F);const H=F,G=I(H,"toString");if(typeof G=="function"){const le=G(H);return typeof le=="string"?le:K(le)}return K(F)}default:return K(F)}}function I(F,H){for(;F!==null;){const le=f(F,H);if(le){if(le.get)return B(le.get);if(typeof le.value=="function")return B(le.value)}F=u(F)}function G(){return null}return G}function Q(F){try{return Y(F,""),!0}catch{return!1}}const ae=d(["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"]),se=d(["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"]),ue=d(["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"]),fe=d(["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"]),pe=d(["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"]),Ne=d(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Se=d(["#text"]),Xe=d(["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"]),Ke=d(["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"]),ee=d(["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"]),Ce=d(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),$e=p(/{{[\w\W]*|^[\w\W]*}}/g),we=p(/<%[\w\W]*|^[\w\W]*%>/g),It=p(/\${[\w\W]*/g),ft=p(/^data-[\-\w.\u00B7-\uFFFF]+$/),rn=p(/^aria-[\-\w]+$/),dt=p(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),W=p(/^(?:\w+script|data):/i),V=p(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),oe=p(/^html$/i),ye=p(/^[a-z][.\w]*(-[.\w]+)+$/i),Me=p(/<[/\w!]/g),ht=p(/<[/\w]/g),lo=p(/<\/no(script|embed|frames)/i),co=p(/\/>/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},cp=function(){return typeof window>"u"?null:window},up=function(H,G){if(typeof H!="object"||typeof H.createPolicy!="function")return null;let le=null;const xe="data-tt-policy-suffix";G&&G.hasAttribute(xe)&&(le=G.getAttribute(xe));const Te="dompurify"+(le?"#"+le:"");try{return H.createPolicy(Te,{createHTML(Je){return Je},createScriptURL(Je){return Je}})}catch{return console.warn("TrustedTypes policy "+Te+" could not be created."),null}},Wa=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ut=function(H,G,le,xe){return M(H,G)&&w(H[G])?L(xe.base?te(xe.base):{},H[G],xe.transform):le};function Va(){let F=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cp();const H=z=>Va(z);if(H.version="3.4.11",H.removed=[],!F||!F.document||F.document.nodeType!==St.document||!F.Element)return H.isSupported=!1,H;let G=F.document;const le=G,xe=le.currentScript;F.DocumentFragment;const Te=F.HTMLTemplateElement,Je=F.Node,Jn=F.Element,ot=F.NodeFilter,Yn=F.NamedNodeMap;Yn===void 0&&(F.NamedNodeMap||F.MozNamedAttrMap),F.HTMLFormElement;const uo=F.DOMParser,zr=F.trustedTypes,sn=Jn.prototype,dp=I(sn,"cloneNode"),Ka=I(sn,"remove"),pp=I(sn,"nextSibling"),Zn=I(sn,"childNodes"),Xn=I(sn,"parentNode"),Ja=I(sn,"shadowRoot"),fo=I(sn,"attributes"),it=Je&&Je.prototype?I(Je.prototype,"nodeType"):null,Ht=Je&&Je.prototype?I(Je.prototype,"nodeName"):null;if(typeof Te=="function"){const z=G.createElement("template");z.content&&z.content.ownerDocument&&(G=z.content.ownerDocument)}let tt,on="",po,Ya=!1,Qn=0;const Za=function(){if(Qn>0)throw $('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.')},wn=function(x){Za(),Qn++;try{return tt.createHTML(x)}finally{Qn--}},hp=function(x){Za(),Qn++;try{return tt.createScriptURL(x)}finally{Qn--}},mp=function(){return Ya||(po=up(zr,xe),Ya=!0),po},Wr=G,ho=Wr.implementation,Xa=Wr.createNodeIterator,gp=Wr.createDocumentFragment,yp=Wr.getElementsByTagName,xp=le.importNode;let Le=Wa();H.isSupported=typeof i=="function"&&typeof Xn=="function"&&ho&&ho.createHTMLDocument!==void 0;const bp=$e,vp=we,wp=It,Sp=ft,jp=rn,Ep=W,Qa=V,kp=ye;let Ga=dt,_e=null;const el=L({},[...ae,...se,...ue,...pe,...Se]);let Re=null;const tl=L({},[...Xe,...Ke,...ee,...Ce]);let Ie=Object.seal(h(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Gn=null,nl=null;const qt=Object.seal(h(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let rl=!0,mo=!0,sl=!1,ol=!0,zt=!1,er=!0,an=!1,go=!1,yo=null,xo=null,bo=!1,Sn=!1,Vr=!1,Kr=!1,il=!0,al=!1;const ll="user-content-";let vo=!0,wo=!1,jn={},jt=null;const So=L({},["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 cl=null;const ul=L({},["audio","video","img","source","image","track"]);let jo=null;const fl=L({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Jr="http://www.w3.org/1998/Math/MathML",Yr="http://www.w3.org/2000/svg",Et="http://www.w3.org/1999/xhtml";let En=Et,Eo=!1,ko=null;const Ap=L({},[Jr,Yr,Et],C),dl=d(["mi","mo","mn","ms","mtext"]);let Ao=L({},dl);const pl=d(["annotation-xml"]);let To=L({},pl);const Tp=L({},["title","style","font","a","script"]);let tr=null;const Op=["application/xhtml+xml","text/html"],Np="text/html";let Pe=null,kn=null;const Cp=G.createElement("form"),hl=function(x){return x instanceof RegExp||x instanceof Function},Oo=function(){let x=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(kn&&kn===x)return;(!x||typeof x!="object")&&(x={}),x=te(x),tr=Op.indexOf(x.PARSER_MEDIA_TYPE)===-1?Np:x.PARSER_MEDIA_TYPE,Pe=tr==="application/xhtml+xml"?C:E,_e=Ut(x,"ALLOWED_TAGS",el,{transform:Pe}),Re=Ut(x,"ALLOWED_ATTR",tl,{transform:Pe}),ko=Ut(x,"ALLOWED_NAMESPACES",Ap,{transform:C}),jo=Ut(x,"ADD_URI_SAFE_ATTR",fl,{transform:Pe,base:fl}),cl=Ut(x,"ADD_DATA_URI_TAGS",ul,{transform:Pe,base:ul}),jt=Ut(x,"FORBID_CONTENTS",So,{transform:Pe}),Gn=Ut(x,"FORBID_TAGS",te({}),{transform:Pe}),nl=Ut(x,"FORBID_ATTR",te({}),{transform:Pe}),jn=M(x,"USE_PROFILES")?x.USE_PROFILES&&typeof x.USE_PROFILES=="object"?te(x.USE_PROFILES):x.USE_PROFILES:!1,rl=x.ALLOW_ARIA_ATTR!==!1,mo=x.ALLOW_DATA_ATTR!==!1,sl=x.ALLOW_UNKNOWN_PROTOCOLS||!1,ol=x.ALLOW_SELF_CLOSE_IN_ATTR!==!1,zt=x.SAFE_FOR_TEMPLATES||!1,er=x.SAFE_FOR_XML!==!1,an=x.WHOLE_DOCUMENT||!1,Sn=x.RETURN_DOM||!1,Vr=x.RETURN_DOM_FRAGMENT||!1,Kr=x.RETURN_TRUSTED_TYPE||!1,bo=x.FORCE_BODY||!1,il=x.SANITIZE_DOM!==!1,al=x.SANITIZE_NAMED_PROPS||!1,vo=x.KEEP_CONTENT!==!1,wo=x.IN_PLACE||!1,Ga=Q(x.ALLOWED_URI_REGEXP)?x.ALLOWED_URI_REGEXP:dt,En=typeof x.NAMESPACE=="string"?x.NAMESPACE:Et,Ao=M(x,"MATHML_TEXT_INTEGRATION_POINTS")&&x.MATHML_TEXT_INTEGRATION_POINTS&&typeof x.MATHML_TEXT_INTEGRATION_POINTS=="object"?te(x.MATHML_TEXT_INTEGRATION_POINTS):L({},dl),To=M(x,"HTML_INTEGRATION_POINTS")&&x.HTML_INTEGRATION_POINTS&&typeof x.HTML_INTEGRATION_POINTS=="object"?te(x.HTML_INTEGRATION_POINTS):L({},pl);const N=M(x,"CUSTOM_ELEMENT_HANDLING")&&x.CUSTOM_ELEMENT_HANDLING&&typeof x.CUSTOM_ELEMENT_HANDLING=="object"?te(x.CUSTOM_ELEMENT_HANDLING):h(null);if(Ie=h(null),M(N,"tagNameCheck")&&hl(N.tagNameCheck)&&(Ie.tagNameCheck=N.tagNameCheck),M(N,"attributeNameCheck")&&hl(N.attributeNameCheck)&&(Ie.attributeNameCheck=N.attributeNameCheck),M(N,"allowCustomizedBuiltInElements")&&typeof N.allowCustomizedBuiltInElements=="boolean"&&(Ie.allowCustomizedBuiltInElements=N.allowCustomizedBuiltInElements),p(Ie),zt&&(mo=!1),Vr&&(Sn=!0),jn&&(_e=L({},Se),Re=h(null),jn.html===!0&&(L(_e,ae),L(Re,Xe)),jn.svg===!0&&(L(_e,se),L(Re,Ke),L(Re,Ce)),jn.svgFilters===!0&&(L(_e,ue),L(Re,Ke),L(Re,Ce)),jn.mathMl===!0&&(L(_e,pe),L(Re,ee),L(Re,Ce))),qt.tagCheck=null,qt.attributeCheck=null,M(x,"ADD_TAGS")&&(typeof x.ADD_TAGS=="function"?qt.tagCheck=x.ADD_TAGS:w(x.ADD_TAGS)&&(_e===el&&(_e=te(_e)),L(_e,x.ADD_TAGS,Pe))),M(x,"ADD_ATTR")&&(typeof x.ADD_ATTR=="function"?qt.attributeCheck=x.ADD_ATTR:w(x.ADD_ATTR)&&(Re===tl&&(Re=te(Re)),L(Re,x.ADD_ATTR,Pe))),M(x,"ADD_URI_SAFE_ATTR")&&w(x.ADD_URI_SAFE_ATTR)&&L(jo,x.ADD_URI_SAFE_ATTR,Pe),M(x,"FORBID_CONTENTS")&&w(x.FORBID_CONTENTS)&&(jt===So&&(jt=te(jt)),L(jt,x.FORBID_CONTENTS,Pe)),M(x,"ADD_FORBID_CONTENTS")&&w(x.ADD_FORBID_CONTENTS)&&(jt===So&&(jt=te(jt)),L(jt,x.ADD_FORBID_CONTENTS,Pe)),vo&&(_e["#text"]=!0),an&&L(_e,["html","head","body"]),_e.table&&(L(_e,["tbody"]),delete Gn.tbody),x.TRUSTED_TYPES_POLICY){if(typeof x.TRUSTED_TYPES_POLICY.createHTML!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof x.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const q=tt;tt=x.TRUSTED_TYPES_POLICY;try{on=wn("")}catch(X){throw tt=q,X}}else x.TRUSTED_TYPES_POLICY===null?(tt=void 0,on=""):(tt===void 0&&(tt=mp()),tt&&typeof on=="string"&&(on=wn("")));d&&d(x),kn=x},ml=L({},[...se,...ue,...fe]),gl=L({},[...pe,...Ne]),_p=function(x,N,q){return N.namespaceURI===Et?x==="svg":N.namespaceURI===Jr?x==="svg"&&(q==="annotation-xml"||Ao[q]):!!ml[x]},Rp=function(x,N,q){return N.namespaceURI===Et?x==="math":N.namespaceURI===Yr?x==="math"&&To[q]:!!gl[x]},Ip=function(x,N,q){return N.namespaceURI===Yr&&!To[q]||N.namespaceURI===Jr&&!Ao[q]?!1:!gl[x]&&(Tp[x]||!ml[x])},Pp=function(x){let N=Xn(x);(!N||!N.tagName)&&(N={namespaceURI:En,tagName:"template"});const q=E(x.tagName),X=E(N.tagName);return ko[x.namespaceURI]?x.namespaceURI===Yr?_p(q,N,X):x.namespaceURI===Jr?Rp(q,N,X):x.namespaceURI===Et?Ip(q,N,X):!!(tr==="application/xhtml+xml"&&ko[x.namespaceURI]):!1},Wt=function(x){S(H.removed,{element:x});try{Xn(x).removeChild(x)}catch{if(Ka(x),!Xn(x))throw $("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},yl=function(x){const N=Zn(x);if(N){const X=[];j(N,de=>{S(X,de)}),j(X,de=>{try{Ka(de)}catch{}})}const q=fo(x);if(q)for(let X=q.length-1;X>=0;--X){const de=q[X],be=de&&de.name;if(typeof be=="string")try{x.removeAttribute(be)}catch{}}},ln=function(x,N){try{S(H.removed,{attribute:N.getAttributeNode(x),from:N})}catch{S(H.removed,{attribute:null,from:N})}if(N.removeAttribute(x),x==="is")if(Sn||Vr)try{Wt(N)}catch{}else try{N.setAttribute(x,"")}catch{}},$p=function(x){const N=fo(x);if(N)for(let q=N.length-1;q>=0;--q){const X=N[q],de=X&&X.name;if(!(typeof de!="string"||Re[Pe(de)]))try{x.removeAttribute(de)}catch{}}},Mp=function(x){const N=[x];for(;N.length>0;){const q=N.pop();(it?it(q):q.nodeType)===St.element&&$p(q);const de=Zn(q);if(de)for(let be=de.length-1;be>=0;--be)N.push(de[be])}},xl=function(x){let N=null,q=null;if(bo)x="<remove></remove>"+x;else{const be=O(x,/^[\r\n\t ]+/);q=be&&be[0]}tr==="application/xhtml+xml"&&En===Et&&(x='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+x+"</body></html>");const X=tt?wn(x):x;if(En===Et)try{N=new uo().parseFromString(X,tr)}catch{}if(!N||!N.documentElement){N=ho.createDocument(En,"template",null);try{N.documentElement.innerHTML=Eo?on:X}catch{}}const de=N.body||N.documentElement;return x&&q&&de.insertBefore(G.createTextNode(q),de.childNodes[0]||null),En===Et?yp.call(N,an?"html":"body")[0]:an?N.documentElement:de},bl=function(x){return Xa.call(x.ownerDocument||x,x,ot.SHOW_ELEMENT|ot.SHOW_COMMENT|ot.SHOW_TEXT|ot.SHOW_PROCESSING_INSTRUCTION|ot.SHOW_CDATA_SECTION,null)},Zr=function(x){return x=T(x,bp," "),x=T(x,vp," "),x=T(x,wp," "),x},No=function(x){var N;x.normalize();const q=Xa.call(x.ownerDocument||x,x,ot.SHOW_TEXT|ot.SHOW_COMMENT|ot.SHOW_CDATA_SECTION|ot.SHOW_PROCESSING_INSTRUCTION,null);let X=q.nextNode();for(;X;)X.data=Zr(X.data),X=q.nextNode();const de=(N=x.querySelectorAll)===null||N===void 0?void 0:N.call(x,"template");de&&j(de,be=>{An(be.content)&&No(be.content)})},Xr=function(x){const N=Ht?Ht(x):null;return typeof N!="string"||Pe(N)!=="form"?!1:typeof x.nodeName!="string"||typeof x.textContent!="string"||typeof x.removeChild!="function"||x.attributes!==fo(x)||typeof x.removeAttribute!="function"||typeof x.setAttribute!="function"||typeof x.namespaceURI!="string"||typeof x.insertBefore!="function"||typeof x.hasChildNodes!="function"||x.nodeType!==it(x)||x.childNodes!==Zn(x)},An=function(x){if(!it||typeof x!="object"||x===null)return!1;try{return it(x)===St.documentFragment}catch{return!1}},nr=function(x){if(!it||typeof x!="object"||x===null)return!1;try{return typeof it(x)=="number"}catch{return!1}};function Pt(z,x,N){z.length!==0&&j(z,q=>{q.call(H,x,N,kn)})}const Lp=function(x,N){return!!(er&&x.hasChildNodes()&&!nr(x.firstElementChild)&&Y(Me,x.textContent)&&Y(Me,x.innerHTML)||er&&x.namespaceURI===Et&&N==="style"&&nr(x.firstElementChild)||x.nodeType===St.processingInstruction||er&&x.nodeType===St.comment&&Y(ht,x.data))},Dp=function(x,N){if(!Gn[N]&&Sl(N)&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,N)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(N)))return!1;if(vo&&!jt[N]){const q=Xn(x),X=Zn(x);if(X&&q){const de=X.length;for(let be=de-1;be>=0;--be){const He=wo?X[be]:dp(X[be],!0);q.insertBefore(He,pp(x))}}}return Wt(x),!0},vl=function(x){if(Pt(Le.beforeSanitizeElements,x,null),Xr(x))return Wt(x),!0;const N=Pe(Ht?Ht(x):x.nodeName);if(Pt(Le.uponSanitizeElement,x,{tagName:N,allowedTags:_e}),Lp(x,N))return Wt(x),!0;if(Gn[N]||!(qt.tagCheck instanceof Function&&qt.tagCheck(N))&&!_e[N])return Dp(x,N);if((it?it(x):x.nodeType)===St.element&&!Pp(x)||(N==="noscript"||N==="noembed"||N==="noframes")&&Y(lo,x.innerHTML))return Wt(x),!0;if(zt&&x.nodeType===St.text){const X=Zr(x.textContent);x.textContent!==X&&(S(H.removed,{element:x.cloneNode()}),x.textContent=X)}return Pt(Le.afterSanitizeElements,x,null),!1},wl=function(x,N,q){if(nl[N]||il&&(N==="id"||N==="name")&&(q in G||q in Cp))return!1;const X=Re[N]||qt.attributeCheck instanceof Function&&qt.attributeCheck(N,x);if(!(mo&&Y(Sp,N))){if(!(rl&&Y(jp,N))){if(X){if(!jo[N]){if(!Y(Ga,T(q,Qa,""))){if(!((N==="src"||N==="xlink:href"||N==="href")&&x!=="script"&&P(q,"data:")===0&&cl[x])){if(!(sl&&!Y(Ep,T(q,Qa,"")))){if(q)return!1}}}}}else if(!(Sl(x)&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,x)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(x))&&(Ie.attributeNameCheck instanceof RegExp&&Y(Ie.attributeNameCheck,N)||Ie.attributeNameCheck instanceof Function&&Ie.attributeNameCheck(N,x))||N==="is"&&Ie.allowCustomizedBuiltInElements&&(Ie.tagNameCheck instanceof RegExp&&Y(Ie.tagNameCheck,q)||Ie.tagNameCheck instanceof Function&&Ie.tagNameCheck(q))))return!1}}return!0},Bp=L({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Sl=function(x){return!Bp[E(x)]&&Y(kp,x)},Fp=function(x,N,q,X){if(tt&&typeof zr=="object"&&typeof zr.getAttributeType=="function"&&!q)switch(zr.getAttributeType(x,N)){case"TrustedHTML":return wn(X);case"TrustedScriptURL":return hp(X)}return X},Up=function(x,N,q,X){try{q?x.setAttributeNS(q,N,X):x.setAttribute(N,X),Xr(x)?Wt(x):b(H.removed)}catch{ln(N,x)}},jl=function(x){Pt(Le.beforeSanitizeAttributes,x,null);const N=x.attributes;if(!N||Xr(x))return;const q={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Re,forceKeepAttr:void 0};let X=N.length;const de=Pe(x.nodeName);for(;X--;){const be=N[X],He=be.name,Be=be.namespaceURI,pt=be.value,mt=Pe(He),_o=pt;let Qe=He==="value"?_o:R(_o);if(q.attrName=mt,q.attrValue=Qe,q.keepAttr=!0,q.forceKeepAttr=void 0,Pt(Le.uponSanitizeAttribute,x,q),Qe=q.attrValue,al&&(mt==="id"||mt==="name")&&P(Qe,ll)!==0&&(ln(He,x),Qe=ll+Qe),er&&Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Qe)){ln(He,x);continue}if(mt==="attributename"&&O(Qe,"href")){ln(He,x);continue}if(!q.forceKeepAttr){if(!q.keepAttr){ln(He,x);continue}if(!ol&&Y(co,Qe)){ln(He,x);continue}if(zt&&(Qe=Zr(Qe)),!wl(de,mt,Qe)){ln(He,x);continue}Qe=Fp(de,mt,Be,Qe),Qe!==_o&&Up(x,He,Be,Qe)}}Pt(Le.afterSanitizeAttributes,x,null)},Qr=function(x){let N=null;const q=bl(x);for(Pt(Le.beforeSanitizeShadowDOM,x,null);N=q.nextNode();)if(Pt(Le.uponSanitizeShadowNode,N,null),vl(N),jl(N),An(N.content)&&Qr(N.content),(it?it(N):N.nodeType)===St.element){const de=Ja(N);An(de)&&(Co(de),Qr(de))}Pt(Le.afterSanitizeShadowDOM,x,null)},Co=function(x){const N=[{node:x,shadow:null}];for(;N.length>0;){const q=N.pop();if(q.shadow){Qr(q.shadow);continue}const X=q.node,be=(it?it(X):X.nodeType)===St.element,He=Zn(X);if(He)for(let Be=He.length-1;Be>=0;--Be)N.push({node:He[Be],shadow:null});if(be){const Be=Ht?Ht(X):null;if(typeof Be=="string"&&Pe(Be)==="template"){const pt=X.content;An(pt)&&N.push({node:pt,shadow:null})}}if(be){const Be=Ja(X);An(Be)&&N.push({node:null,shadow:Be},{node:Be,shadow:null})}}};return H.sanitize=function(z){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},N=null,q=null,X=null,de=null;if(Eo=!z,Eo&&(z="<!-->"),typeof z!="string"&&!nr(z)&&(z=me(z),typeof z!="string"))throw $("dirty is not a string, aborting");if(!H.isSupported)return z;go?(_e=yo,Re=xo):Oo(x),(Le.uponSanitizeElement.length>0||Le.uponSanitizeAttribute.length>0)&&(_e=te(_e)),Le.uponSanitizeAttribute.length>0&&(Re=te(Re)),H.removed=[];const be=wo&&typeof z!="string"&&nr(z);if(be){const pt=Ht?Ht(z):z.nodeName;if(typeof pt=="string"){const mt=Pe(pt);if(!_e[mt]||Gn[mt])throw $("root node is forbidden and cannot be sanitized in-place")}if(Xr(z))throw $("root node is clobbered and cannot be sanitized in-place");try{Co(z)}catch(mt){throw yl(z),mt}}else if(nr(z))N=xl("<!---->"),q=N.ownerDocument.importNode(z,!0),q.nodeType===St.element&&q.nodeName==="BODY"||q.nodeName==="HTML"?N=q:N.appendChild(q),Co(q);else{if(!Sn&&!zt&&!an&&z.indexOf("<")===-1)return tt&&Kr?wn(z):z;if(N=xl(z),!N)return Sn?null:Kr?on:""}N&&bo&&Wt(N.firstChild);const He=bl(be?z:N);try{for(;X=He.nextNode();)vl(X),jl(X),An(X.content)&&Qr(X.content)}catch(pt){throw be&&yl(z),pt}if(be)return j(H.removed,pt=>{pt.element&&Mp(pt.element)}),zt&&No(z),z;if(Sn){if(zt&&No(N),Vr)for(de=gp.call(N.ownerDocument);N.firstChild;)de.appendChild(N.firstChild);else de=N;return(Re.shadowroot||Re.shadowrootmode)&&(de=xp.call(le,de,!0)),de}let Be=an?N.outerHTML:N.innerHTML;return an&&_e["!doctype"]&&N.ownerDocument&&N.ownerDocument.doctype&&N.ownerDocument.doctype.name&&Y(oe,N.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+N.ownerDocument.doctype.name+`>
|
|
59
|
-
`+Be),zt&&(Be=Zr(Be)),tt&&Kr?wn(Be):Be},H.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Oo(z),go=!0,yo=_e,xo=Re},H.clearConfig=function(){kn=null,go=!1,yo=null,xo=null,tt=po,on=""},H.isValidAttribute=function(z,x,N){kn||Oo({});const q=Pe(z),X=Pe(x);return wl(q,X,N)},H.addHook=function(z,x){typeof x=="function"&&M(Le,z)&&S(Le[z],x)},H.removeHook=function(z,x){if(M(Le,z)){if(x!==void 0){const N=y(Le[z],x);return N===-1?void 0:k(Le[z],N,1)[0]}return b(Le[z])}},H.removeHooks=function(z){M(Le,z)&&(Le[z]=[])},H.removeAllHooks=function(){Le=Wa()},H}var fp=Va();return Mo=fp,Mo}var rg=self.DOMPurify||(self.DOMPurify=Vl().default||Vl());const Gu=Zs(rg);function ma(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var xn=ma();function ef(e){xn=e}var dr={exec:()=>null};function Ee(e,t=""){let n=typeof e=="string"?e:e.source;const r={replace:(s,o)=>{let i=typeof o=="string"?o:o.source;return i=i.replace(et.caret,"$1"),n=n.replace(s,i),r},getRegex:()=>new RegExp(n,t)};return r}var et={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")},sg=/^(?:[ \t]*(?:\n|$))+/,og=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ig=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,_r=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ag=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,ga=/(?:[*+-]|\d{1,9}[.)])/,tf=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,nf=Ee(tf).replace(/bull/g,ga).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(),lg=Ee(tf).replace(/bull/g,ga).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(),ya=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,cg=/^[^\n]+/,xa=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ug=Ee(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",xa).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fg=Ee(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,ga).getRegex(),Xs="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",ba=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,dg=Ee("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ba).replace("tag",Xs).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),rf=Ee(ya).replace("hr",_r).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",Xs).getRegex(),pg=Ee(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",rf).getRegex(),va={blockquote:pg,code:og,def:ug,fences:ig,heading:ag,hr:_r,html:dg,lheading:nf,list:fg,newline:sg,paragraph:rf,table:dr,text:cg},Kl=Ee("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",_r).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",Xs).getRegex(),hg={...va,lheading:lg,table:Kl,paragraph:Ee(ya).replace("hr",_r).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Kl).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",Xs).getRegex()},mg={...va,html:Ee(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ba).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:dr,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Ee(ya).replace("hr",_r).replace("heading",` *#{1,6} *[^
|
|
60
|
-
]`).replace("lheading",nf).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gg=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yg=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,sf=/^( {2,}|\\)\n(?!\s*$)/,xg=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Qs=/[\p{P}\p{S}]/u,wa=/[\s\p{P}\p{S}]/u,of=/[^\s\p{P}\p{S}]/u,bg=Ee(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wa).getRegex(),af=/(?!~)[\p{P}\p{S}]/u,vg=/(?!~)[\s\p{P}\p{S}]/u,wg=/(?:[^\s\p{P}\p{S}]|~)/u,Sg=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,lf=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jg=Ee(lf,"u").replace(/punct/g,Qs).getRegex(),Eg=Ee(lf,"u").replace(/punct/g,af).getRegex(),cf="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",kg=Ee(cf,"gu").replace(/notPunctSpace/g,of).replace(/punctSpace/g,wa).replace(/punct/g,Qs).getRegex(),Ag=Ee(cf,"gu").replace(/notPunctSpace/g,wg).replace(/punctSpace/g,vg).replace(/punct/g,af).getRegex(),Tg=Ee("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,of).replace(/punctSpace/g,wa).replace(/punct/g,Qs).getRegex(),Og=Ee(/\\(punct)/,"gu").replace(/punct/g,Qs).getRegex(),Ng=Ee(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Cg=Ee(ba).replace("(?:-->|$)","-->").getRegex(),_g=Ee("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Cg).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Rs=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Rg=Ee(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",Rs).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),uf=Ee(/^!?\[(label)\]\[(ref)\]/).replace("label",Rs).replace("ref",xa).getRegex(),ff=Ee(/^!?\[(ref)\](?:\[\])?/).replace("ref",xa).getRegex(),Ig=Ee("reflink|nolink(?!\\()","g").replace("reflink",uf).replace("nolink",ff).getRegex(),Sa={_backpedal:dr,anyPunctuation:Og,autolink:Ng,blockSkip:Sg,br:sf,code:yg,del:dr,emStrongLDelim:jg,emStrongRDelimAst:kg,emStrongRDelimUnd:Tg,escape:gg,link:Rg,nolink:ff,punctuation:bg,reflink:uf,reflinkSearch:Ig,tag:_g,text:xg,url:dr},Pg={...Sa,link:Ee(/^!?\[(label)\]\((.*?)\)/).replace("label",Rs).getRegex(),reflink:Ee(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Rs).getRegex()},Ai={...Sa,emStrongRDelimAst:Ag,emStrongLDelim:Eg,url:Ee(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},$g={...Ai,br:Ee(sf).replace("{2,}","*").getRegex(),text:Ee(Ai.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ts={normal:va,gfm:hg,pedantic:mg},sr={normal:Sa,gfm:Ai,breaks:$g,pedantic:Pg},Mg={"&":"&","<":"<",">":">",'"':""","'":"'"},Jl=e=>Mg[e];function At(e,t){if(t){if(et.escapeTest.test(e))return e.replace(et.escapeReplace,Jl)}else if(et.escapeTestNoEncode.test(e))return e.replace(et.escapeReplaceNoEncode,Jl);return e}function Yl(e){try{e=encodeURI(e).replace(et.percentDecode,"%")}catch{return null}return e}function Zl(e,t){var o;const n=e.replace(et.findPipe,(i,a,c)=>{let u=!1,f=a;for(;--f>=0&&c[f]==="\\";)u=!u;return u?"|":" |"}),r=n.split(et.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(et.slashPipe,"|");return r}function or(e,t,n){const r=e.length;if(r===0)return"";let s=0;for(;s<r&&e.charAt(r-s-1)===t;)s++;return e.slice(0,r-s)}function Lg(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]==="\\")r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Xl(e,t,n,r,s){const o=t.href,i=t.title||null,a=e[1].replace(s.other.outputLinkReplace,"$1");r.state.inLink=!0;const c={type:e[0].charAt(0)==="!"?"image":"link",raw:n,href:o,title:i,text:a,tokens:r.inlineTokens(a)};return r.state.inLink=!1,c}function Dg(e,t,n){const r=e.match(n.other.indentCodeCompensation);if(r===null)return t;const s=r[1];return t.split(`
|
|
61
|
-
`).map(o=>{const i=o.match(n.other.beginningSpace);if(i===null)return o;const[a]=i;return a.length>=s.length?o.slice(s.length):o}).join(`
|
|
62
|
-
`)}var Is=class{constructor(e){je(this,"options");je(this,"rules");je(this,"lexer");this.options=e||xn}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:or(n,`
|
|
63
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],r=Dg(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:r}}}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 r=or(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.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:or(t[0],`
|
|
64
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=or(t[0],`
|
|
65
|
-
`).split(`
|
|
66
|
-
`),r="",s="";const o=[];for(;n.length>0;){let i=!1;const a=[];let c;for(c=0;c<n.length;c++)if(this.rules.other.blockquoteStart.test(n[c]))a.push(n[c]),i=!0;else if(!i)a.push(n[c]);else break;n=n.slice(c);const u=a.join(`
|
|
67
|
-
`),f=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
68
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
69
|
-
${u}`:u,s=s?`${s}
|
|
70
|
-
${f}`:f;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=d,n.length===0)break;const p=o.at(-1);if((p==null?void 0:p.type)==="code")break;if((p==null?void 0:p.type)==="blockquote"){const h=p,m=h.raw+`
|
|
71
|
-
`+n.join(`
|
|
72
|
-
`),g=this.blockquote(m);o[o.length-1]=g,r=r.substring(0,r.length-h.raw.length)+g.raw,s=s.substring(0,s.length-h.text.length)+g.text;break}else if((p==null?void 0:p.type)==="list"){const h=p,m=h.raw+`
|
|
73
|
-
`+n.join(`
|
|
74
|
-
`),g=this.list(m);o[o.length-1]=g,r=r.substring(0,r.length-p.raw.length)+g.raw,s=s.substring(0,s.length-h.raw.length)+g.raw,n=m.substring(o.at(-1).raw.length).split(`
|
|
75
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const r=n.length>1,s={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");const o=this.rules.other.listItemRegex(n);let i=!1;for(;e;){let c=!1,u="",f="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let d=t[2].split(`
|
|
76
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,j=>" ".repeat(3*j.length)),p=e.split(`
|
|
77
|
-
`,1)[0],h=!d.trim(),m=0;if(this.options.pedantic?(m=2,f=d.trimStart()):h?m=t[1].length+1:(m=t[2].search(this.rules.other.nonSpaceChar),m=m>4?1:m,f=d.slice(m),m+=t[1].length),h&&this.rules.other.blankLine.test(p)&&(u+=p+`
|
|
78
|
-
`,e=e.substring(p.length+1),c=!0),!c){const j=this.rules.other.nextBulletRegex(m),y=this.rules.other.hrRegex(m),b=this.rules.other.fencesBeginRegex(m),S=this.rules.other.headingBeginRegex(m),k=this.rules.other.htmlBeginRegex(m);for(;e;){const w=e.split(`
|
|
79
|
-
`,1)[0];let E;if(p=w,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),E=p):E=p.replace(this.rules.other.tabCharGlobal," "),b.test(p)||S.test(p)||k.test(p)||j.test(p)||y.test(p))break;if(E.search(this.rules.other.nonSpaceChar)>=m||!p.trim())f+=`
|
|
80
|
-
`+E.slice(m);else{if(h||d.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||b.test(d)||S.test(d)||y.test(d))break;f+=`
|
|
81
|
-
`+p}!h&&!p.trim()&&(h=!0),u+=w+`
|
|
82
|
-
`,e=e.substring(w.length+1),d=E.slice(m)}}s.loose||(i?s.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(i=!0));let g=null,v;this.options.gfm&&(g=this.rules.other.listIsTask.exec(f),g&&(v=g[0]!=="[ ] ",f=f.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:u,task:!!g,checked:v,loose:!1,text:f,tokens:[]}),s.raw+=u}const a=s.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const u=s.items[c].tokens.filter(d=>d.type==="space"),f=u.length>0&&u.some(d=>this.rules.other.anyLine.test(d.raw));s.loose=f}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const n=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:r,title:s}}}table(e){var i;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const n=Zl(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=(i=t[3])!=null&&i.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
83
|
-
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(const a of r)this.rules.other.tableAlignRight.test(a)?o.align.push("right"):this.rules.other.tableAlignCenter.test(a)?o.align.push("center"):this.rules.other.tableAlignLeft.test(a)?o.align.push("left"):o.align.push(null);for(let a=0;a<n.length;a++)o.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:o.align[a]});for(const a of s)o.rows.push(Zl(a,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}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)===`
|
|
84
|
-
`?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 o=or(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Lg(t[2],"()");if(o===-2)return;if(o>-1){const a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],s=o[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),Xl(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return Xl(n,s,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&n.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...r[0]].length-1;let i,a,c=o,u=0;const f=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(r=f.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){c+=a;continue}else if((r[5]||r[6])&&o%3&&!((o+a)%3)){u+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+u);const d=[...r[0]][0].length,p=e.slice(0,o+r.index+d+a);if(Math.min(o,a)%2){const m=p.slice(1,-1);return{type:"em",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}const h=p.slice(2,-2);return{type:"strong",raw:p,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(n),s=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&s&&(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,r;return t[2]==="@"?(n=t[1],r="mailto:"+n):(n=t[1],r=n),{type:"link",raw:t[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let r,s;if(t[2]==="@")r=t[0],s="mailto:"+r;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?s="http://"+t[0]:s=t[0]}return{type:"link",raw:t[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}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}}}},Bt=class Ti{constructor(t){je(this,"tokens");je(this,"options");je(this,"state");je(this,"tokenizer");je(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||xn,this.options.tokenizer=this.options.tokenizer||new Is,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:et,block:ts.normal,inline:sr.normal};this.options.pedantic?(n.block=ts.pedantic,n.inline=sr.pedantic):this.options.gfm&&(n.block=ts.gfm,this.options.breaks?n.inline=sr.breaks:n.inline=sr.gfm),this.tokenizer.rules=n}static get rules(){return{block:ts,inline:sr}}static lex(t,n){return new Ti(n).lex(t)}static lexInline(t,n){return new Ti(n).inlineTokens(t)}lex(t){t=t.replace(et.carriageReturn,`
|
|
85
|
-
`),this.blockTokens(t,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){const r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,n=[],r=!1){var s,o,i;for(this.options.pedantic&&(t=t.replace(et.tabCharGlobal," ").replace(et.spaceLine,""));t;){let a;if((o=(s=this.options.extensions)==null?void 0:s.block)!=null&&o.some(u=>(a=u.call({lexer:this},t,n))?(t=t.substring(a.raw.length),n.push(a),!0):!1))continue;if(a=this.tokenizer.space(t)){t=t.substring(a.raw.length);const u=n.at(-1);a.raw.length===1&&u!==void 0?u.raw+=`
|
|
86
|
-
`:n.push(a);continue}if(a=this.tokenizer.code(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
87
|
-
`+a.raw,u.text+=`
|
|
88
|
-
`+a.text,this.inlineQueue.at(-1).src=u.text):n.push(a);continue}if(a=this.tokenizer.fences(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.heading(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.hr(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.blockquote(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.list(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.html(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.def(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
89
|
-
`+a.raw,u.text+=`
|
|
90
|
-
`+a.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[a.tag]||(this.tokens.links[a.tag]={href:a.href,title:a.title});continue}if(a=this.tokenizer.table(t)){t=t.substring(a.raw.length),n.push(a);continue}if(a=this.tokenizer.lheading(t)){t=t.substring(a.raw.length),n.push(a);continue}let c=t;if((i=this.options.extensions)!=null&&i.startBlock){let u=1/0;const f=t.slice(1);let d;this.options.extensions.startBlock.forEach(p=>{d=p.call({lexer:this},f),typeof d=="number"&&d>=0&&(u=Math.min(u,d))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(a=this.tokenizer.paragraph(c))){const u=n.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=`
|
|
91
|
-
`+a.raw,u.text+=`
|
|
92
|
-
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a),r=c.length!==t.length,t=t.substring(a.raw.length);continue}if(a=this.tokenizer.text(t)){t=t.substring(a.raw.length);const u=n.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=`
|
|
93
|
-
`+a.raw,u.text+=`
|
|
94
|
-
`+a.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):n.push(a);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 a,c,u;let r=t,s=null;if(this.tokens.links){const f=Object.keys(this.tokens.links);if(f.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)f.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,s.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(s=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)r=r.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);let o=!1,i="";for(;t;){o||(i=""),o=!1;let f;if((c=(a=this.options.extensions)==null?void 0:a.inline)!=null&&c.some(p=>(f=p.call({lexer:this},t,n))?(t=t.substring(f.raw.length),n.push(f),!0):!1))continue;if(f=this.tokenizer.escape(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.tag(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.link(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(f.raw.length);const p=n.at(-1);f.type==="text"&&(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(f=this.tokenizer.emStrong(t,r,i)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.codespan(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.br(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.del(t)){t=t.substring(f.raw.length),n.push(f);continue}if(f=this.tokenizer.autolink(t)){t=t.substring(f.raw.length),n.push(f);continue}if(!this.state.inLink&&(f=this.tokenizer.url(t))){t=t.substring(f.raw.length),n.push(f);continue}let d=t;if((u=this.options.extensions)!=null&&u.startInline){let p=1/0;const h=t.slice(1);let m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(p=Math.min(p,m))}),p<1/0&&p>=0&&(d=t.substring(0,p+1))}if(f=this.tokenizer.inlineText(d)){t=t.substring(f.raw.length),f.raw.slice(-1)!=="_"&&(i=f.raw.slice(-1)),o=!0;const p=n.at(-1);(p==null?void 0:p.type)==="text"?(p.raw+=f.raw,p.text+=f.text):n.push(f);continue}if(t){const p="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(p);break}else throw new Error(p)}}return n}},Ps=class{constructor(e){je(this,"options");je(this,"parser");this.options=e||xn}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const r=(o=(t||"").match(et.notSpaceStart))==null?void 0:o[0],s=e.replace(et.endingNewline,"")+`
|
|
95
|
-
`;return r?'<pre><code class="language-'+At(r)+'">'+(n?s:At(s,!0))+`</code></pre>
|
|
96
|
-
`:"<pre><code>"+(n?s:At(s,!0))+`</code></pre>
|
|
97
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
98
|
-
${this.parser.parse(e)}</blockquote>
|
|
99
|
-
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
100
|
-
`}hr(e){return`<hr>
|
|
101
|
-
`}list(e){const t=e.ordered,n=e.start;let r="";for(let i=0;i<e.items.length;i++){const a=e.items[i];r+=this.listitem(a)}const s=t?"ol":"ul",o=t&&n!==1?' start="'+n+'"':"";return"<"+s+o+`>
|
|
102
|
-
`+r+"</"+s+`>
|
|
103
|
-
`}listitem(e){var n;let t="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((n=e.tokens[0])==null?void 0:n.type)==="paragraph"?(e.tokens[0].text=r+" "+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=r+" "+At(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):t+=r+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`<li>${t}</li>
|
|
104
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
105
|
-
`}table(e){let t="",n="";for(let s=0;s<e.header.length;s++)n+=this.tablecell(e.header[s]);t+=this.tablerow({text:n});let r="";for(let s=0;s<e.rows.length;s++){const o=e.rows[s];n="";for(let i=0;i<o.length;i++)n+=this.tablecell(o[i]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
106
|
-
<thead>
|
|
107
|
-
`+t+`</thead>
|
|
108
|
-
`+r+`</table>
|
|
109
|
-
`}tablerow({text:e}){return`<tr>
|
|
110
|
-
${e}</tr>
|
|
111
|
-
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
112
|
-
`}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>${At(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 r=this.parser.parseInline(n),s=Yl(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+At(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));const s=Yl(e);if(s===null)return At(n);e=s;let o=`<img src="${e}" alt="${n}"`;return t&&(o+=` title="${At(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:At(e.text)}},ja=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""}},Ft=class Oi{constructor(t){je(this,"options");je(this,"renderer");je(this,"textRenderer");this.options=t||xn,this.options.renderer=this.options.renderer||new Ps,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ja}static parse(t,n){return new Oi(n).parse(t)}static parseInline(t,n){return new Oi(n).parseInline(t)}parse(t,n=!0){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=a,f=this.options.extensions.renderers[u.type].call({parser:this},u);if(f!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(u.type)){r+=f||"";continue}}const c=a;switch(c.type){case"space":{r+=this.renderer.space(c);continue}case"hr":{r+=this.renderer.hr(c);continue}case"heading":{r+=this.renderer.heading(c);continue}case"code":{r+=this.renderer.code(c);continue}case"table":{r+=this.renderer.table(c);continue}case"blockquote":{r+=this.renderer.blockquote(c);continue}case"list":{r+=this.renderer.list(c);continue}case"html":{r+=this.renderer.html(c);continue}case"paragraph":{r+=this.renderer.paragraph(c);continue}case"text":{let u=c,f=this.renderer.text(u);for(;i+1<t.length&&t[i+1].type==="text";)u=t[++i],f+=`
|
|
113
|
-
`+this.renderer.text(u);n?r+=this.renderer.paragraph({type:"paragraph",raw:f,text:f,tokens:[{type:"text",raw:f,text:f,escaped:!0}]}):r+=f;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 r}parseInline(t,n=this.renderer){var s,o;let r="";for(let i=0;i<t.length;i++){const a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){const u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}const c=a;switch(c.type){case"escape":{r+=n.text(c);break}case"html":{r+=n.html(c);break}case"link":{r+=n.link(c);break}case"image":{r+=n.image(c);break}case"strong":{r+=n.strong(c);break}case"em":{r+=n.em(c);break}case"codespan":{r+=n.codespan(c);break}case"br":{r+=n.br(c);break}case"del":{r+=n.del(c);break}case"text":{r+=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 r}},fi,ys=(fi=class{constructor(e){je(this,"options");je(this,"block");this.options=e||xn}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?Bt.lex:Bt.lexInline}provideParser(){return this.block?Ft.parse:Ft.parseInline}},je(fi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),fi),df=class{constructor(...e){je(this,"defaults",ma());je(this,"options",this.setOptions);je(this,"parse",this.parseMarkdown(!0));je(this,"parseInline",this.parseMarkdown(!1));je(this,"Parser",Ft);je(this,"Renderer",Ps);je(this,"TextRenderer",ja);je(this,"Lexer",Bt);je(this,"Tokenizer",Is);je(this,"Hooks",ys);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(const o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{const i=o;for(const a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(const a of i.rows)for(const c of a)n=n.concat(this.walkTokens(c.tokens,t));break}case"list":{const i=o;n=n.concat(this.walkTokens(i.items,t));break}default:{const i=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{const c=i[a].flat(1/0);n=n.concat(this.walkTokens(c,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const o=t.renderers[s.name];o?t.renderers[s.name]=function(...i){let a=s.renderer.apply(this,i);return a===!1&&(a=o.apply(this,i)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){const s=this.defaults.renderer||new Ps(this.defaults);for(const o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const i=o,a=n.renderer[i],c=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f||""}}r.renderer=s}if(n.tokenizer){const s=this.defaults.tokenizer||new Is(this.defaults);for(const o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const i=o,a=n.tokenizer[i],c=s[i];s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f}}r.tokenizer=s}if(n.hooks){const s=this.defaults.hooks||new ys;for(const o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const i=o,a=n.hooks[i],c=s[i];ys.passThroughHooks.has(o)?s[i]=u=>{if(this.defaults.async)return Promise.resolve(a.call(s,u)).then(d=>c.call(s,d));const f=a.call(s,u);return c.call(s,f)}:s[i]=(...u)=>{let f=a.apply(s,u);return f===!1&&(f=c.apply(s,u)),f}}r.hooks=s}if(n.walkTokens){const s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(o.call(this,i)),s&&(a=a.concat(s.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Bt.lex(e,t??this.defaults)}parser(e,t){return Ft.parse(e,t??this.defaults)}parseMarkdown(e){return(n,r)=>{const s={...r},o={...this.defaults,...s},i=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&s.async===!1)return i(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 i(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const a=o.hooks?o.hooks.provideLexer():e?Bt.lex:Bt.lexInline,c=o.hooks?o.hooks.provideParser():e?Ft.parse:Ft.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(u=>a(u,o)).then(u=>o.hooks?o.hooks.processAllTokens(u):u).then(u=>o.walkTokens?Promise.all(this.walkTokens(u,o.walkTokens)).then(()=>u):u).then(u=>c(u,o)).then(u=>o.hooks?o.hooks.postprocess(u):u).catch(i);try{o.hooks&&(n=o.hooks.preprocess(n));let u=a(n,o);o.hooks&&(u=o.hooks.processAllTokens(u)),o.walkTokens&&this.walkTokens(u,o.walkTokens);let f=c(u,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(u){return i(u)}}}onError(e,t){return n=>{if(n.message+=`
|
|
114
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+At(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},mn=new df;function ke(e,t){return mn.parse(e,t)}ke.options=ke.setOptions=function(e){return mn.setOptions(e),ke.defaults=mn.defaults,ef(ke.defaults),ke};ke.getDefaults=ma;ke.defaults=xn;ke.use=function(...e){return mn.use(...e),ke.defaults=mn.defaults,ef(ke.defaults),ke};ke.walkTokens=function(e,t){return mn.walkTokens(e,t)};ke.parseInline=mn.parseInline;ke.Parser=Ft;ke.parser=Ft.parse;ke.Renderer=Ps;ke.TextRenderer=ja;ke.Lexer=Bt;ke.lexer=Bt.lex;ke.Tokenizer=Is;ke.Hooks=ys;ke.parse=ke;ke.options;ke.setOptions;ke.use;ke.walkTokens;ke.parseInline;Ft.parse;Bt.lex;function Bg(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=Ql(t.lang);if(e.async)return Promise.resolve(e.highlight(t.text,n,t.lang||"")).then(Gl(t));const r=e.highlight(t.text,n,t.lang||"");if(r 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.");Gl(t)(r)},useNewRenderer:!0,renderer:{code(t,n,r){typeof t=="object"&&(r=t.escaped,n=t.lang,t=t.text);const s=Ql(n),o=s?e.langPrefix+tc(s):e.emptyLangClass,i=o?` class="${o}"`:"";return t=t.replace(/\n$/,""),`<pre><code${i}>${r?t:tc(t,!0)}
|
|
115
|
-
</code></pre>`}}}}function Ql(e){return(e||"").match(/\S*/)[0]}function Gl(e){return t=>{typeof t=="string"&&t!==e.text&&(e.escaped=!0,e.text=t)}}const pf=/[&<>"']/,Fg=new RegExp(pf.source,"g"),hf=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Ug=new RegExp(hf.source,"g"),Hg={"&":"&","<":"<",">":">",'"':""","'":"'"},ec=e=>Hg[e];function tc(e,t){if(t){if(pf.test(e))return e.replace(Fg,ec)}else if(hf.test(e))return e.replace(Ug,ec);return e}function mf(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const n=e[t],r=typeof n;(r==="object"||r==="function")&&!Object.isFrozen(n)&&mf(n)}),e}class nc{constructor(t){t.data===void 0&&(t.data={}),this.data=t.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function gf(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Yt(e,...t){const n=Object.create(null);for(const r in e)n[r]=e[r];return t.forEach(function(r){for(const s in r)n[s]=r[s]}),n}const qg="</span>",rc=e=>!!e.scope,zg=(e,{prefix:t})=>{if(e.startsWith("language:"))return e.replace("language:","language-");if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map((r,s)=>`${r}${"_".repeat(s+1)}`)].join(" ")}return`${t}${e}`};class Wg{constructor(t,n){this.buffer="",this.classPrefix=n.classPrefix,t.walk(this)}addText(t){this.buffer+=gf(t)}openNode(t){if(!rc(t))return;const n=zg(t.scope,{prefix:this.classPrefix});this.span(n)}closeNode(t){rc(t)&&(this.buffer+=qg)}value(){return this.buffer}span(t){this.buffer+=`<span class="${t}">`}}const sc=(e={})=>{const t={children:[]};return Object.assign(t,e),t};class Ea{constructor(){this.rootNode=sc(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(t){this.top.children.push(t)}openNode(t){const n=sc({scope:t});this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(t){return this.constructor._walk(t,this.rootNode)}static _walk(t,n){return typeof n=="string"?t.addText(n):n.children&&(t.openNode(n),n.children.forEach(r=>this._walk(t,r)),t.closeNode(n)),t}static _collapse(t){typeof t!="string"&&t.children&&(t.children.every(n=>typeof n=="string")?t.children=[t.children.join("")]:t.children.forEach(n=>{Ea._collapse(n)}))}}class Vg extends Ea{constructor(t){super(),this.options=t}addText(t){t!==""&&this.add(t)}startScope(t){this.openNode(t)}endScope(){this.closeNode()}__addSublanguage(t,n){const r=t.root;n&&(r.scope=`language:${n}`),this.add(r)}toHTML(){return new Wg(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function Sr(e){return e?typeof e=="string"?e:e.source:null}function yf(e){return bn("(?=",e,")")}function Kg(e){return bn("(?:",e,")*")}function Jg(e){return bn("(?:",e,")?")}function bn(...e){return e.map(n=>Sr(n)).join("")}function Yg(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function ka(...e){return"("+(Yg(e).capture?"":"?:")+e.map(r=>Sr(r)).join("|")+")"}function xf(e){return new RegExp(e.toString()+"|").exec("").length-1}function Zg(e,t){const n=e&&e.exec(t);return n&&n.index===0}const Xg=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function Aa(e,{joinWith:t}){let n=0;return e.map(r=>{n+=1;const s=n;let o=Sr(r),i="";for(;o.length>0;){const a=Xg.exec(o);if(!a){i+=o;break}i+=o.substring(0,a.index),o=o.substring(a.index+a[0].length),a[0][0]==="\\"&&a[1]?i+="\\"+String(Number(a[1])+s):(i+=a[0],a[0]==="("&&n++)}return i}).map(r=>`(${r})`).join(t)}const Qg=/\b\B/,bf="[a-zA-Z]\\w*",Ta="[a-zA-Z_]\\w*",vf="\\b\\d+(\\.\\d+)?",wf="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Sf="\\b(0b[01]+)",Gg="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",ey=(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=bn(t,/.*\b/,e.binary,/\b.*/)),Yt({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(n,r)=>{n.index!==0&&r.ignoreMatch()}},e)},jr={begin:"\\\\[\\s\\S]",relevance:0},ty={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[jr]},ny={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[jr]},ry={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/},Gs=function(e,t,n={}){const r=Yt({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const s=ka("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 r.contains.push({begin:bn(/[ ]+/,"(",s,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},sy=Gs("//","$"),oy=Gs("/\\*","\\*/"),iy=Gs("#","$"),ay={scope:"number",begin:vf,relevance:0},ly={scope:"number",begin:wf,relevance:0},cy={scope:"number",begin:Sf,relevance:0},uy={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[jr,{begin:/\[/,end:/\]/,relevance:0,contains:[jr]}]},fy={scope:"title",begin:bf,relevance:0},dy={scope:"title",begin:Ta,relevance:0},py={begin:"\\.\\s*"+Ta,relevance:0},hy=function(e){return Object.assign(e,{"on:begin":(t,n)=>{n.data._beginMatch=t[1]},"on:end":(t,n)=>{n.data._beginMatch!==t[1]&&n.ignoreMatch()}})};var ns=Object.freeze({__proto__:null,APOS_STRING_MODE:ty,BACKSLASH_ESCAPE:jr,BINARY_NUMBER_MODE:cy,BINARY_NUMBER_RE:Sf,COMMENT:Gs,C_BLOCK_COMMENT_MODE:oy,C_LINE_COMMENT_MODE:sy,C_NUMBER_MODE:ly,C_NUMBER_RE:wf,END_SAME_AS_BEGIN:hy,HASH_COMMENT_MODE:iy,IDENT_RE:bf,MATCH_NOTHING_RE:Qg,METHOD_GUARD:py,NUMBER_MODE:ay,NUMBER_RE:vf,PHRASAL_WORDS_MODE:ry,QUOTE_STRING_MODE:ny,REGEXP_MODE:uy,RE_STARTERS_RE:Gg,SHEBANG:ey,TITLE_MODE:fy,UNDERSCORE_IDENT_RE:Ta,UNDERSCORE_TITLE_MODE:dy});function my(e,t){e.input[e.index-1]==="."&&t.ignoreMatch()}function gy(e,t){e.className!==void 0&&(e.scope=e.className,delete e.className)}function yy(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=my,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,e.relevance===void 0&&(e.relevance=0))}function xy(e,t){Array.isArray(e.illegal)&&(e.illegal=ka(...e.illegal))}function by(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function vy(e,t){e.relevance===void 0&&(e.relevance=1)}const wy=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach(r=>{delete e[r]}),e.keywords=n.keywords,e.begin=bn(n.beforeMatch,yf(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},Sy=["of","and","for","in","not","or","if","then","parent","list","value"],jy="keyword";function jf(e,t,n=jy){const r=Object.create(null);return typeof e=="string"?s(n,e.split(" ")):Array.isArray(e)?s(n,e):Object.keys(e).forEach(function(o){Object.assign(r,jf(e[o],t,o))}),r;function s(o,i){t&&(i=i.map(a=>a.toLowerCase())),i.forEach(function(a){const c=a.split("|");r[c[0]]=[o,Ey(c[0],c[1])]})}}function Ey(e,t){return t?Number(t):ky(e)?0:1}function ky(e){return Sy.includes(e.toLowerCase())}const oc={},pn=e=>{console.error(e)},ic=(e,...t)=>{console.log(`WARN: ${e}`,...t)},Tn=(e,t)=>{oc[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),oc[`${e}/${t}`]=!0)},$s=new Error;function Ef(e,t,{key:n}){let r=0;const s=e[n],o={},i={};for(let a=1;a<=t.length;a++)i[a+r]=s[a],o[a+r]=!0,r+=xf(t[a-1]);e[n]=i,e[n]._emit=o,e[n]._multi=!0}function Ay(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw pn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$s;if(typeof e.beginScope!="object"||e.beginScope===null)throw pn("beginScope must be object"),$s;Ef(e,e.begin,{key:"beginScope"}),e.begin=Aa(e.begin,{joinWith:""})}}function Ty(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw pn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$s;if(typeof e.endScope!="object"||e.endScope===null)throw pn("endScope must be object"),$s;Ef(e,e.end,{key:"endScope"}),e.end=Aa(e.end,{joinWith:""})}}function Oy(e){e.scope&&typeof e.scope=="object"&&e.scope!==null&&(e.beginScope=e.scope,delete e.scope)}function Ny(e){Oy(e),typeof e.beginScope=="string"&&(e.beginScope={_wrap:e.beginScope}),typeof e.endScope=="string"&&(e.endScope={_wrap:e.endScope}),Ay(e),Ty(e)}function Cy(e){function t(i,a){return new RegExp(Sr(i),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(a?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(a,c){c.position=this.position++,this.matchIndexes[this.matchAt]=c,this.regexes.push([c,a]),this.matchAt+=xf(a)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const a=this.regexes.map(c=>c[1]);this.matcherRe=t(Aa(a,{joinWith:"|"}),!0),this.lastIndex=0}exec(a){this.matcherRe.lastIndex=this.lastIndex;const c=this.matcherRe.exec(a);if(!c)return null;const u=c.findIndex((d,p)=>p>0&&d!==void 0),f=this.matchIndexes[u];return c.splice(0,u),Object.assign(c,f)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(a){if(this.multiRegexes[a])return this.multiRegexes[a];const c=new n;return this.rules.slice(a).forEach(([u,f])=>c.addRule(u,f)),c.compile(),this.multiRegexes[a]=c,c}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(a,c){this.rules.push([a,c]),c.type==="begin"&&this.count++}exec(a){const c=this.getMatcher(this.regexIndex);c.lastIndex=this.lastIndex;let u=c.exec(a);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const f=this.getMatcher(0);f.lastIndex=this.lastIndex+1,u=f.exec(a)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function s(i){const a=new r;return i.contains.forEach(c=>a.addRule(c.begin,{rule:c,type:"begin"})),i.terminatorEnd&&a.addRule(i.terminatorEnd,{type:"end"}),i.illegal&&a.addRule(i.illegal,{type:"illegal"}),a}function o(i,a){const c=i;if(i.isCompiled)return c;[gy,by,Ny,wy].forEach(f=>f(i,a)),e.compilerExtensions.forEach(f=>f(i,a)),i.__beforeBegin=null,[yy,xy,vy].forEach(f=>f(i,a)),i.isCompiled=!0;let u=null;return typeof i.keywords=="object"&&i.keywords.$pattern&&(i.keywords=Object.assign({},i.keywords),u=i.keywords.$pattern,delete i.keywords.$pattern),u=u||/\w+/,i.keywords&&(i.keywords=jf(i.keywords,e.case_insensitive)),c.keywordPatternRe=t(u,!0),a&&(i.begin||(i.begin=/\B|\b/),c.beginRe=t(c.begin),!i.end&&!i.endsWithParent&&(i.end=/\B|\b/),i.end&&(c.endRe=t(c.end)),c.terminatorEnd=Sr(c.end)||"",i.endsWithParent&&a.terminatorEnd&&(c.terminatorEnd+=(i.end?"|":"")+a.terminatorEnd)),i.illegal&&(c.illegalRe=t(i.illegal)),i.contains||(i.contains=[]),i.contains=[].concat(...i.contains.map(function(f){return _y(f==="self"?i:f)})),i.contains.forEach(function(f){o(f,c)}),i.starts&&o(i.starts,a),c.matcher=s(c),c}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=Yt(e.classNameAliases||{}),o(e)}function kf(e){return e?e.endsWithParent||kf(e.starts):!1}function _y(e){return e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map(function(t){return Yt(e,{variants:null},t)})),e.cachedVariants?e.cachedVariants:kf(e)?Yt(e,{starts:e.starts?Yt(e.starts):null}):Object.isFrozen(e)?Yt(e):e}var Ry="11.11.1";class Iy extends Error{constructor(t,n){super(t),this.name="HTMLInjectionError",this.html=n}}const Lo=gf,ac=Yt,lc=Symbol("nomatch"),Py=7,Af=function(e){const t=Object.create(null),n=Object.create(null),r=[];let s=!0;const o="Could not find the language '{}', did you forget to load/include a language module?",i={disableAutodetect:!0,name:"Plain text",contains:[]};let a={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Vg};function c(_){return a.noHighlightRe.test(_)}function u(_){let M=_.className+" ";M+=_.parentNode?_.parentNode.className:"";const K=a.languageDetectRe.exec(M);if(K){const Y=C(K[1]);return Y||(ic(o.replace("{}",K[1])),ic("Falling back to no-highlight mode for this block.",_)),Y?K[1]:"no-highlight"}return M.split(/\s+/).find(Y=>c(Y)||C(Y))}function f(_,M,K){let Y="",$="";typeof M=="object"?(Y=_,K=M.ignoreIllegals,$=M.language):(Tn("10.7.0","highlight(lang, code, ...args) has been deprecated."),Tn("10.7.0",`Please use highlight(code, options) instead.
|
|
116
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),$=_,Y=M),K===void 0&&(K=!0);const B={code:Y,language:$};J("before:highlight",B);const D=B.result?B.result:d(B.language,B.code,K);return D.code=B.code,J("after:highlight",D),D}function d(_,M,K,Y){const $=Object.create(null);function B(W,V){return W.keywords[V]}function D(){if(!ee.keywords){$e.addText(we);return}let W=0;ee.keywordPatternRe.lastIndex=0;let V=ee.keywordPatternRe.exec(we),oe="";for(;V;){oe+=we.substring(W,V.index);const ye=Se.case_insensitive?V[0].toLowerCase():V[0],Me=B(ee,ye);if(Me){const[ht,lo]=Me;if($e.addText(oe),oe="",$[ye]=($[ye]||0)+1,$[ye]<=Py&&(It+=lo),ht.startsWith("_"))oe+=V[0];else{const co=Se.classNameAliases[ht]||ht;te(V[0],co)}}else oe+=V[0];W=ee.keywordPatternRe.lastIndex,V=ee.keywordPatternRe.exec(we)}oe+=we.substring(W),$e.addText(oe)}function L(){if(we==="")return;let W=null;if(typeof ee.subLanguage=="string"){if(!t[ee.subLanguage]){$e.addText(we);return}W=d(ee.subLanguage,we,!0,Ce[ee.subLanguage]),Ce[ee.subLanguage]=W._top}else W=h(we,ee.subLanguage.length?ee.subLanguage:null);ee.relevance>0&&(It+=W.relevance),$e.__addSublanguage(W._emitter,W.language)}function re(){ee.subLanguage!=null?L():D(),we=""}function te(W,V){W!==""&&($e.startScope(V),$e.addText(W),$e.endScope())}function me(W,V){let oe=1;const ye=V.length-1;for(;oe<=ye;){if(!W._emit[oe]){oe++;continue}const Me=Se.classNameAliases[W[oe]]||W[oe],ht=V[oe];Me?te(ht,Me):(we=ht,D(),we=""),oe++}}function I(W,V){return W.scope&&typeof W.scope=="string"&&$e.openNode(Se.classNameAliases[W.scope]||W.scope),W.beginScope&&(W.beginScope._wrap?(te(we,Se.classNameAliases[W.beginScope._wrap]||W.beginScope._wrap),we=""):W.beginScope._multi&&(me(W.beginScope,V),we="")),ee=Object.create(W,{parent:{value:ee}}),ee}function Q(W,V,oe){let ye=Zg(W.endRe,oe);if(ye){if(W["on:end"]){const Me=new nc(W);W["on:end"](V,Me),Me.isMatchIgnored&&(ye=!1)}if(ye){for(;W.endsParent&&W.parent;)W=W.parent;return W}}if(W.endsWithParent)return Q(W.parent,V,oe)}function ae(W){return ee.matcher.regexIndex===0?(we+=W[0],1):(dt=!0,0)}function se(W){const V=W[0],oe=W.rule,ye=new nc(oe),Me=[oe.__beforeBegin,oe["on:begin"]];for(const ht of Me)if(ht&&(ht(W,ye),ye.isMatchIgnored))return ae(V);return oe.skip?we+=V:(oe.excludeBegin&&(we+=V),re(),!oe.returnBegin&&!oe.excludeBegin&&(we=V)),I(oe,W),oe.returnBegin?0:V.length}function ue(W){const V=W[0],oe=M.substring(W.index),ye=Q(ee,W,oe);if(!ye)return lc;const Me=ee;ee.endScope&&ee.endScope._wrap?(re(),te(V,ee.endScope._wrap)):ee.endScope&&ee.endScope._multi?(re(),me(ee.endScope,W)):Me.skip?we+=V:(Me.returnEnd||Me.excludeEnd||(we+=V),re(),Me.excludeEnd&&(we=V));do ee.scope&&$e.closeNode(),!ee.skip&&!ee.subLanguage&&(It+=ee.relevance),ee=ee.parent;while(ee!==ye.parent);return ye.starts&&I(ye.starts,W),Me.returnEnd?0:V.length}function fe(){const W=[];for(let V=ee;V!==Se;V=V.parent)V.scope&&W.unshift(V.scope);W.forEach(V=>$e.openNode(V))}let pe={};function Ne(W,V){const oe=V&&V[0];if(we+=W,oe==null)return re(),0;if(pe.type==="begin"&&V.type==="end"&&pe.index===V.index&&oe===""){if(we+=M.slice(V.index,V.index+1),!s){const ye=new Error(`0 width match regex (${_})`);throw ye.languageName=_,ye.badRule=pe.rule,ye}return 1}if(pe=V,V.type==="begin")return se(V);if(V.type==="illegal"&&!K){const ye=new Error('Illegal lexeme "'+oe+'" for mode "'+(ee.scope||"<unnamed>")+'"');throw ye.mode=ee,ye}else if(V.type==="end"){const ye=ue(V);if(ye!==lc)return ye}if(V.type==="illegal"&&oe==="")return we+=`
|
|
117
|
-
`,1;if(rn>1e5&&rn>V.index*3)throw new Error("potential infinite loop, way more iterations than matches");return we+=oe,oe.length}const Se=C(_);if(!Se)throw pn(o.replace("{}",_)),new Error('Unknown language: "'+_+'"');const Xe=Cy(Se);let Ke="",ee=Y||Xe;const Ce={},$e=new a.__emitter(a);fe();let we="",It=0,ft=0,rn=0,dt=!1;try{if(Se.__emitTokens)Se.__emitTokens(M,$e);else{for(ee.matcher.considerAll();;){rn++,dt?dt=!1:ee.matcher.considerAll(),ee.matcher.lastIndex=ft;const W=ee.matcher.exec(M);if(!W)break;const V=M.substring(ft,W.index),oe=Ne(V,W);ft=W.index+oe}Ne(M.substring(ft))}return $e.finalize(),Ke=$e.toHTML(),{language:_,value:Ke,relevance:It,illegal:!1,_emitter:$e,_top:ee}}catch(W){if(W.message&&W.message.includes("Illegal"))return{language:_,value:Lo(M),illegal:!0,relevance:0,_illegalBy:{message:W.message,index:ft,context:M.slice(ft-100,ft+100),mode:W.mode,resultSoFar:Ke},_emitter:$e};if(s)return{language:_,value:Lo(M),illegal:!1,relevance:0,errorRaised:W,_emitter:$e,_top:ee};throw W}}function p(_){const M={value:Lo(_),illegal:!1,relevance:0,_top:i,_emitter:new a.__emitter(a)};return M._emitter.addText(_),M}function h(_,M){M=M||a.languages||Object.keys(t);const K=p(_),Y=M.filter(C).filter(T).map(re=>d(re,_,!1));Y.unshift(K);const $=Y.sort((re,te)=>{if(re.relevance!==te.relevance)return te.relevance-re.relevance;if(re.language&&te.language){if(C(re.language).supersetOf===te.language)return 1;if(C(te.language).supersetOf===re.language)return-1}return 0}),[B,D]=$,L=B;return L.secondBest=D,L}function m(_,M,K){const Y=M&&n[M]||K;_.classList.add("hljs"),_.classList.add(`language-${Y}`)}function g(_){let M=null;const K=u(_);if(c(K))return;if(J("before:highlightElement",{el:_,language:K}),_.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_);return}if(_.children.length>0&&(a.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(_)),a.throwUnescapedHTML))throw new Iy("One of your code blocks includes unescaped HTML.",_.innerHTML);M=_;const Y=M.textContent,$=K?f(Y,{language:K,ignoreIllegals:!0}):h(Y);_.innerHTML=$.value,_.dataset.highlighted="yes",m(_,K,$.language),_.result={language:$.language,re:$.relevance,relevance:$.relevance},$.secondBest&&(_.secondBest={language:$.secondBest.language,relevance:$.secondBest.relevance}),J("after:highlightElement",{el:_,result:$,text:Y})}function v(_){a=ac(a,_)}const j=()=>{S(),Tn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function y(){S(),Tn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let b=!1;function S(){function _(){S()}if(document.readyState==="loading"){b||window.addEventListener("DOMContentLoaded",_,!1),b=!0;return}document.querySelectorAll(a.cssSelector).forEach(g)}function k(_,M){let K=null;try{K=M(e)}catch(Y){if(pn("Language definition for '{}' could not be registered.".replace("{}",_)),s)pn(Y);else throw Y;K=i}K.name||(K.name=_),t[_]=K,K.rawDefinition=M.bind(null,e),K.aliases&&O(K.aliases,{languageName:_})}function w(_){delete t[_];for(const M of Object.keys(n))n[M]===_&&delete n[M]}function E(){return Object.keys(t)}function C(_){return _=(_||"").toLowerCase(),t[_]||t[n[_]]}function O(_,{languageName:M}){typeof _=="string"&&(_=[_]),_.forEach(K=>{n[K.toLowerCase()]=M})}function T(_){const M=C(_);return M&&!M.disableAutodetect}function P(_){_["before:highlightBlock"]&&!_["before:highlightElement"]&&(_["before:highlightElement"]=M=>{_["before:highlightBlock"](Object.assign({block:M.el},M))}),_["after:highlightBlock"]&&!_["after:highlightElement"]&&(_["after:highlightElement"]=M=>{_["after:highlightBlock"](Object.assign({block:M.el},M))})}function R(_){P(_),r.push(_)}function U(_){const M=r.indexOf(_);M!==-1&&r.splice(M,1)}function J(_,M){const K=_;r.forEach(function(Y){Y[K]&&Y[K](M)})}function Z(_){return Tn("10.7.0","highlightBlock will be removed entirely in v12.0"),Tn("10.7.0","Please use highlightElement now."),g(_)}Object.assign(e,{highlight:f,highlightAuto:h,highlightAll:S,highlightElement:g,highlightBlock:Z,configure:v,initHighlighting:j,initHighlightingOnLoad:y,registerLanguage:k,unregisterLanguage:w,listLanguages:E,getLanguage:C,registerAliases:O,autoDetection:T,inherit:ac,addPlugin:R,removePlugin:U}),e.debugMode=function(){s=!1},e.safeMode=function(){s=!0},e.versionString=Ry,e.regex={concat:bn,lookahead:yf,either:ka,optional:Jg,anyNumberOfTimes:Kg};for(const _ in ns)typeof ns[_]=="object"&&mf(ns[_]);return Object.assign(e,ns),e},Fn=Af({});Fn.newInstance=()=>Af({});var $y=Fn;Fn.HighlightJS=Fn;Fn.default=Fn;const vt=Zs($y);function My(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],s={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,s,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function Ly(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},s={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},i={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,s]},a=e.inherit(i,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),p={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},h={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},m={begin:/\{/,end:/\}/,contains:[h],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[h],illegal:"\\n",relevance:0},v=[r,{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}},p,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},m,g,o,i],j=[...v];return j.pop(),j.push(a),h.contains=j,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:v}}function Dy(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const s={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),i={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},a={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,s]};s.contains.push(a);const c={match:/\\"/},u={className:"string",begin:/'/,end:/'/},f={match:/\\'/},d={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},p=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],h=e.SHEBANG({binary:`(${p.join("|")})`,relevance:10}),m={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},g=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],v=["true","false"],j={match:/(\/[a-z._-]+)+/},y=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],b=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],S=["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"],k=["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:g,literal:v,built_in:[...y,...b,"set","shopt",...S,...k]},contains:[h,e.SHEBANG(),m,d,o,i,j,a,c,u,f,n]}}const cc="[A-Za-z$_][0-9A-Za-z$_]*",By=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Fy=["true","false","null","undefined","NaN","Infinity"],Tf=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Of=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Nf=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Uy=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Hy=[].concat(Nf,Tf,Of);function qy(e){const t=e.regex,n=(K,{after:Y})=>{const $="</"+K[0].slice(1);return K.input.indexOf($,Y)!==-1},r=cc,s={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,i={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,Y)=>{const $=K[0].length+K.index,B=K.input[$];if(B==="<"||B===","){Y.ignoreMatch();return}B===">"&&(n(K,{after:$})||Y.ignoreMatch());let D;const L=K.input.substring($);if(D=L.match(/^\s*=/)){Y.ignoreMatch();return}if((D=L.match(/^\s+extends\s+/))&&D.index===0){Y.ignoreMatch();return}}},a={$pattern:cc,keyword:By,literal:Fy,built_in:Hy,"variable.language":Uy},c="[0-9](_?[0-9])*",u=`\\.(${c})`,f="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",d={className:"number",variants:[{begin:`(\\b(${f})((${u})|\\.)?|(${u}))[eE][+-]?(${c})\\b`},{begin:`\\b(${f})\\b((${u})\\b|\\.)?|(${u})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},p={className:"subst",begin:"\\$\\{",end:"\\}",keywords:a,contains:[]},h={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"xml"}},m={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"css"}},g={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,p],subLanguage:"graphql"}},v={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,p]},y={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},b=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,{match:/\$\d+/},d];p.contains=b.concat({begin:/\{/,end:/\}/,keywords:a,contains:["self"].concat(b)});const S=[].concat(y,p.contains),k=S.concat([{begin:/(\s*)\(/,end:/\)/,keywords:a,contains:["self"].concat(S)}]),w={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k},E={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},C={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Tf,...Of]}},O={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},T={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[w],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function R(K){return t.concat("(?!",K.join("|"),")")}const U={match:t.concat(/\b/,R([...Nf,"super","import"].map(K=>`${K}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},J={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},Z={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},w]},_="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",M={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(_)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[w]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:a,exports:{PARAMS_CONTAINS:k,CLASS_REFERENCE:C},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),O,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,h,m,g,v,y,{match:/\$\d+/},d,C,{scope:"attr",match:r+t.lookahead(":"),relevance:0},M,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[y,e.REGEXP_MODE,{className:"function",begin:_,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:k}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:s.begin,end:s.end},{match:o},{begin:i.begin,"on:begin":i.isTrulyOpeningTag,end:i.end}],subLanguage:"xml",contains:[{begin:i.begin,end:i.end,skip:!0,contains:["self"]}]}]},T,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[w,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},J,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[w]},U,P,E,Z,{match:/\$[(.]/}]}}function zy(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],a={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},c={className:"meta",begin:/^(>>>|\.\.\.) /},u={className:"subst",begin:/\{/,end:/\}/,keywords:a,illegal:/#/},f={begin:/\{\{/,relevance:0},d={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,c,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,c,f,u]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,u]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,u]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},p="[0-9](_?[0-9])*",h=`(\\b(${p}))?\\.(${p})|\\b(${p})\\.`,m=`\\b|${r.join("|")}`,g={className:"number",relevance:0,variants:[{begin:`(\\b(${p})|(${h}))[eE][+-]?(${p})[jJ]?(?=${m})`},{begin:`(${h})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${m})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${m})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${m})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${m})`},{begin:`\\b(${p})[jJ](?=${m})`}]},v={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:a,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},j={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:a,contains:["self",c,g,d,e.HASH_COMMENT_MODE]}]};return u.contains=[d,g,c],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:a,illegal:/(<\/|\?)|=>/,contains:[c,g,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},d,v,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[j]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[g,j,d]}]}}vt.registerLanguage("json",My);vt.registerLanguage("yaml",Ly);vt.registerLanguage("bash",Dy);vt.registerLanguage("javascript",qy);vt.registerLanguage("python",zy);const Cf=new df(Bg({emptyLangClass:"hljs",langPrefix:"hljs language-",highlight(e,t){if(!vt.getLanguage(t))return e;try{return vt.highlight(e,{language:t}).value}catch{return e}}}));Cf.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 Wy(e){return Cf.parse(e)}const wt=({children:e,className:t=""})=>e?typeof e!="string"?l.jsx(l.Fragment,{children:e}):l.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-code:before:content-none prose-code:after:content-none prose-blockquote:text-foreground-muted prose-blockquote:border-border ${t}`,dangerouslySetInnerHTML:{__html:Gu.sanitize(Wy(e))}}):null;function Vy({className:e}){return l.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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 Ky({className:e}){return l.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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 Jy({className:e,...t}){return l.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",...t,children:l.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 Yy({className:e}){return l.jsx("svg",{className:e||"inline-block",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.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 ir({IconClass:e,term:t,visibleTerm:n=!0,text:r,href:s,vertical:o=!1,className:i=""}){const a=s?c=>l.jsx("a",{href:s,target:"_blank",...c}):c=>l.jsx("div",{...c});return l.jsxs("div",{className:`${!o&&"flex"} ${i}`,children:[l.jsx("dt",{children:l.jsxs(a,{className:"flex",children:[e&&l.jsx(e,{className:"w-5 h-5",title:`${r}`,alt:`${r}`}),n?l.jsx("span",{className:"pl-2 text-sm",children:t}):l.jsx("span",{className:"sr-only",children:t})]})}),l.jsxs("dd",{className:`${o&&"pt-2"} pl-2 text-sm`,children:[!n&&l.jsx(a,{children:r}),o&&l.jsx(a,{children:r})]})]})}function Oa({name:e,href:t,title:n}){return l.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 Zy({license:e,externalDocs:t,contact:n,tags:r,logo:s}){const o={licenseName:(e==null?void 0:e.name)??null,licenseUrl:(e==null?void 0:e.url)??null,externalDocsTitle:(t==null?void 0:t.description)??"External documentation",externalDocsUrl:(t==null?void 0:t.url)??null,externalDocsDescription:(t==null?void 0:t.description)??null,contactName:(n==null?void 0:n.name)??null,contactUrl:(n==null?void 0:n.url)??null,contactEmail:(n==null?void 0:n.email)??null,tags:r};return l.jsxs(l.Fragment,{children:[s&&l.jsx("div",{className:"hidden @lg:block mb-3",children:s}),l.jsxs("dl",{className:"flex flex-wrap @lg:flex-unwrap gap-2 ",children:[o.licenseName&&l.jsx(ir,{IconClass:Jy,text:`${o.licenseName} ${kl}`,term:kl,visibleTerm:!o.licenseName,href:o.licenseUrl,className:"text-foreground-secondary hover:text-pink-500"}),o.externalDocsUrl&&l.jsx(ir,{IconClass:Ys,text:Al,href:o.externalDocsUrl,term:Al,visibleTerm:!o.externalDocsTitle,className:"text-foreground-secondary hover:text-secondary-500"}),o.contactEmail&&l.jsx(ir,{IconClass:Vy,text:`${o.contactEmail}`,term:Jp,visibleTerm:!o.contactEmail,href:`mailto:${o.contactEmail}`,className:"text-foreground-secondary hover:text-green-500"}),o.contactUrl&&l.jsx(ir,{IconClass:Ky,text:`${o.contactName}`,term:Kp,visibleTerm:!o.contactName,href:o.contactUrl,className:"text-foreground-secondary hover:text-green-500"})]}),l.jsx("dl",{className:"mt-[10px]",children:o.tags&&l.jsx(ir,{IconClass:Yy,term:Yp,className:"mb-2 text-foreground-secondary inline-block",vertical:!0,text:o.tags&&l.jsx("div",{className:"flex flex-wrap gap-1 -ml-2",children:o.tags.map((i,a)=>{const c=i,u=c.externalDocs;return l.jsx(Oa,{href:u&&u.url,title:c.description||(u&&u.description?u.description:void 0),name:c.name},a)})})})})]})}const Xy=[/^x-parser-/i,/^x-lib-/i];function Qy(e){return Xy.some(t=>t.test(e))}const uc=new Map;function Gy(e){let t=uc.get(e);return t||(t=A.lazy(Qu[e]),uc.set(e,t)),t}const ex=e=>e.startsWith("x-"),_f=(e,t)=>e?e[t]:void 0;function tx({source:e,pathPrefix:t}){const{showExtensions:n}=Ve();if(!n||!e)return null;const r=Object.keys(e).filter(s=>ex(s)&&!Qy(s)&&Object.prototype.hasOwnProperty.call(Qu,s));return r.length===0?null:l.jsx(l.Fragment,{children:r.map(s=>{const o=Gy(s);return l.jsx(A.Suspense,{fallback:null,children:l.jsx(o,{value:_f(e,s),path:`${t}.${s}`})},s)})})}const nx=A.lazy(tg);function Rf({title:e,description:t,license:n,contact:r,externalDocs:s,tags:o,extensionsSource:i}){const a=_f(i,"x-logo"),c=a!==void 0&&l.jsx(A.Suspense,{fallback:null,children:l.jsx(nx,{value:a,path:"info.x-logo"})}),u=l.jsx("div",{className:"mt-4 w-full",children:l.jsx(wt,{children:t})}),f=l.jsxs(l.Fragment,{children:[l.jsx(Zy,{logo:c,license:n,externalDocs:s,contact:r,tags:o}),i&&l.jsx("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:l.jsx(tx,{source:i,pathPrefix:"info"})})]});return l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{title:e,content:u,sideContent:f,stickySideContent:!0,reverseLayoutOnMobile:!0,info:!0,mobileLeadContent:c})})}const If=e=>{const{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i}=e;return l.jsx(Rf,{title:t,description:n,license:r,externalDocs:s,contact:o,tags:i,extensionsSource:e})},rx=1500,sx=320,ox=48,ix="#011627";function ax(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 lx(e){try{return await navigator.clipboard.writeText(e),!0}catch{return ax(e)}}function Na({code:e,className:t,language:n="json",collapsedMaxHeight:r=sx}){const[s,o]=A.useState("idle"),i=A.useRef(void 0),[a,c]=A.useState(!1),[u,f]=A.useState(!1),[d,p]=A.useState(0),h=A.useRef(null),m=A.useRef(null),g=A.useId();A.useEffect(()=>()=>clearTimeout(i.current),[]),A.useEffect(()=>{const E=m.current;if(!E)return;const C=()=>{p(E.scrollHeight),f(E.scrollHeight>r+ox)};C();const O=new ResizeObserver(C);return O.observe(E),()=>O.disconnect()},[e,n,r]);const v=()=>{lx(e).then(E=>{o(E?"copied":"error"),clearTimeout(i.current),i.current=setTimeout(()=>o("idle"),rx)})},y=vt.getLanguage(n)?vt.highlight(e,{language:n}).value:null,b=s==="copied"?"Copied":s==="error"?"Copy failed":"Copy to clipboard",S=u&&!a,k=e.replace(/\n+$/,"").split(`
|
|
118
|
-
`).length,w=()=>{var E,C;a&&(((E=h.current)==null?void 0:E.getBoundingClientRect().top)??0)<0&&((C=h.current)==null||C.scrollIntoView({block:"nearest"})),c(O=>!O)};return l.jsxs("div",{ref:h,className:`relative ${t??""}`,children:[l.jsx("button",{type:"button",onClick:v,"aria-label":b,title:b,className:"absolute top-2 right-2 z-10 p-1 rounded text-foreground-muted hover:text-foreground-secondary hover:bg-neutral-100 transition-colors",children:s==="copied"?l.jsx(ia,{className:"w-4 h-4 text-green-600"}):l.jsx(oa,{className:`w-4 h-4 ${s==="error"?"text-red-500":""}`})}),l.jsxs("div",{className:"relative",children:[l.jsx("pre",{ref:m,id:g,style:u?{maxHeight:a?d:r}:void 0,className:`text-xs rounded overflow-x-auto transition-[max-height] duration-300 ease-in-out ${u?"overflow-y-hidden":""}`,children:y!==null?l.jsx("code",{className:`hljs language-${n}`,dangerouslySetInnerHTML:{__html:Gu.sanitize(y)}}):l.jsx("code",{className:"hljs",children:e})}),u&&l.jsx("div",{"aria-hidden":"true",className:`pointer-events-none absolute inset-x-0 bottom-0 h-16 rounded-b transition-opacity duration-300 ease-in-out ${S?"opacity-100":"opacity-0"}`,style:{background:`linear-gradient(to bottom, transparent, ${ix})`}})]}),u&&l.jsxs("button",{type:"button",onClick:w,"aria-expanded":a,"aria-controls":g,className:"flex items-center gap-1 mt-1 px-1 py-0.5 rounded text-xs text-foreground-muted hover:text-foreground-secondary transition-colors",children:[a?"Show less":`Show all ${k} lines`,l.jsx(Or,{className:`w-3 h-3 transition-transform ${a?"rotate-180":""}`})]})]})}const cx=/^x-parser-/i;function Ni(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(r=>Ni(r,t));const n={};for(const[r,s]of Object.entries(e))cx.test(r)||(n[r]=Ni(s,t));return n}finally{t.delete(e)}}return e}const Pf=({schema:e})=>{const t=typeof e=="string"?e:JSON.stringify(Ni(e),null,2);return l.jsx(Na,{code:t})},fc=new Set,Ca=e=>e.replace(/^#\//,"").split("/").pop()??e,Ci=e=>{const t=e["x-parser-schema-id"];return typeof t=="string"&&!t.startsWith("<")?t:void 0},ux={objects:new Set,refs:new Set},Lt=(e,t,n)=>{if(!e.$ref)return{schema:e,refLabel:Ci(e)};const r=e.$ref,s=Ca(r);if(n.has(r))return{schema:e,refLabel:s,circular:!0};const o=$t(t(r));if(!o)return{schema:e,refLabel:s};const{schema:i}=vr(o);n.add(r);try{const a=Lt(i,t,n);return{schema:a.schema,refLabel:a.circular?void 0:s,circular:a.circular}}finally{n.delete(r)}},gn=e=>{const t=e.items,n=Array.isArray(t)?t[0]:t;return ce(n)?n:null},$f=e=>{const t=e.items;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},fx=e=>!Array.isArray(e.items)||e.additionalItems===void 0?null:typeof e.additionalItems=="boolean"||ce(e.additionalItems)?e.additionalItems:null,dx=e=>e.contains===void 0?null:typeof e.contains=="boolean"||ce(e.contains)?e.contains:null,Mf=e=>e.contains!==void 0,Ms=(e,t)=>{if(!(!e&&!t))return!t||e===t?e??t:e?`${e}
|
|
119
|
-
|
|
120
|
-
${t}`:t},px=new Set(["allOf","oneOf","anyOf","not","if","then","else","_allOfConditionals","$ref","properties","patternProperties","propertyNames","additionalProperties","required","description","items"]),Jt=(e,t,n,r)=>{if(e===t)return e;const s={...e};if(t.description&&(s.description=Ms(typeof s.description=="string"?s.description:void 0,typeof t.description=="string"?t.description:void 0)),t.required&&(s.required=Array.from(new Set([...s.required??[],...t.required]))),t.properties){s.properties={...s.properties??{}};for(const[o,i]of Object.entries(t.properties)){if(!ce(i))continue;const a=s.properties[o];ce(a)?s.properties[o]=Jt(a,i):s.properties[o]=i}}if(t.items)if(Array.isArray(t.items))Array.isArray(s.items)?s.items=t.items.map((o,i)=>{const a=s.items[i];return ce(o)&&ce(a)?Jt(a,o):ce(o)?o:a}):s.items=t.items;else{const o=gn(t),i=gn(s);o&&i?s.items=Jt(i,o):o&&(s.items=t.items)}if(t.patternProperties&&ce(t.patternProperties)){const o={...ce(s.patternProperties)?s.patternProperties:{}};for(const[i,a]of Object.entries(t.patternProperties)){if(!ce(a)){o[i]=a;continue}const c=o[i];ce(c)?o[i]=Jt(c,a):o[i]=a}s.patternProperties=o}if(t.propertyNames!==void 0)if(ce(t.propertyNames)){const o=s.propertyNames;s.propertyNames=ce(o)?Jt(o,t.propertyNames):t.propertyNames}else s.propertyNames=t.propertyNames;if(t.additionalProperties!==void 0)if(ce(t.additionalProperties)){const o=s.additionalProperties;s.additionalProperties=ce(o)?Jt(o,t.additionalProperties):t.additionalProperties}else s.additionalProperties=t.additionalProperties;for(const[o,i]of Object.entries(t))px.has(o)||i===void 0||(s[o]=i);return s},dc=(e,t,n,r)=>{const s={...e};delete s.allOf,s.properties&&(s.properties=Object.fromEntries(Object.entries(s.properties).map(([u,f])=>ce(f)?[u,Ge(f,t,n,r)]:[u,f])));const o=gn(s);o&&(s.items=Ge(o,t,n,r));const i=Pr(s);i!==null&&ce(i)&&(s.propertyNames=Ge(i,t,n,r));const a=Vn(s);a!==null&&ce(a)&&(s.additionalProperties=Ge(a,t,n,r));const c=_a(s);return c.length>0&&(s.patternProperties=Object.fromEntries(c.map(([u,f])=>[u,Ge(f,t,n,r)]))),s},Ge=(e,t,n,r=new Set)=>{if(r.has(e))return e;r.add(e);try{const s=e.allOf;if(Array.isArray(s)&&s.length>0){const o=[];let i={};for(const f of s){if(!ce(f))continue;const{schema:d,circular:p}=Lt(f,t,n);if(p)continue;const h=Ge(d,t,n,r);if(h.if!==void 0){const m={if:h.if};h.then!==void 0&&(m.then=h.then),h.else!==void 0&&(m.else=h.else),o.push(m)}o.push(...Bf(h)),i=Jt(i,h,t,n)}if(e.if!==void 0){const f={if:e.if};e.then!==void 0&&(f.then=e.then),e.else!==void 0&&(f.else=e.else),o.push(f)}const a={...e};delete a.allOf;const c=Object.keys(a).length>0?Jt(i,a,t,n):i,u=dc(c,t,n,r);if(o.length===1){const f=o[0];u.if=f.if,f.then!==void 0&&(u.then=f.then),f.else!==void 0&&(u.else=f.else)}else o.length>1&&(u._allOfConditionals=o);return u}return dc(e,t,n,r)}finally{r.delete(e)}},Rr=e=>{const t=e.oneOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},Ir=e=>{const t=e.anyOf;if(!Array.isArray(t)||t.length===0)return null;const n=t.filter(r=>ce(r));return n.length>0?n:null},Lf=e=>e.not===void 0?null:typeof e.not=="boolean"||ce(e.not)?e.not:null,rt=e=>Lf(e)!==null,Df=e=>{const{not:t,...n}=e;return n},hx=e=>{const{if:t,then:n,else:r,...s}=e;return s},at=e=>e.if!==void 0,Do=e=>e===void 0?null:typeof e=="boolean"||ce(e)?e:null,Bf=e=>Array.isArray(e._allOfConditionals)?e._allOfConditionals.filter(t=>ce(t)):[],lt=e=>Array.isArray(e._allOfConditionals)&&e._allOfConditionals.length>0,Pr=e=>e.propertyNames===void 0?null:typeof e.propertyNames=="boolean"||ce(e.propertyNames)?e.propertyNames:null,Vn=e=>e.additionalProperties===void 0?null:typeof e.additionalProperties=="boolean"||ce(e.additionalProperties)?e.additionalProperties:null,_a=e=>{const t=e.patternProperties;return ce(t)?Object.entries(t).flatMap(([n,r])=>ce(r)?[[n,r]]:[]):[]},mx=(e,t)=>`${e}.[pattern:${t}]`,$r=e=>e.properties!==void 0&&Object.keys(e.properties).length>0,eo=e=>{const t=Pr(e);if(t!==null&&ce(t))return!0;const n=Vn(e);return n!==null&&ce(n)?!0:_a(e).length>0},Ff=e=>!!(Rr(e)||Ir(e)||$r(e)||eo(e)||e.type==="array"||e.items||e.type!==void 0),yt=e=>!(rt(e)||at(e)||lt(e)||Rr(e)||Ir(e)||$r(e)||eo(e)||e.items||Mf(e)||e.type==="array"||e.type==="object");function gx(e){if(typeof Vn(e)=="boolean")return!0;const n=Pr(e);return!!(typeof n=="boolean"||n!==null&&ce(n)&&yt(n)&&typeof n.pattern=="string"&&n.pattern.length>0)}function pc(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||gx(e)}const Uf=(e,t)=>pc(e)?!0:t?pc(t):!1,yx=(e,t)=>{if(rt(e)||at(e)||lt(e)||Rr(e)||Ir(e)||$r(e)||eo(e))return!0;if(e.type==="array"||e.items){if(Mf(e)||$f(e)!==null)return!0;const n=gn(e);if(!n)return!1;if(n.$ref&&t){const{schema:r}=Lt(n,t,fc),s=Ge(r,t,fc);return!yt(s)}return!yt(n)}return!1};function Hf(e){return JSON.stringify(e)}function hc(e){return typeof e=="string"?e:JSON.stringify(e)}function ut({children:e}){return l.jsx("span",{className:"text-xs text-foreground-muted",children:e})}function qf({children:e,mono:t=!1,title:n}){return l.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?l.jsx("span",{className:"font-mono text-foreground",children:e}):e})}function xx(e){return typeof e.exclusiveMinimum=="number"?{value:e.exclusiveMinimum,op:"<"}:typeof e.minimum=="number"?{value:e.minimum,op:"≤"}:null}function bx(e){return typeof e.exclusiveMaximum=="number"?{value:e.exclusiveMaximum,op:"<"}:typeof e.maximum=="number"?{value:e.maximum,op:"≤"}:null}function vx(e){return typeof e.minLength=="number"?{value:e.minLength,op:"≤"}:null}function wx(e){return typeof e.maxLength=="number"?{value:e.maxLength,op:"≤"}:null}function mc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function gc(e,t){const n=e[t];return typeof n=="number"?{value:n,op:"≤"}:null}function rs({name:e,lower:t,upper:n,suffix:r}){return!t&&!n?null:l.jsxs("span",{className:"inline-flex items-center gap-1",children:[t&&l.jsxs(l.Fragment,{children:[l.jsx(ut,{children:String(t.value)}),l.jsx(ut,{children:t.op})]}),l.jsx(ut,{children:e}),n&&l.jsxs(l.Fragment,{children:[l.jsx(ut,{children:n.op}),l.jsx(ut,{children:String(n.value)})]}),r&&l.jsx(ut,{children:r})]})}function xs({value:e,displayValue:t}){const n=()=>{var o;(o=window.getSelection())!=null&&o.toString()||navigator.clipboard.writeText(hc(e))},r=s=>{s.key!=="Enter"&&s.key!==" "||(s.preventDefault(),navigator.clipboard.writeText(hc(e)))};return l.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:r,children:t??Hf(e)})}function Sx({schema:e}){const t=Vn(e);return typeof t!="boolean"?null:l.jsx(ut,{children:t?"additional properties allowed":"additional properties not allowed"})}function jx({schema:e}){const t=Pr(e);return typeof t=="boolean"?l.jsx(qf,{children:t?"any property name":"no property names"}):t!==null&&ce(t)&&yt(t)&&typeof t.pattern=="string"&&t.pattern.length>0?l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ut,{children:"property name pattern:"}),l.jsx(xs,{value:t.pattern,displayValue:t.pattern})]}):null}function yc({schema:e,rangeName:t="value"}){const n=Array.isArray(e.enum)&&e.enum.length>0?e.enum:null,r=xx(e),s=bx(e),o=vx(e),i=wx(e),a=mc(e,"minItems"),c=gc(e,"maxItems"),u=mc(e,"minProperties"),f=gc(e,"maxProperties");return l.jsxs(l.Fragment,{children:[typeof e.multipleOf=="number"&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ut,{children:"multiple of :"}),l.jsx(qf,{children:String(e.multipleOf)})]}),(r||s)&&l.jsx(rs,{name:t,lower:r,upper:s}),(o||i)&&l.jsx(rs,{name:t,lower:o,upper:i,suffix:"chars"}),(a||c)&&l.jsx(rs,{name:t,lower:a,upper:c,suffix:"items"}),(u||f)&&l.jsx(rs,{name:t,lower:u,upper:f,suffix:"props"}),typeof e.pattern=="string"&&e.pattern.length>0&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ut,{children:"regex pattern:"}),l.jsx(xs,{value:e.pattern,displayValue:e.pattern})]}),n&&l.jsxs("span",{className:"inline-flex flex-wrap items-center gap-1",children:[l.jsx(ut,{children:"enum values:"}),n.map((d,p)=>l.jsx(xs,{value:d},`${p}-${Hf(d)}`))]}),e.const!==void 0&&l.jsxs("span",{className:"inline-flex items-center gap-1",children:[l.jsx(ut,{children:"const value:"}),l.jsx(xs,{value:e.const})]}),e.uniqueItems===!0&&l.jsx(ut,{children:"unique"}),l.jsx(Sx,{schema:e}),l.jsx(jx,{schema:e})]})}function zf({schema:e,itemSchema:t,fieldName:n,className:r="flex flex-col gap-1"}){const s=t!=null&&yt(t),o=n??"value";return l.jsxs("div",{className:r,children:[l.jsx(yc,{schema:e,rangeName:o}),s&&l.jsx(yc,{schema:t,rangeName:"item"})]})}const Wf=(e,t)=>{const n=Rr(e);if(n)return{text:`one of (${n.length})`};const r=Ir(e);if(r)return{text:`any of (${r.length})`};if(rt(e)&&!Ff(Df(e)))return{text:"not"};if(e.type==="array"||e.items){const u=gn(e);if(u){const f=u.type;if(f==="object"){const d=u.$ref?Ca(u.$ref):t;return d?{text:"Array of objects",refHint:d}:{text:"Array of objects"}}if(typeof f=="string"){const d=typeof u.format=="string"?u.format:void 0;return{text:`Array of ${f}`,format:d}}}return{text:"array"}}const s=Array.isArray(e.type)?e.type.join(" | "):e.type;let o=s?`${s}`:"type: unknown";const i=Vn(e);!$r(e)&&i!==null&&ce(i)&&(s==="object"||o==="type: unknown")&&(o=s==="object"?"object (map)":"map");const a=typeof e.format=="string"?e.format:void 0,c=t&&(s==="object"||o.startsWith("object"))?t:void 0;return{text:o,format:a,refHint:c}},Ex=(e,t)=>{if(!t)return!1;const n=Wf(e,t);return!n.refHint&&!n.text.includes(`(${t})`)};function Vf({schema:e,refLabel:t,className:n="text-xs text-foreground-muted"}){const{text:r,format:s,refHint:o}=Wf(e,t);return l.jsxs("span",{className:n,children:[s??r,o&&!r.includes(`(${o})`)&&l.jsxs("span",{className:"text-foreground-muted",children:[" (",o,")"]})]})}const xc="ml-6";function ss({schema:e,showBorder:t=!0}){const n=typeof e.description=="string"?e.description:void 0;return l.jsxs("div",{className:`py-2 ${t?"border-b border-border last:border-b-0":""}`,children:[l.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[l.jsx("span",{className:"w-4 shrink-0","aria-hidden":"true"}),l.jsx(Vf,{schema:e})]}),Uf(e)&&l.jsx(zf,{schema:e,className:`flex flex-col gap-1 mt-1 ${xc}`}),n&&n.split(`
|
|
121
|
-
|
|
122
|
-
`).map((r,s)=>l.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${xc} leading-relaxed`,children:r},s))]})}function Bo({children:e}){return l.jsxs("div",{className:"py-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.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:"}),l.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),e]})}function kx({value:e}){const t=e?"any value":"false schema";return l.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 Kf({tabs:e,selected:t,onChange:n,ariaLabel:r}){const s=A.useRef([]),o=a=>(a+e.length)%e.length,i=(a,c)=>{var f;let u=c;a.key==="ArrowRight"&&(a.preventDefault(),u=o(c+1)),a.key==="ArrowLeft"&&(a.preventDefault(),u=o(c-1)),a.key==="Home"&&(a.preventDefault(),u=0),a.key==="End"&&(a.preventDefault(),u=e.length-1),u!==c&&(n(e[u].id),(f=s.current[u])==null||f.focus())};return l.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":r,children:e.map(({id:a,label:c},u)=>{const f=a===t;return l.jsx("button",{ref:d=>{s.current[u]=d},type:"button",role:"tab","aria-selected":f,tabIndex:0,onClick:()=>n(a),onKeyDown:d=>i(d,u),className:f?"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},a)})})}function Ax({variant:e="oneOf",caseCount:t,caseLabels:n,selectedCase:r,onSelectCase:s,children:o}){if(t===0)return null;const i=(n==null?void 0:n.length)===t?n:Array.from({length:t},(u,f)=>`case ${f+1}`),a=e==="anyOf"?"Any of:":"One of:",c=e==="anyOf"?"Any of cases":"One of cases";return l.jsxs("div",{className:"py-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.jsx("span",{className:"inline-block px-2 py-0.5 text-xs font-medium text-foreground-secondary border border-border rounded-md bg-surface",children:a}),l.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),l.jsx(Kf,{tabs:i.map((u,f)=>({id:String(f),label:u})),selected:String(r),onChange:u=>s(Number(u)),ariaLabel:c}),l.jsx("div",{role:"tabpanel",className:"mt-2",children:o})]})}const Tx="ml-0 border-dashed border-border";function cn({depth:e,children:t,lineVariant:n="depth"}){const{depthColors:r}=Ve();return n==="none"?l.jsx("div",{children:t}):n==="muted"?l.jsx("div",{className:`pl-3 border-l-2 ${Tx}`,children:t}):l.jsx("div",{className:"pl-3 border-l-2 ml-1.5",style:{borderColor:Yi(e,r)},children:t})}function Ox({depth:e,expanded:t,onToggle:n}){const{depthColors:r}=Ve(),s=Yi(e,r);return l.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:[l.jsx("span",{"aria-hidden":"true",className:"w-4 h-4 rounded-full border-2 flex items-center justify-center text-[10px] leading-none font-bold hover:bg-neutral-100",style:{borderColor:s,color:s},children:t?"−":"+"}),!t&&l.jsx("span",{className:"text-xs text-foreground-muted",children:"Show details"})]})}const Nx="ml-6";function nt({id:e,path:t,depth:n,schema:r,refLabel:s,itemSchema:o,typeLabelOverride:i,required:a,description:c,expandable:u,expanded:f,onToggle:d,showBorder:p=!0}){const{depthColors:h}=Ve(),m=Yi(n,h),g=r&&Ex(r,s),v=u?Nx:"";let j="",y=t;if(t.endsWith("[]")){const b=t.slice(0,-2),S=b.lastIndexOf(".");S>=0?(j=b.slice(0,S+1),y=`${b.slice(S+1)}[]`):y=t}else{const b=t.lastIndexOf("."),S=t.lastIndexOf("[]"),k=Math.max(b,S);k>=0&&(j=t.slice(0,k+(t[k]==="."?1:2)),y=t.slice(k+(t[k]==="."?1:2)))}return p=p&&!f,l.jsxs("div",{id:e,className:`py-2 ${p?"border-b border-border last:border-b-0":""}`,children:[l.jsxs("div",{className:"flex items-center gap-2 min-h-[24px]",children:[l.jsxs("span",{className:"text-xs font-mono flex-1 min-w-0 flex items-center",children:[l.jsxs("span",{className:"truncate min-w-0",children:[j&&l.jsx("span",{className:"text-foreground-muted",children:j}),l.jsx("span",{className:"font-semibold",style:{color:m},children:y})]}),a&&l.jsx("span",{className:"shrink-0 text-red-500 ml-2 text-[10px]",children:"required"}),(r==null?void 0:r.readOnly)===!0&&l.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"readOnly"}),(r==null?void 0:r.writeOnly)===!0&&l.jsx("span",{className:"shrink-0 text-foreground-muted ml-2 text-[10px]",children:"writeOnly"}),(r==null?void 0:r.deprecated)===!0&&l.jsx("span",{className:"shrink-0 text-amber-600 ml-2 text-[10px]",children:"deprecated"})]}),r?l.jsxs("div",{className:"shrink-0 text-right",children:[l.jsx(Vf,{schema:r,refLabel:s}),g&&l.jsxs("span",{className:"text-xs text-foreground-muted",children:[" (ref: ",s,")"]})]}):i&&l.jsx("span",{className:"text-xs text-foreground-muted shrink-0",children:i})]}),r&&Uf(r,o)&&l.jsx(zf,{schema:r,itemSchema:o,fieldName:y,className:`flex flex-col gap-1 mt-1 ${v}`}),c&&c.split(`
|
|
123
|
-
|
|
124
|
-
`).map((b,S)=>l.jsx("p",{className:`text-xs text-foreground-muted mt-1 ${v} leading-relaxed`,children:b},S)),u&&l.jsx(Ox,{depth:n,expanded:f,onToggle:d})]})}function Fo({label:e,children:t}){return l.jsxs("div",{children:[l.jsx("div",{className:"pt-2 pb-0.5 first:pt-0",children:l.jsx("span",{className:"text-xs font-medium text-foreground-secondary",children:e})}),l.jsx("div",{children:t})]})}function Cx({ifContent:e,thenContent:t,elseContent:n}){return l.jsxs("div",{className:"py-2 pt-5 px-1",children:[l.jsx("div",{className:"flex flex-col items-start",children:l.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:"})}),l.jsx(cn,{depth:0,lineVariant:"muted",children:l.jsxs("div",{className:"divide-y divide-border",children:[l.jsx(Fo,{label:"If schema matches:",children:e}),t!=null&&l.jsx(Fo,{label:"Then schema should follow:",children:t}),n!=null&&l.jsx(Fo,{label:"Else schema should follow:",children:n})]})})]})}function os({label:e,children:t}){return l.jsxs("div",{className:"py-2",children:[l.jsxs("div",{className:"flex flex-col items-start",children:[l.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}),l.jsx("div",{className:"w-px h-3 bg-border ml-[1.125rem]","aria-hidden":"true"})]}),t]})}const _x=e=>e==="none"?"depth":e;function gt({schema:e,path:t,depth:n,required:r,refStack:s,deref:o,suppressRow:i=!1,branchLineVariant:a="depth",defaultExpanded:c=!1,ancestors:u=ux,focusTokens:f=null,focusId:d=null}){var me;const p=_x(a),h=f!=null,g=h&&f.length===0?d??void 0:void 0,[v,j]=A.useState(c||h),[y,b]=A.useState(c);y!==c&&(b(c),j(c||h)),A.useEffect(()=>{h&&j(!0)},[h]);const[S,k]=A.useState(0),w=(me=f==null?void 0:f[0])==null?void 0:me.match(/^(?:oneOf|anyOf)\[(\d+)\]$/),E=w?Number(w[1]):-1;A.useEffect(()=>{E>=0&&k(E)},[E]);const C=ha(),{schema:O,refLabel:T,circular:P}=A.useMemo(()=>{if(u.objects.has(e)||typeof e.$ref=="string"&&u.refs.has(e.$ref))return{schema:e,refLabel:Ci(e),circular:!0};const I=Lt(e,o,s);return I.circular?I:{...I,schema:Ge(I.schema,o,s)}},[e,o,s,u,C]),R=A.useMemo(()=>({objects:new Set(u.objects).add(e),refs:typeof e.$ref=="string"?new Set(u.refs).add(e.$ref):u.refs}),[u,e]),U=Df(hx(O)),J=!Ff(U)&&(rt(O)||at(O)||lt(O)),Z=()=>{const I=Lf(O);if(I===null)return null;if(typeof I=="boolean")return l.jsx(Bo,{children:l.jsx(kx,{value:I})});const Q=Lt(I,o,s);if(Q.circular)return l.jsx(Bo,{children:l.jsx(nt,{path:t,depth:n+1,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1})});const ae=Ge(Q.schema,o,s),se=yt(ae);return l.jsx(Bo,{children:se?l.jsx(ss,{schema:ae,showBorder:!1}):l.jsx(gt,{schema:I,path:t,depth:n+1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:p,defaultExpanded:c})})},_=(I,Q)=>{if(typeof I=="boolean")return l.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:I?"any value":"false schema"});const ae=Lt(I,o,s);if(ae.circular)return l.jsx(nt,{path:Q,depth:n+1,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const se=Ge(ae.schema,o,s);return yt(se)?l.jsx(ss,{schema:se,showBorder:!1}):l.jsx(gt,{schema:I,path:Q,depth:n+1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c})},M=I=>{const Q=Do(I.if);if(Q===null)return null;const ae=Do(I.then),se=Do(I.else);return l.jsx(Cx,{ifContent:_(Q,t),thenContent:ae!==null?_(ae,t):void 0,elseContent:se!==null?_(se,t):void 0})},K=()=>{const I=Bf(O);return I.length===0?null:l.jsx(l.Fragment,{children:I.map((Q,ae)=>l.jsx("div",{children:M(Q)},ae))})};if(P)return l.jsx(nt,{id:g,path:t,depth:n,typeLabelOverride:`↩ ${e.$ref??T??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{}});if(J){const I=l.jsxs(l.Fragment,{children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?I:l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:T,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Q=>!Q)}),v&&l.jsx(cn,{depth:n,lineVariant:a,children:I})]})}const Y=Rr(U),$=Ir(U),B=Y??$,D=Y?"oneOf":"anyOf";if(B){const I=B.map((Ke,ee)=>typeof Ke.title=="string"?Ke.title:`case ${ee+1}`),Q=i?1:n+1,ae=B[S],se=Lt(ae,o,s),ue=se.circular?se.schema:Ge(se.schema,o,s),fe=!se.circular&&yt(ue),pe=f&&E===S?f.slice(1):null,Ne=fe?l.jsx(ss,{schema:ue,showBorder:!1}):l.jsx(gt,{schema:ae,path:t,depth:Q-1,refStack:s,deref:o,ancestors:R,suppressRow:!0,branchLineVariant:"none",defaultExpanded:c,focusTokens:pe,focusId:d},S),Se=l.jsx(Ax,{variant:D,caseCount:B.length,caseLabels:I,selectedCase:S,onSelectCase:k,children:Ne}),Xe=l.jsxs(l.Fragment,{children:[Se,rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?Xe:l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:T,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Ke=>!Ke)}),v&&l.jsx(cn,{depth:n,lineVariant:a,children:Xe})]})}const L=(I,Q,ae)=>{const se=Lt(I,o,s);if(se.circular)return l.jsx(nt,{path:Q,depth:ae,typeLabelOverride:`↩ ${I.$ref}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1});const ue=Ge(se.schema,o,s);return yt(ue)?l.jsx(ss,{schema:ue,showBorder:!1}):l.jsx(gt,{schema:I,path:Q,depth:ae,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:c})},re=I=>{const Q=U.properties??{},ae=new Set(U.required??[]),se=Pr(U),ue=Vn(U),fe=_a(U);return l.jsxs(l.Fragment,{children:[Object.entries(Q).map(([pe,Ne])=>{if(!ce(Ne))return null;const Se=f&&f[0]==="properties"&&f[1]===pe?f.slice(2):null;return l.jsx(gt,{schema:Ne,path:`${t}.${pe}`,depth:I,required:ae.has(pe),refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:c,focusTokens:Se,focusId:d},pe)}),se!==null&&ce(se)&&l.jsx(os,{label:"Property names must adhere to:",children:L(se,`${t}.[propertyName]`,I)}),fe.map(([pe,Ne])=>l.jsx(gt,{schema:Ne,path:mx(t,pe),depth:I,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:c},pe)),ue!==null&&ce(ue)&&l.jsx(os,{label:"Additional properties must adhere to:",children:L(ue,`${t}.[additionalProperty]`,I)}),rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]})};if($r(U)||eo(U))return i?re(n+1):l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:T,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(I=>!I)}),v&&l.jsx(cn,{depth:n,lineVariant:a,children:re(n+1)})]});if(U.type==="array"||U.items){const I=$f(U),Q=I!==null,ae=Q?fx(U):null,se=dx(U),ue=se!==null,fe=Q?null:gn(U),pe=fe!==null,Ne=Q||pe||ue||rt(O)||at(O)||lt(O),Se=`${t}[]`,Xe=i?t:Se,Ke=pe?Lt(fe,o,s):null,ee=(Ke==null?void 0:Ke.schema)??null,Ce=ee?Ge(ee,o,s):null,$e=ee!==null&&(R.objects.has(ee)||typeof(fe==null?void 0:fe.$ref)=="string"&&R.refs.has(fe.$ref)),we=ee!==null?{objects:new Set(R.objects).add(ee),refs:typeof(fe==null?void 0:fe.$ref)=="string"?new Set(R.refs).add(fe.$ref):R.refs}:R,It=!Q&&!ue&&Ce!==null&&yt(Ce),ft=Ce!=null&&Ce.properties?Object.entries(Ce.properties).filter(([,V])=>ce(V)):[],rn=new Set(Ce&&Array.isArray(Ce.required)?Ce.required:[]),dt=!Q&&f&&f[0]==="items"?f.slice(1):null,W=V=>l.jsxs(l.Fragment,{children:[Q?l.jsxs(l.Fragment,{children:[I.map((oe,ye)=>l.jsx(gt,{schema:oe,path:`${t}[${ye}]`,depth:V,refStack:s,deref:o,ancestors:R,branchLineVariant:p,defaultExpanded:c},ye)),ae!==null&&typeof ae!="boolean"&&l.jsx(os,{label:"Additional items:",children:L(ae,`${t}[*]`,V)}),ae===!1&&l.jsx("div",{className:"py-1 pl-6 text-xs text-foreground-muted",children:"no additional items allowed"})]}):pe&&($e?l.jsx(nt,{path:Xe,depth:V,typeLabelOverride:`↩ ${fe.$ref??Ci(ee)??"circular"}`,expandable:!1,expanded:!1,onToggle:()=>{},showBorder:!1}):ft.length>0?ft.map(([oe,ye])=>{const Me=dt&&dt[0]==="properties"&&dt[1]===oe?dt.slice(2):null;return l.jsx(gt,{schema:ye,path:`${Xe}.${oe}`,depth:V,required:rn.has(oe),refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:c,focusTokens:Me,focusId:d},oe)}):l.jsx(gt,{schema:fe,path:Xe,depth:V,refStack:s,deref:o,ancestors:we,branchLineVariant:p,defaultExpanded:c,focusTokens:dt,focusId:d})),ue&&l.jsx(os,{label:"Contains at least one:",children:typeof se=="boolean"?l.jsx("span",{className:"inline-flex items-center rounded-md bg-neutral-100 px-2 py-1 text-xs font-medium text-foreground-secondary",children:se?"any item":"impossible constraint"}):L(se,`${t}[contains]`,V)}),rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return It&&!rt(O)&&!at(O)&&!lt(O)?l.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:T,required:r,description:Ms(O.description,Ce.description),expandable:!1,expanded:!1,onToggle:()=>{}}):It?l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:T,required:r,description:Ms(O.description,Ce.description),expandable:!0,expanded:v,onToggle:()=>j(V=>!V)}),v&&l.jsxs(cn,{depth:n,lineVariant:a,children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]})]}):i?Ne?W(n+1):null:l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:Se,depth:n,schema:O,itemSchema:Ce,refLabel:T,required:r,description:O.description,expandable:Q||pe||ue||rt(O)||at(O)||lt(O),expanded:v,onToggle:()=>j(V=>!V)}),v&&l.jsx(cn,{depth:n,lineVariant:a,children:W(n+1)})]})}if(rt(O)||at(O)||lt(O)){const I=l.jsxs(l.Fragment,{children:[rt(O)&&Z(),at(O)&&M(O),lt(O)&&K()]});return i?I:l.jsxs(l.Fragment,{children:[l.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:T,required:r,description:O.description,expandable:!0,expanded:v,onToggle:()=>j(Q=>!Q)}),v&&l.jsx(cn,{depth:n,lineVariant:a,children:I})]})}return i?null:l.jsx(nt,{id:g,path:t,depth:n,schema:O,refLabel:T,required:r,description:O.description,expandable:!1,expanded:!1,onToggle:()=>{}})}function Ra({schema:e,rootName:t,className:n="",focusTokens:r=null,focusId:s=null}){const{deref:o,defaultSchemaExpanded:i=!1}=Ve(),a=A.useMemo(()=>new Set,[]),c=$t(e),u=A.useMemo(()=>c?Ge(c,o,a):null,[c,o,a]);if(!c||!u)return l.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No schema details available."});const f=t??(c.$ref?Ca(c.$ref):void 0)??"schema",d=!!t;if(!yx(u,o)&&!c.$ref){if(d)return u.type==="array"||u.items?l.jsx("div",{className:n,children:l.jsx(gt,{schema:c,path:f,depth:0,refStack:a,deref:o,defaultExpanded:i,focusTokens:r,focusId:s})}):null;const h=u.type==="array"||u.items?`${f}[]`:f,m=gn(u),g=m?Ge(m,o,a):null,v=g!==null&&yt(g);return l.jsx("div",{className:n,children:l.jsx(nt,{path:h,depth:0,schema:u,itemSchema:v?g:void 0,description:u.type==="array"||u.items?Ms(u.description,m==null?void 0:m.description):u.description,expandable:!1,expanded:!1,onToggle:()=>{}})})}return l.jsx("div",{className:n,children:l.jsx(gt,{schema:c,path:f,depth:d?-1:0,refStack:a,deref:o,suppressRow:d,defaultExpanded:i,focusTokens:r,focusId:s})})}function Rx(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 Jf(e){let t=Rx(e),n={next(){return t()},int(r,s){return r+Math.floor(n.next()*(s-r+1))},bool(r=.5){return n.next()<r},pick(r){return r[n.int(0,r.length-1)]},shuffle(r){let s=[...r];for(let o=s.length-1;o>0;o--){let i=n.int(0,o);[s[o],s[i]]=[s[i],s[o]]}return s},fork(){let r=Math.floor(n.next()*4294967296);return Jf(r)}};return n}function Ix(e){return null}function Px(e){return e.random.bool()}function Yf(e,t,n=!1){let r=-1e3,s=1e3,o=!1,i=!1;if(e.minimum!==void 0&&(r=e.minimum),e.maximum!==void 0&&(s=e.maximum),e.exclusiveMinimum!==void 0&&(r=e.exclusiveMinimum,o=!0),e.exclusiveMaximum!==void 0&&(s=e.exclusiveMaximum,i=!0),e.multipleOf!==void 0)return $x(e.multipleOf,r,s,o,i,t);if(n){let u=o?Math.floor(r)+1:Math.ceil(r),f=i?Math.ceil(s)-1:Math.floor(s);return t.random.int(u,f)}let a=o?r+Number.EPSILON:r,c=i?s-Number.EPSILON:s;return a+t.random.next()*(c-a)}function $x(e,t,n,r,s,o){let i=Math.ceil(t/e),a=Math.floor(n/e);return r&&i*e===t&&i++,s&&a*e===n&&a--,i>a?i*e:o.random.int(i,a)*e}function Mx(e,t){if(e.autoIncrement){let n=e.initialOffset??1,r=Lx(t.path),s=t.autoIncrementCounters??new Map,o=(s.get(r)??n-1)+1;return s.set(r,o),t.autoIncrementCounters&&t.autoIncrementCounters.set(r,o),o}return Yf(e,t,!0)}function Lx(e){return e.split("/").filter(t=>t!==""&&!/^\d+$/.test(t)).join("/")}function bc(e,t){let n=Zf(e,0);return cr(n.node,t)}function cr(e,t){switch(e.type){case"literal":return e.value;case"dot":return t.pick([..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "]);case"anchor":return"";case"charClass":return Dx(e,t);case"sequence":return e.nodes.map(n=>cr(n,t)).join("");case"alternation":return cr(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},()=>cr(e.node,t)).join("")}case"group":return cr(e.node,t)}}function Dx(e,t){if(!e.negated)return t.pick(e.chars);let n=new Set(e.chars),r=[..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#%&*()-_=+[]{}|;:',.<>/? "].filter(s=>!n.has(s));return r.length>0?t.pick(r):"a"}function Zf(e,t){let n=[],r=[];for(;t<e.length;){let s=e[t];if(s===")")break;if(s==="|"){n.push(vc(r)),r=[],t++;continue}if(s==="("){let a=t+1;if(e[a]==="?")if(e[a+1]===":")a+=2;else if(e[a+1]==="="||e[a+1]==="!"){let d=1,p=a;for(;p<e.length&&d>0;)p++,e[p]==="("&&d++,e[p]===")"&&d--;t=p+1;continue}else{for(a+=2;a<e.length&&e[a]!==">";)a++;a++}let c=Zf(e,a),u={type:"group",node:c.node};t=c.pos+1;let f=ar(e,t,u);r.push(f.node),t=f.pos;continue}if(s==="["){let a=Fx(e,t),c=ar(e,a.pos,a.node);r.push(c.node),t=c.pos;continue}if(s==="."){let a={type:"dot"};t++;let c=ar(e,t,a);r.push(c.node),t=c.pos;continue}if(s==="^"||s==="$"){r.push({type:"anchor"}),t++;continue}if(s==="\\"){t++;let a=Bx(e,t);t=a.pos;let c=ar(e,t,a.node);r.push(c.node),t=c.pos;continue}let o={type:"literal",value:s};t++;let i=ar(e,t,o);r.push(i.node),t=i.pos}return n.push(vc(r)),{node:n.length===1?n[0]:{type:"alternation",branches:n},pos:t}}function vc(e){return e.length===0?{type:"literal",value:""}:e.length===1?e[0]:{type:"sequence",nodes:e}}function Bx(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:[...`
|
|
125
|
-
`],negated:!1},pos:t};case"S":return{node:{type:"charClass",chars:[...`
|
|
126
|
-
`],negated:!0},pos:t};case"b":case"B":return{node:{type:"anchor"},pos:t};default:return{node:{type:"literal",value:n},pos:t}}}function Fx(e,t){t++;let n=!1;e[t]==="^"&&(n=!0,t++);let r=[];for(;t<e.length&&e[t]!=="]";){if(e[t]==="\\"&&t+1<e.length){t++;let s=e[t];switch(s){case"d":r.push(..."0123456789");break;case"w":r.push(..."abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_");break;case"s":r.push(...`
|
|
127
|
-
`);break;default:r.push(s)}t++;continue}if(t+2<e.length&&e[t+1]==="-"&&e[t+2]!=="]"){let s=e.charCodeAt(t),o=e.charCodeAt(t+2);for(let i=s;i<=o;i++)r.push(String.fromCharCode(i));t+=3;continue}r.push(e[t]),t++}return t++,{node:{type:"charClass",chars:r,negated:n},pos:t}}function ar(e,t,n){if(t>=e.length)return{node:n,pos:t};let r=e[t],s,o;switch(r){case"*":s=0,o=5,t++;break;case"+":s=1,o=5,t++;break;case"?":s=0,o=1,t++;break;case"{":{let i=Ux(e,t);if(i)s=i.min,o=i.max,t=i.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:s,max:o},pos:t}}function Ux(e,t){let n=e.slice(t).match(/^\{(\d+)(?:,(\d*))?\}/);if(!n)return null;let r=parseInt(n[1],10),s;return n[2]===void 0?s=r:n[2]===""?s=r+5:s=parseInt(n[2],10),{min:r,max:s,pos:t+n[0].length}}function xt(e){return e<10?`0${e}`:`${e}`}function Hx(e,t){return new Date(e,t,0).getDate()}var Xf="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function qx(e){return!(e==="^"||e==="$"||e==="^$")}function zx(e,t){if(e.format){if(e.format==="date-time"&&(t.minDateTime!==void 0||t.maxDateTime!==void 0))return Wx(t);let i=t.formatRegistry.get(e.format);if(i){let a=i(t.random),c=t.minLength??e.minLength,u=t.maxLength??e.maxLength;return c!==void 0&&a.length<c?Uo(a,c,t):u!==void 0&&a.length>u?a.slice(0,u):a}}if(e.pattern){let i=t.minLength??e.minLength,a=t.maxLength??e.maxLength;for(let f=0;f<50;f++){let d=bc(e.pattern,t.random);if(!(i!==void 0&&d.length<i)&&!(a!==void 0&&d.length>a))return d}let c=bc(e.pattern,t.random),u=qx(e.pattern);return i!==void 0&&c.length<i&&u?Uo(c,i,t):a!==void 0&&c.length>a?c.slice(0,a):c}let n=e.minLength??0,r=e.maxLength??Math.max(n+10,10),s=t.random.int(n,r),o="";for(let i=0;i<s;i++)o+=t.random.pick([...Xf]);return t.maxLength!==void 0&&o.length>t.maxLength&&(o=o.slice(0,t.maxLength)),t.minLength!==void 0&&o.length<t.minLength&&(o=Uo(o,t.minLength,t)),o}function Uo(e,t,n){for(;e.length<t;)e+=n.random.pick([...Xf]);return e}function Wx(e){let t=e.minDateTime?new Date(e.minDateTime):new Date("1970-01-01"),n=e.maxDateTime?new Date(e.maxDateTime):new Date,r=t.getTime(),s=n.getTime(),o=r+e.random.next()*(s-r),i=new Date(o),a=i.getFullYear(),c=xt(i.getMonth()+1),u=xt(i.getDate());return`${a}-${c}-${u}T01:01:01.0Z`}function wc(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 s=e.exclusiveMinimum??e.minimum??-1/0,o=e.exclusiveMaximum??e.maximum??1/0,i=e.exclusiveMinimum!==void 0,a=e.exclusiveMaximum!==void 0;n=n.filter(c=>{if(typeof c!="number")return!0;let u=i?c>s:c>=s,f=a?c<o:c<=o;if(!u||!f)return!1;if(e.multipleOf!==void 0){let d=e.multipleOf,p=d.toString().includes(".")?d.toString().split(".")[1].length:0,h=Math.pow(10,p),m=Math.round(c*h),g=Math.round(d*h);if(m%g!==0)return!1}return!0})}if(e.minLength!==void 0||e.maxLength!==void 0){let s=e.minLength??0,o=e.maxLength??1/0;n=n.filter(i=>typeof i!="string"?!0:i.length>=s&&i.length<=o)}if(e.minItems!==void 0||e.maxItems!==void 0){let s=e.minItems??0,o=e.maxItems??1/0;n=n.filter(i=>Array.isArray(i)?i.length>=s&&i.length<=o:!0)}if(e.minProperties!==void 0||e.maxProperties!==void 0){let s=e.minProperties??0,o=e.maxProperties??1/0;n=n.filter(i=>typeof i!="object"||i===null||Array.isArray(i)?!0:Object.keys(i).length>=s&&Object.keys(i).length<=o)}if(n.length===0){let s=[];throw e.minLength!==void 0&&s.push(`minLength: ${e.minLength}`),e.maxLength!==void 0&&s.push(`maxLength: ${e.maxLength}`),e.minItems!==void 0&&s.push(`minItems: ${e.minItems}`),e.maxItems!==void 0&&s.push(`maxItems: ${e.maxItems}`),e.minProperties!==void 0&&s.push(`minProperties: ${e.minProperties}`),e.maxProperties!==void 0&&s.push(`maxProperties: ${e.maxProperties}`),e.minimum!==void 0&&s.push(`minimum: ${e.minimum}`),e.maximum!==void 0&&s.push(`maximum: ${e.maximum}`),e.exclusiveMinimum!==void 0&&s.push(`exclusiveMinimum: ${e.exclusiveMinimum}`),e.exclusiveMaximum!==void 0&&s.push(`exclusiveMaximum: ${e.exclusiveMaximum}`),e.multipleOf!==void 0&&s.push(`multipleOf: ${e.multipleOf}`),Error(`enum values conflict with constraints [${s.join(", ")}] at ${t.path}`)}let r=t.random.pick(n);return typeof r=="object"&&r!==null?structuredClone(r):r}throw Error(`generateEnumConst called without enum or const at ${t.path}`)}function Ct(e){let t={};for(let n of e){if(typeof n=="boolean"){if(!n)return{not:{}};continue}Gf(t,n)}return t}function Qf(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 Gf(n,t),n}function Gf(e,t){if(t.type!==void 0&&(e.type===void 0?e.type=t.type:e.type=Vx(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=[],r=Math.max(e.prefixItems.length,t.prefixItems.length);for(let s=0;s<r;s++){let o=e.prefixItems[s],i=t.prefixItems[s];o!==void 0&&i!==void 0?n.push(Qf(o,i)):o!==void 0?n.push(o):i!==void 0&&n.push(i)}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=Kx(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(r=>JSON.stringify(r)));e.enum=e.enum.filter(r=>n.has(JSON.stringify(r)))}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 Vx(e,t){let n=Array.isArray(e)?e:[e],r=Array.isArray(t)?t:[t],s=n.filter(o=>r.includes(o));return s.length===0?n[0]:s.length===1?s[0]:s}function Kx(e,t){let n={...e};for(let[r,s]of Object.entries(t)){let o=e[r];o===void 0?n[r]=s:typeof o=="object"&&typeof s=="object"?n[r]=Qf(o,s):n[r]=s}return n}var to=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 ed(e){return typeof e!="object"||e===null?!1:Object.keys(e).some(t=>to.has(t))}function Sc(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(r=>r===e):!1}function Jx(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 Yx(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(ed(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}function Zx(e,t){return e.required?e.required:e.properties===void 0&&Object.keys(t).length>0?Object.keys(t):[]}async function Xx(e,t){var y;let n=Yx(e),r=Zx(e,n);if(t.depth>=t.maxDepth){if(r.length===0)return{};let b={};for(let S of r){let k=n[S];if(k&&typeof k=="object"&&k!==null){let w=k;w.const!==void 0?b[S]=w.const:w.default!==void 0?b[S]=w.default:w.enum!==void 0&&w.enum.length>0?b[S]=w.enum[0]:b[S]=t0(w.type)}else b[S]=null}return b}if(e.additionalProperties===!1){let b=Object.keys(n).length>0,S=e.patternProperties&&Object.keys(e.patternProperties).length>0,k=new Set(Object.keys(n)),w=[...new Set(r)].filter(E=>!k.has(E));if((e.minProperties??0)>0&&!b&&!S)throw Error(`missing properties for ${e.minProperties} in ${t.path}: additionalProperties is false but no properties or patternProperties defined`);if(w.length>0&&!S&&!b)throw Error(`missing properties for ${w.join(", ")} in ${t.path}: additionalProperties is false but required properties not defined in properties`)}let s=t.path==="/"?"/properties":`${t.path}/properties`,o={...t,depth:t.depth+1,path:s},i={},a=new Set,c=new Set(r),u=t.alwaysFakeOptionals??!1,f=t.fillProperties??!0,d=t.fixedProbabilities??!1,p=t.optionalsProbability??.5,h=Object.keys(n).filter(b=>!c.has(b)),m;if(d&&!u&&h.length>0){let b=Math.round(h.length*p);m=new Set(h.slice(0,b))}let g=b=>u?!0:m?m.has(b):t.random.bool(p);if(Object.keys(n).length>0)for(let[b,S]of Object.entries(n)){if(Jx(S))continue;a.add(b);let k=Vt(o,b),w=c.has(b),E=typeof S=="object"&&S!==null&&S.type==="object",C=S;if(e.patternProperties&&typeof S=="object"&&S!==null){let O=[];for(let[T,P]of Object.entries(e.patternProperties))try{new RegExp(T).test(b)&&O.push(P)}catch{}O.length>0&&(C=Ct([S,...O]))}if(w){let O=await ve(C,k);O!==void 0&&(i[b]=O)}else if(g(b)){let O=await ve(C,k);O!==void 0&&(i[b]=O)}else if(E&&!f){let O=S.required??[];if(O.length>0){let T={};for(let P of O){let R=(S.properties??{})[P]??{},U=Vt(k,P),J=await ve(R,U);J!==void 0&&(T[P]=J)}i[b]=T}}}for(let b of c)if(!(i[b]!==void 0||a.has(b))){if(e.patternProperties){let S=[];for(let[k,w]of Object.entries(e.patternProperties))new RegExp(k).test(b)&&S.push(w);if(S.length>0){let k=S.length===1?S[0]:Ct(S),w=Vt(o,b),E=await ve(k,w);E!==void 0&&(i[b]=E),a.add(b)}}if(!a.has(b)){let S=e.additionalProperties??!0;if(S!==!1){let k=Vt(o,b),w=await ve(S===!0?{}:S,k);w!==void 0&&(i[b]=w),a.add(b)}}}if(e.dependencies){for(let[b,S]of Object.entries(e.dependencies))if(!(typeof S!="object"||S===null||Array.isArray(S))&&i[b]!==void 0&&!a.has(b+"_dep")){a.add(b+"_dep");let k=S.oneOf??S.anyOf??S.allOf??[S],w=null;for(let E of k){if(typeof E!="object"||E===null)continue;let{properties:C,not:O}=E;if(C&&C[b]){let T=C[b],P=i[b];if(Sc(P,T)){w=E;break}}if(O!=null&&O.properties){let T=O.properties[b];if(T){let P=i[b];if(!Sc(P,T)){w=E;break}}}}if(!w&&k.length>0&&typeof k[0]=="object"&&(w=k[0]),w!=null&&w.not){let E=w.not;if(E.required&&Array.isArray(E.required))for(let C of E.required)delete i[C]}if(w!=null&&w.required)for(let E of w.required){if(E===b||i[E]!==void 0)continue;let C=((y=w.properties)==null?void 0:y[E])??{type:"object"},O=Vt(o,E),T=await ve(C,O);T!==void 0&&(i[E]=T)}if(w&&w.properties)for(let[E,C]of Object.entries(w.properties)){if(E===b)continue;let O=Vt(o,E),T=await ve(C,O);T!==void 0&&(i[E]=T)}}}let v=e.minProperties??0,j=e.maxProperties;if(Object.keys(i).length<v){if(e.patternProperties&&Object.keys(e.patternProperties).length>0){let b=Object.entries(e.patternProperties),S=0,k=1e3;for(;Object.keys(i).length<v&&S<k;){S++;let[w,E]=t.random.pick(b),C=e0(w,t);if(C&&!i[C]){let O=Vt(o,C),T=await ve(E,O);T!==void 0&&(i[C]=T),a.add(C)}}}if(Object.keys(i).length<v){let b=e.additionalProperties,S=b===void 0||b===!0?{type:"string"}:b;if(S!==!1){let k=0,w=1e3;for(;Object.keys(i).length<v&&k<w;){k++;let E=`prop${t.random.int(0,99999)}`;if(!i[E]){let C=Vt(o,E),O=await ve(S,C);O!==void 0&&(i[E]=O),a.add(E)}}}}if(Object.keys(i).length<v){let b=Object.keys(n).join(", ");throw Error(`properties '${b}' were not found while additionalProperties is false in ${t.path}`)}}if(j!==void 0&&Object.keys(i).length>j){let b=Object.keys(i).filter(S=>!c.has(S));for(t.random.shuffle(b);Object.keys(i).length>j&&b.length>0;){let S=b.pop();delete i[S]}}return t.pruneProperties&&t.pruneProperties.length>0&&_i(i,t.pruneProperties),Gx(i,n),i}function Vt(e,t){let n=Qx(t),r=e.outputPath==="/"?`/${n}`:`${e.outputPath}/${n}`;return{...e,path:`${e.path}/${t}`,outputPath:r}}function Qx(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function Gx(e,t){for(let[n,r]of Object.entries(t)){if(typeof r!="object"||r===null)continue;let s=r;if(s.template===void 0)continue;let o=s.template;if(typeof o!="string")continue;let i=o.replace(/#\{(\w+)\}/g,(a,c)=>{let u=e[c];return u!==void 0?String(u):""});e[n]=i}}function e0(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 f=t.random.int(0,10),d="";for(let p=0;p<f;p++)d+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return c+d}return c}let r=e.match(/(.*\*)?([a-zA-Z]+)\$$/);if(r){let c=r[2],u=t.random.int(1,10),f="";for(let d=0;d<u;d++)f+=t.random.pick("abcdefghijklmnopqrstuvwxyz".split(""));return f+c}let s=e.match(/^\^([a-zA-Z]+)\$$/);if(s)return s[1];let o=t.random.int(3,10),i="abcdefghijklmnopqrstuvwxyz",a="";for(let c=0;c<o;c++)a+=t.random.pick(i.split(""));try{if(new RegExp(e).test(a))return a}catch{}return null}function _i(e,t){if(typeof e!="object"||e===null)return;if(Array.isArray(e)){for(let r of e)_i(r,t);return}let n=e;for(let r of Object.keys(n))t.includes(r)?delete n[r]:_i(n[r],t)}function t0(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 n0(e,t){var j;if(t.depth>=t.maxDepth){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(t.refDepthReached){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}if(e.items===!1&&(e.minItems??0)>0){let y=((j=e.prefixItems)==null?void 0:j.length)??0;if((e.minItems??0)>y)throw Error(`missing items for ${e.minItems} in ${t.path}: items is false but minItems (${e.minItems}) exceeds prefixItems count (${y})`)}let n=t.path==="/"?"/items":`${t.path}/items`,r={...t,depth:t.depth+1,path:n},s=[],o=t.refDepthMax,i=t.minItems??e.minItems??0,a=t.maxItems??e.maxItems??Math.max(i,t.maxDefaultItems);e.maxItems!==void 0&&a>e.maxItems&&(a=e.maxItems),e.minItems!==void 0&&i<e.minItems&&(i=e.minItems),a<i&&(e.maxItems!==void 0?i=a:a=i),t.alwaysFakeOptionals&&(a=Math.max(i,a));let c=e.uniqueItems?new Set:null,u=async(y,b)=>{let S=await ve(y,b);if(S===void 0)return"omitted";if(c){let k=JSON.stringify(S);if(c.has(k)){for(let w=0;w<50;w++){if(S=await ve(y,Kt(r,s.length)),S===void 0)continue;let E=JSON.stringify(S);if(!c.has(E))return c.add(E),s.push(S),"added"}return"failed"}c.add(k)}return s.push(S),"added"};if(e.prefixItems)for(let y=0;y<e.prefixItems.length&&s.length<a;y++){let b=Kt(r,y);if(await u(e.prefixItems[y],b)==="failed")break}let f;if(o!==void 0&&t.refDepth>=o-1){let y=e.minItems??0;return y>0?Array.from({length:y},()=>null):[]}let d=t.alwaysFakeOptionals??!1,p=t.fixedProbabilities??!1,h=t.optionalsProbability??.5;if(d)f=a;else if(p){let y=a-Math.max(i,s.length),b=Math.round(y*h);f=Math.max(i,s.length)+b}else f=t.random.int(Math.max(i,s.length),a);e.items;let m=e.prefixItems!==void 0,g=e.additionalItems!==void 0,v;if(m?g?v=e.additionalItems:e.items!==void 0&&(v=e.items):v=e.items,v!==!1&&v!==void 0){let y=v??{},b=0,S=Math.max(f*20,50);for(;s.length<f;){let k=await u(y,Kt(r,s.length));if(k==="added"){b=0;continue}if(b++,k==="failed"||b>=S)break}}if(e.contains){let y=e.minContains??1,b=e.maxContains??Math.max(y,1),S=t.random.int(y,b);for(let k=0;k<S;k++){let w=await ve(e.contains,Kt(r,s.length));if(w!==void 0){if(c){let E=JSON.stringify(w);if(c.has(E)){let C=!1;for(let O=0;O<50;O++){if(w=await ve(e.contains,Kt(r,s.length)),w===void 0)continue;let T=JSON.stringify(w);if(!c.has(T)){c.add(T),C=!0;break}}if(!C)continue}else c.add(E)}if(s.length<a){let E=t.random.int(0,s.length);s.splice(E,0,w)}else if(s.length>0){let E=t.random.int(0,s.length-1);s[E]=w}}}for(;s.length>a;)s.pop()}if(e.containsAll){let y=new Set;for(let b of e.containsAll){let S=await ve(b,Kt(r,s.length));if(S!==void 0){if(c){let k=JSON.stringify(S);if(c.has(k)){let w=!1;for(let E=0;E<50;E++){if(S=await ve(b,Kt(r,s.length)),S===void 0)continue;let C=JSON.stringify(S);if(!c.has(C)){c.add(C),w=!0;break}}if(!w)continue}else c.add(k)}if(s.length<a){let k=t.random.int(0,s.length);s.splice(k,0,S);let w=new Set;for(let E of y)w.add(E>=k?E+1:E);y.clear();for(let E of w)y.add(E);y.add(k)}else if(s.length>0){let k=Array.from({length:s.length},(w,E)=>E).filter(w=>!y.has(w));if(k.length>0){let w=k[t.random.int(0,k.length-1)];s[w]=S,y.add(w)}else s.push(S),y.add(s.length-1)}}}for(;s.length>a;)s.pop()}return e.uniqueItems&&s.length>0?r0(s,e,r,i,a,c):s}async function r0(e,t,n,r,s,o){let i=t.items??{},a=0,c=100;for(;e.length<r&&a<c;){a++;let u=await ve(i,Kt(n,e.length));if(u===void 0)continue;let f=JSON.stringify(u);o.has(f)||(o.add(f),e.push(u))}for(;e.length>s;)e.pop();return e}function Kt(e,t){let n=e.outputPath==="/"?`/${t}`:`${e.outputPath}/${t}`;return{...e,path:`${e.path}/${t}`,outputPath:n}}function jc(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 s0(e,t);throw Error(`Unsupported fragment type: ${t}. Only JSON pointers (starting with /) are supported.`)}function s0(e,t){if(t===""||t==="/")return e;let n=t.slice(1).split("/"),r=e;for(let s of n){let o=s.replace(/~1/g,"/").replace(/~0/g,"~");if(typeof r!="object"||r===null)throw Error(`Cannot resolve JSON pointer "${t}": not an object at "${o}"`);if(Array.isArray(r)){let i=parseInt(o,10);if(isNaN(i)||i<0||i>=r.length)throw Error(`Cannot resolve JSON pointer "${t}": invalid array index "${o}"`);r=r[i]}else{if(!(o in r))throw Error(`Cannot resolve JSON pointer "${t}": property "${o}" not found`);r=r[o]}}return r}function o0(e){let t=new Map;if(typeof e=="boolean")return t;if(e.$id&&typeof e=="object"){let n=e,r=n.$id,{$id:s,...o}=n;t.set(r,o)}if(e.$defs)for(let[n,r]of Object.entries(e.$defs))t.set(`#/$defs/${n}`,r);return t}async function Ls(e,t){let n=e.$ref;if(!n)return{schema:e,ctx:t};let r=t.refDepth+1;if(t.refDepthMax!==void 0&&r>=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 s,o;if(n.startsWith("#/")){if(s=t.refRegistry.get(n),s===void 0&&n.length>2){let d=t.refRegistry.get("#");if(d!==void 0&&typeof d=="object")try{s=jc(d,n.slice(1))}catch{}}s===void 0&&t.refResolver&&(s=await t.refResolver(n),s!==void 0&&t.refRegistry.set(n,s))}else if(n==="#")s=t.refRegistry.get("#")??{};else if(s=t.refRegistry.get(n),s===void 0&&t.refResolver){o=await t.refResolver(n);let d=n.indexOf("#");if(d!==-1){let p=n.slice(d+1);p?s=jc(o,p):s=o}else s=o;if(o&&typeof o=="object"&&o!==null){let p=o;if(p.$defs)for(let[h,m]of Object.entries(p.$defs))t.refRegistry.set(`#/$defs/${h}`,m)}}if(s===void 0)throw Error(`Unresolved $ref: ${n}`);let i=new Set(["description","title","$comment","readOnly","writeOnly","deprecated"]),{$ref:a,...c}=e,u=Object.fromEntries(Object.entries(c).filter(([d])=>!i.has(d)));Object.keys(u).length>0&&typeof s=="object"&&s!==null&&(s={...s,...u});let f={...t,refStack:new Set([...t.refStack,n]),refDepth:t.refDepth+1};return{schema:s,ctx:f}}function i0(e,t){typeof e!="boolean"&&(t.set("#",e),Ri(e,"#",t))}function Ri(e,t,n){if(e.$id){let{$id:r,...s}=e;n.set(r,s)}if(e.$defs)for(let[r,s]of Object.entries(e.$defs)){let o=`${t}/$defs/${r}`;n.set(o,s),typeof s=="object"&&s!==null&&Ri(s,o,n)}if(e.properties)for(let[r,s]of Object.entries(e.properties))typeof s=="object"&&s!==null&&Ri(s,`${t}/properties/${r}`,n)}async function a0(e,t){return e.$ref?(await Ls(e,t)).schema:e}async function l0(e,t){let n=[];for(let r of e)if(typeof r=="object"&&r!==null&&"$ref"in r){let s=await a0(r,t);n.push(s)}else typeof r=="object"&&r!==null&&n.push(r);return n}async function c0(e,t){let{allOf:n,anyOf:r,oneOf:s,not:o,if:i,then:a,else:c,...u}=e;if(n){let f=await l0(n,t),d=Ct([u,...f]);return ve(d,t)}if(s){let f=t.random.shuffle([...s]),d=u.required??[];for(let b of f){let S=typeof b=="object"&&b!==null?b:{};S.$ref&&(S=(await Ls(S,t)).schema);let k=S.required??[],w=[...new Set([...d,...k])],E={...u,required:w},C=Ct([E,S]),O={...t,optionalsProbability:0,alwaysFakeOptionals:!1};try{return await ve(C,O)}catch{}}let p=s[0],h=typeof p=="object"&&p!==null?p:{};h.$ref&&(h=(await Ls(h,t)).schema);let m=h.required??[],g=[...new Set([...d,...m])],v={...u,required:g},j=Ct([v,h]),y={...t,optionalsProbability:0,alwaysFakeOptionals:!1};return ve(j,y)}if(r){let f=t.random.shuffle([...r]);for(let h of f){let m=Ct([u,h]);try{return await ve(m,t)}catch{}}let d=r[0],p=Ct([u,d]);return ve(p,t)}return i!==void 0?u0(u,i,a,c,t):o?f0(u,o,t):ve(u,t)}async function u0(e,t,n,r,s){if(n!==void 0){let o=Ct([e,t,n]);try{return await ve(o,s)}catch{}}if(r!==void 0){let o=Ct([e,r]);try{return await ve(o,s)}catch{}}return ve(e,s)}async function f0(e,t,n){if(typeof t=="boolean"){if(t===!0)throw Error(`Cannot generate value for 'not: true' at ${n.path}`);return ve(e,n)}if(t.type&&!t.enum&&!t.const){let r=Array.isArray(t.type)?t.type:[t.type],s=["string","number","integer","boolean","null","object","array"].filter(o=>!r.includes(o));if(s.length>0){let o=n.random.pick(s),i=Ct([e,{type:o}]);return ve(i,n)}}if(t.const!==void 0||t.enum!==void 0){let r=t.enum??[t.const],s=new Set(r.map(o=>JSON.stringify(o)));for(let o=0;o<20;o++){let i=await ve(e,n);if(!s.has(JSON.stringify(i)))return i}}return ve(e,n)}class d0{constructor(){je(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 r=Object.keys(t);for(let s=r.length-1;s>=0;s--){let o=r[s],i=o.startsWith("x-")?o.slice(2):o,a=this.extensions.get(i);if(a){let c=t[o],u=a.callback.call(a.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 p0=new d0;function h0(e,t){return p0.generate(e,t)}var m0=["string","number","integer","boolean","null","object","array"];function Ec(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 r=g0(e.faker,t),s=Ac(r,n??e.type,t.path);return typeof s=="string"&&e.format?kc(s,e.format,t):s}catch{}if(e.chance!==void 0)try{let r=y0(e.chance,t),s=Ac(r,n??e.type,t.path);return typeof s=="string"&&e.format?kc(s,e.format,t):s}catch{}}function kc(e,t,n){if(t==="date"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime())){let s=r.getFullYear(),o=xt(r.getMonth()+1),i=xt(r.getDate());return`${s}-${o}-${i}`}if(typeof e=="string"){let s=Date.parse(e);if(!isNaN(s)){let o=new Date(s),i=o.getFullYear(),a=xt(o.getMonth()+1),c=xt(o.getDate());return`${i}-${a}-${c}`}}}if(t==="date-time"){let r=typeof e=="string"?new Date(e):e;if(r instanceof Date&&!isNaN(r.getTime()))return r.toISOString();if(typeof e=="string"&&Date.parse(e))return new Date(e).toISOString()}return e}function Ac(e,t,n){if(t===void 0)return e;let r=Array.isArray(t)?t[0]:t;switch(r){case"string":return e===null?"null":e===void 0?"undefined":String(e);case"number":case"integer":let s=Number(e);return r==="integer"?Math.floor(s):s;case"boolean":return!!e;case"null":return null;default:return e}}function g0(e,t){var i;if(!((i=t.extensions)!=null&&i.faker)){let a=typeof e=="string"?e:JSON.stringify(e);throw Error(`cannot resolve faker-generator for ${a} in ${t.path}`)}let n,r;if(typeof e=="object"&&e!==null){let a=e,c=Object.keys(a);if(c.length>0)n=c[0],r=a[n];else throw Error(`cannot resolve faker-generator for ${JSON.stringify(e)} in ${t.path}`)}else n=e;let s=n.split("."),o=t.extensions.faker;for(let a of s)try{o=o[a]}catch{throw Error(`failed to resolve .${a} (${n})`)}if(typeof o=="function")return r?o(...r):o();throw Error(`cannot resolve faker-generator for ${n} in ${t.path}`)}function y0(e,t){var n;if(!((n=t.extensions)!=null&&n.chance)){let r=typeof e=="string"?e:Object.keys(e)[0];throw Error(`cannot resolve chance-generator for ${r} in ${t.path}`)}if(typeof e=="string"){let r=t.extensions.chance[e];if(typeof r=="function")return r.call(t.extensions.chance);throw Error(`cannot resolve chance-generator for ${e} in ${t.path}`)}if(typeof e=="object"&&e!==null){let r=e,s=Object.keys(r)[0],o=r[s],i=t.extensions.chance[s];if(typeof i=="function")return o?i.call(t.extensions.chance,o):i.call(t.extensions.chance)}throw Error(`cannot resolve chance-generator in ${t.path}`)}function x0(e,t){let n=e.path==="/"?`/${t}`:`${e.path}/${t}`;return{...e,depth:e.depth+1,path:n,refDepthReached:e.refDepthReached}}async function ze(e,t,n){return n.outputTransform?n.outputTransform(e,t,n.outputPath):e}async function ve(e,t){if(e===!0)return ve({},t);if(e===!1)throw Error(`Cannot generate value for 'false' schema at ${t.path}`);if(t.propAliases&&typeof e=="object"&&e!==null){let o=e,i=null;for(let[a,c]of Object.entries(t.propAliases))a in o&&!(c in o)&&(i||(i={...o}),i[c]=i[a],delete i[a]);i&&(e=i)}let n;if(Array.isArray(e.type)){let o=e.type;n=t.random.pick(o);let i={...t,resolvedType:n},a=Ec(e,i,n);if(a!==void 0)return typeof a=="string"&&i.maxLength!==void 0&&a.length>i.maxLength?ze(a.slice(0,i.maxLength),e,i):ze(a,e,i)}else{let o=Ec(e,t,n);if(o!==void 0)return typeof o=="string"&&t.maxLength!==void 0&&o.length>t.maxLength?ze(o.slice(0,t.maxLength),e,t):ze(o,e,t)}let r=h0(e,t);if(r!==void 0)return ze(r,e,t);if(e.$ref){let o=await Ls(e,t);return ve(o.schema,x0(o.ctx,"$ref"))}if(e.allOf||e.anyOf||e.oneOf||e.not||e.if)return c0(e,t);if(e.const!==void 0)return ze(wc(e,t),e,t);if(t.useDefaultValue&&e.default!==void 0)return ze(e.default,e,t);if(e.enum!==void 0)return ze(wc(e,t),e,t);if(t.useExamplesValue){if(Array.isArray(e.examples)&&e.examples.length>0)return ze(t.random.pick(e.examples),e,t);if(e.example!==void 0)return ze(e.example,e,t)}let s=b0(e,t);if(s===null){if(t.failOnInvalidTypes===!1){if(t.defaultInvalidTypeProduct!==void 0){let o=t.defaultInvalidTypeProduct;return typeof o=="string"?w0(o):o}return null}throw Error(`unknown primitive ${e.type} in ${t.path}/type`)}switch(s){case"null":return ze(Ix(),e,t);case"boolean":return ze(Px(t),e,t);case"number":return ze(Yf(e,t),e,t);case"integer":return ze(Mx(e,t),e,t);case"string":return ze(zx(e,t),e,t);case"object":return ze(await Xx(e,t),e,t);case"array":return ze(await n0(e,t),e,t);default:throw Error(`Unknown type: ${s} at ${t.path}`)}}function b0(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||v0(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(m0)}function v0(e){if(e.properties||e.type==="object"||e.type==="array")return!1;for(let t of Object.keys(e)){if(to.has(t))continue;let n=e[t];if(typeof n=="object"&&n!==null&&!Array.isArray(n))return!0}return!1}function w0(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 S0(e){let t=td(e),n=nd(e);return`${t}T${n}`}function td(e){let t=e.int(2e3,2030),n=e.int(1,12),r=Hx(t,n),s=e.int(1,r);return`${t}-${xt(n)}-${xt(s)}`}function nd(e){let t=e.int(0,23),n=e.int(0,59),r=e.int(0,59);return`${xt(t)}:${xt(n)}:${xt(r)}Z`}var j0=["alice","bob","charlie","dave","eve","frank","grace","heidi"],E0=["example.com","test.org","demo.net","sample.io"];function Tc(e){let t=e.pick(j0),n=e.int(1,999),r=e.pick(E0);return`${t}${n}@${r}`}var k0=["https"],A0=["example.com","test.org","demo.net"],T0=["api","v1","users","items","data","resource"];function is(e){let t=e.pick(k0),n=e.pick(A0),r=e.int(1,3),s=[];for(let o=0;o<r;o++)s.push(e.pick(T0));return`${t}://${n}/${s.join("/")}`}var O0=["alpha","beta","gamma","delta","echo","fox","golf","hotel"],N0=["com","org","net","io","dev"];function Oc(e){let t=e.int(1,3),n=[];for(let r=0;r<t;r++)n.push(e.pick(O0));return n.push(e.pick(N0)),n.join(".")}function C0(e){return`${e.int(1,254)}.${e.int(0,255)}.${e.int(0,255)}.${e.int(1,254)}`}function _0(e){let t=[];for(let n=0;n<8;n++)t.push(e.int(0,65535).toString(16));return t.join(":")}function R0(e){let t=n=>{let r="";for(let s=0;s<n;s++)r+=e.int(0,15).toString(16);return r};return`${t(8)}-${t(4)}-4${t(3)}-${["8","9","a","b"][e.int(0,3)]}${t(3)}-${t(12)}`}var I0=["foo","bar","baz","items","0","1","2","name","value"];function Nc(e){let t=e.int(1,4),n=[];for(let r=0;r<t;r++)n.push(e.pick(I0));return"/"+n.join("/")}function P0(e){let t=["P"],n=e.bool(),r=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`)),r&&(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 $0=new Map([["date-time",S0],["date",td],["time",nd],["duration",P0],["email",Tc],["idn-email",Tc],["uri",is],["uri-reference",is],["iri",is],["iri-reference",is],["hostname",Oc],["idn-hostname",Oc],["ipv4",C0],["ipv6",_0],["uuid",R0],["json-pointer",Nc],["relative-json-pointer",e=>`${e.int(0,5)}${Nc(e)}`]]);function rd(e){let t=new Map($0);if(e)for(let[n,r]of Object.entries(e))t.set(n,r);return t}function M0(e,t){if(!e.startsWith("$"))throw Error(`Invalid JSONPath: ${e} (must start with $)`);let n=e.slice(1).split(/\.|\[(\d+|\*)\]/).filter(Boolean),r=[t];for(let s of n){if(s==="")continue;let o=[];for(let i of r)if(i!=null)if(s==="*")Array.isArray(i)&&o.push(...i);else if(/^\d+$/.test(s)){let a=parseInt(s,10);Array.isArray(i)&&a<i.length&&o.push(i[a])}else s===""?Ii(i,o):typeof i=="object"&&i!==null&&s in i&&o.push(i[s]);r=o}return r}function Ii(e,t){if(e!=null){if(Array.isArray(e))for(let n of e)t.push(n),Ii(n,t);else if(typeof e=="object")for(let n of Object.values(e))t.push(n),Ii(n,t)}}function L0(e){if(e.properties)return e.properties;if(e.type==="object"||e.type===void 0){let t={},n=!1;for(let[r,s]of Object.entries(e))to.has(r)||(ed(s)?(t[r]=s,n=!0):(t[r]={const:s},n=!0));if(n)return t}return{}}async function Pi(e,t,n,r){if(!n.resolveJsonPath)return e;let s=r??e;if(t===!0||t===!1||t.$ref)return e;let o=t;if(o.allOf||o.anyOf||o.oneOf)return e;if(typeof e=="object"&&e!==null&&!Array.isArray(e)){let i={...e},a=L0(o);for(let[c,u]of Object.entries(a))if(c in i){let f=i[c];if(typeof u=="object"&&u!==null&&"jsonPath"in u&&typeof u.jsonPath=="string"){let d=M0(u.jsonPath,s);d.length>0&&(i[c]=n.random.pick(d))}else{let d=await Pi(f,u,n,s);i[c]=d}}return i}if(Array.isArray(e)&&o.items){let i=[];for(let a of e){let c=await Pi(a,o.items,n,s);i.push(c)}return i}return e}var D0=rd(),Cc=new Set(["https://json-schema.org/draft/2020-12/schema","https://json-schema.org/draft/2019-09/schema"]);async function sd(e,t){if((t==null?void 0:t.validateSchemaVersion)===!0&&!(t!=null&&t.propAliases)&&typeof e=="object"&&e!==null&&"$schema"in e){let d=e.$schema;if(typeof d=="string"&&!Cc.has(d))throw Error(`Unsupported JSON Schema version: ${d}. Supported versions: ${[...Cc].join(", ")}`)}let n=F0(t),r=Jf((t==null?void 0:t.seed)??1),s=n.propAliases?B0(e,n.propAliases):e,o=o0(s);i0(s,o);let i=n.formats?rd(n.formats):new Map(D0),a=n.refDepthMin??n.refDepth,c=n.refDepthMax??n.refDepth;if(a!==void 0&&c!==void 0&&a>c)throw Error(`refDepthMin (${a}) cannot be greater than refDepthMax (${c})`);let u={random:r,maxDepth:n.maxDepth??(c?c+20:5),maxDefaultItems:n.maxDefaultItems??3,optionalsProbability:n.optionalsProbability??.5,depth:0,refRegistry:o,refStack:new Set,formatRegistry:i,refResolver:n.refResolver,minItems:n.minItems,maxItems:n.maxItems,minLength:n.minLength,maxLength:n.maxLength,useDefaultValue:n.useDefaultValue,path:"/",outputPath:"/",alwaysFakeOptionals:n.alwaysFakeOptionals,fixedProbabilities:n.fixedProbabilities,fillProperties:n.fillProperties,extensions:n.extensions,resolveJsonPath:n.resolveJsonPath,autoIncrementCounters:new Map,refDepth:0,refDepthMin:a,refDepthMax: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},f=await ve(s,u);return n.resolveJsonPath?Pi(f,e,u,f):f}function B0(e,t){if(typeof e!="object"||e===null)return e;let n=e,r=null;for(let[s,o]of Object.entries(t))s in n&&!(o in n)&&(r||(r={...n}),r[o]=r[s],delete r[s]);return r??e}function F0(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:U0(n.outputTransform,H0(t.ignoreProperties))}),n}function U0(e,t){return e?t?async(n,r,s)=>{let o=await e(n,r,s);return t(o,r,s)}:e:t}function H0(e){return(t,n,r)=>{if(r==="/")return t;let s=q0(r.slice(r.lastIndexOf("/")+1));return e.some(o=>typeof o=="string"?o===s:o instanceof RegExp?o.test(s):o(n))?void 0:t}}function q0(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}const z0=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function as(e,t){return e.type===t||Array.isArray(e.type)&&e.type.includes(t)}function Rn(e,t=()=>{},n=new Set,r=new Set){if(typeof e.$ref=="string"){const s=e.$ref,o=t(s);return z0(o)?r.has(s)?as(o,"null")?{type:"null"}:{}:Rn(o,t,new Set,new Set(r).add(s)):{}}if(n.has(e))return as(e,"null")?{type:"null"}:{};if(Array.isArray(e.oneOf)&&e.oneOf.length>0){const{oneOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(Array.isArray(e.anyOf)&&e.anyOf.length>0){const{anyOf:s,...o}=e;return Rn({...o,...s[0]},t,n,r)}if(as(e,"object")&&e.properties&&typeof e.properties=="object"){n.add(e);try{const s={};for(const[o,i]of Object.entries(e.properties)){const a=/id$/i.test(o)&&i.type==="string"&&!i.format&&!i.examples,c=i.type==="string"&&!i.format&&!i.examples&&!i.enum;s[o]=a?{...i,format:"uuid"}:c?{...i,examples:["string"]}:Rn(i,t,n,r)}return{...e,properties:s}}finally{n.delete(e)}}if(as(e,"array")&&e.items&&typeof e.items=="object"){n.add(e);try{return{...e,items:Rn(e.items,t,n,r)}}finally{n.delete(e)}}return e}function W0({schema:e,providedExample:t}){const n=t!==void 0,[r,s]=A.useState(n?t:null),{deref:o}=Ve();if(A.useEffect(()=>{if(n){s(t);return}let a=!1;try{sd(Rn(e,o),{seed:42,useExamplesValue:!0,optionalsProbability:1}).then(c=>{a||s(c)}).catch(()=>{})}catch{}return()=>{a=!0}},[e,o,n,t]),r===null)return null;const i=JSON.stringify(r,null,2);return l.jsxs("div",{children:[l.jsx(Na,{code:i}),!n&&l.jsx("span",{className:"text-xs text-foreground-muted italic mt-2 font-bold inline-block",children:"This example is auto generated"})]})}function yn({schema:e,label:t,rootName:n,description:r,schemaFormat:s,originalSchema:o,conversionError:i,pendingConversion:a,example:c,defaultView:u="example"}){const f=Ju(s),d=!a&&zm(s,i),[p,h]=A.useState(d&&u==="example"?"example":"schema");return A.useEffect(()=>{!d&&p==="example"&&h("schema")},[d,p]),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:t}),f&&l.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-muted px-1.5 py-0.5 rounded",title:s,children:f})]}),r&&l.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed mt-2 mb-2",children:r})]}),l.jsx(Kf,{tabs:[...d?[{id:"example",label:"Example"}]:[],{id:"schema",label:"Schema"},{id:"json",label:"JSON"}],selected:p,onChange:m=>h(m),ariaLabel:"Schema view toggle"})]}),i&&l.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 ",Yu(s)??"the"," schema, showing raw definition. ",i]}),a?l.jsx("p",{className:"text-xs text-foreground-muted",children:"Loading Protobuf definition…"}):l.jsxs(l.Fragment,{children:[p==="schema"&&l.jsx(Ra,{schema:e,rootName:n??(typeof t=="string"?t:void 0)}),p==="json"&&l.jsx(Pf,{schema:o??e}),p==="example"&&d&&l.jsx(W0,{schema:e,providedExample:c})]})]})}function od({message:e,expanded:t,onToggleExpanded:n,paddingX:r="px-4",focusSection:s=null}){var h;const[o,i]=A.useState("payload");A.useEffect(()=>{(s==="headers"||s==="payload")&&i(s)},[s]);const{deref:a}=Ve(),c=ha(),u=A.useMemo(()=>e.payload?vr(e.payload,a):null,[e.payload,a,c]),f=A.useMemo(()=>e.headers?vr(e.headers,a):null,[e.headers,a,c]),d=(h=e.examples)==null?void 0:h[0],p=e.description||e.payload||e.headers||e.deprecated||e.tags&&e.tags.length>0;return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:`grid transition-all duration-200 ease-in-out ${t?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:l.jsx("div",{className:"overflow-hidden",children:l.jsxs("div",{className:`${r} pb-4 space-y-4 border-t border-border pt-3`,children:[e.description&&l.jsx("p",{className:"text-sm text-foreground-secondary leading-relaxed",children:e.description}),(e.payload||e.headers)&&l.jsxs("div",{children:[e.payload&&e.headers&&l.jsx(Wn,{tabs:[{id:"payload",name:"Payload"},{id:"headers",name:"Headers"}],current:o,onChange:m=>i(m)}),l.jsxs("div",{className:"mt-4",children:[(o==="payload"||!e.headers)&&u&&l.jsx(yn,{schema:u.schema,label:"Payload",description:u.description,schemaFormat:u.schemaFormat,originalSchema:u.originalSchema,conversionError:u.conversionError,pendingConversion:u.pendingConversion,example:d==null?void 0:d.payload}),(o==="headers"||!e.payload)&&f&&l.jsx(yn,{schema:f.schema,label:"Headers",description:f.description,schemaFormat:f.schemaFormat,originalSchema:f.originalSchema,conversionError:f.conversionError,pendingConversion:f.pendingConversion,example:d==null?void 0:d.headers})]})]}),e.tags&&e.tags.length>0&&l.jsx("div",{className:"flex flex-wrap gap-1",children:e.tags.map((m,g)=>l.jsx(Oa,{name:`#${m.name}`},g))})]})})}),p&&l.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:[l.jsx("span",{children:t?"Show less":"Show more"}),l.jsx(Or,{className:`w-3 h-3 transition-transform duration-200 ${t?"rotate-180":""}`})]})]})}function V0({messageKey:e,message:t,first:n,isSelected:r,focusSection:s}){const[o,i]=A.useState(!1);return A.useEffect(()=>{r&&i(!0)},[r]),l.jsxs("tbody",{id:`message-${e}`,className:`${n?"":"border-t border-border"} ${r?"bg-primary-50/60 outline outline-1 outline-primary-300":""}`,children:[l.jsxs("tr",{className:"",children:[l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex flex-col gap-1.5",children:[l.jsx("span",{className:"text-sm font-medium text-foreground",children:t.title??t.name??e}),l.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})]})}),l.jsx("td",{className:"px-6 py-4 text-sm text-foreground-muted",children:t.summary??"—"}),l.jsx("td",{className:"px-6 py-4",children:l.jsxs("div",{className:"flex flex-col items-start gap-1.5",children:[l.jsxs("div",{className:"flex justify-between w-full",children:[l.jsx("div",{}),l.jsx("div",{children:t.contentType&&l.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&&l.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"}),l.jsxs("div",{className:"flex justify-between w-full",children:[l.jsx("div",{}),l.jsx("div",{children:t.correlationId&&l.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})})]})]})})]}),l.jsx("tr",{children:l.jsx("td",{colSpan:3,className:"p-0",children:l.jsx(od,{message:t,expanded:o,onToggleExpanded:()=>i(a=>!a),paddingX:"px-6",focusSection:r?s:null})})})]})}function id({messages:e,selectedKey:t,focusSection:n}){const r=Object.entries(e),s=r.length?l.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-neutral-100",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Message"}),l.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Summary"}),l.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Details"})]})}),r.map(([o,i],a)=>l.jsx(V0,{messageKey:o,message:i,first:a===0,isSelected:t===o,focusSection:n},o))]})}):l.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 l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{content:s,stickySideContent:!1})})}function ad({serverNames:e=[],current:t,setCurrent:n}){return l.jsx("nav",{className:"space-y-1 w-max mt-10 @lg:mt-0","aria-label":"Sidebar",children:e.map(r=>l.jsx("button",{type:"button",onClick:()=>n(r),"aria-current":t===r?"page":void 0,className:Cn(t===r?"border-l-4 border-neutral-300 text-foreground":"text-foreground-secondary hover:text-foreground","flex items-center px-3 py-2 text-sm font-medium cursor-pointer w-full text-left"),children:l.jsx("span",{className:"truncate",children:r})},r))})}function ld(e){return l.jsx(ta,{...e,children:l.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 K0(e){return l.jsx(ta,{...e,children:l.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 cd({address:e,variables:t,children:n}){return l.jsxs("div",{className:"font-bold text-foreground-secondary mt-8 mb-4 bg-neutral-200 border border-neutral-500 p-4 rounded-lg",children:[l.jsxs("div",{className:"border border-dotted border-black p-2 rounded-lg bg-surface",children:[l.jsx(K0,{className:"inline-block mr-1 -mt-1 h-6 text-foreground-muted"}),e&&l.jsx(Xt,{address:e,parameters:t,className:"font-bold leading-tight tracking-tight px-0"})]}),n]})}function ud({className:e}){return l.jsx("svg",{viewBox:"0 0 512 512",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"currentColor",children:l.jsx("path",{d:"M202.1,450a15,15,0,0,1-10.6-25.61L365.79,250.1,191.5,75.81A15,15,0,0,1,212.71,54.6l184.9,184.9a15,15,0,0,1,0,21.21l-184.9,184.9A15,15,0,0,1,202.1,450Z"})})}function Mr({trigger:e,children:t,defaultExpanded:n=!1,forceExpanded:r=!1,ariaLabelledBy:s,className:o=""}){const[i,a]=A.useState(n),c=A.useId();return A.useEffect(()=>{r&&a(!0)},[r]),l.jsxs("div",{className:`rounded-lg border border-border overflow-hidden ${o}`,children:[l.jsxs("button",{type:"button","aria-expanded":i,"aria-controls":c,"aria-labelledby":s,onClick:()=>a(u=>!u),className:"flex w-full items-center justify-between px-4 py-3 bg-neutral-50 text-left hover:bg-neutral-100 transition-colors",children:[e,i?l.jsx(Or,{className:"w-4 h-4 text-foreground-muted shrink-0"}):l.jsx(ud,{className:"w-4 h-4 text-foreground-muted shrink-0"})]}),l.jsx("div",{id:c,className:`grid transition-all duration-200 ease-in-out ${i?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:l.jsx("div",{className:"overflow-hidden",children:t})})]})}const J0=[{id:"userPassword",name:"User/Password"},{id:"oauth2",name:"OAuth2"},{id:"apiKey",name:"API key"},{id:"bearer",name:"Bearer Token"},{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 _c(e){var n,r;const t=(n=e.type)==null?void 0:n.toLowerCase();if(t==="httpapikey")return"apiKey";if(t==="http"){const s=(r=e.scheme)==null?void 0:r.toLowerCase();return s==="basic"?"userPassword":s!=null&&s.includes("mutual")||s!=null&&s.includes("tls")?"X509":"bearer"}return e.type}function Ia({securities:e}){var a,c;const t=A.useMemo(()=>J0.filter(u=>e==null?void 0:e.some(f=>_c(f).toLowerCase()===u.id.toLowerCase())),[e]),n=t.length>1,[r,s]=A.useState(n?null:((a=t[0])==null?void 0:a.id)??null);A.useEffect(()=>{if(t.length===0){s(null);return}if(t.length===1){s(t[0].id);return}s(u=>u&&t.some(f=>f.id===u)?u:null)},[t]);function o(u){return e.find(f=>_c(f).toLowerCase()===u.toLowerCase())}const i=r?(c=o(r))==null?void 0:c.description:void 0;return l.jsxs("div",{children:[n&&l.jsx(Wn,{tabs:t,current:r,onChange:u=>s(f=>u&&f===u?null:u||null),placeholder:"Select an authorization method"}),l.jsxs("div",{className:"py-4 prose text-foreground-muted",children:[r==="userPassword"&&l.jsxs(ls,{description:i,children:["You have to"," ",l.jsx("strong",{className:"text-foreground-secondary",children:"provide user and password"})," ","to connect to this server."]}),r&&["scramSha256","scramSha512","plain"].includes(r)&&l.jsxs(ls,{description:i,children:["You have to"," ",l.jsx("strong",{className:"text-foreground-secondary",children:"provide username and password"})," ","to connect to this server."]}),r==="gssapi"&&l.jsxs(ls,{description:i,children:["You have to"," ",l.jsx("strong",{className:"text-foreground-secondary",children:"authenticate using Kerberos (GSSAPI)"})," ","to connect to this server."]}),r==="X509"&&l.jsxs(ls,{description:i,children:["You have to"," ",l.jsx("strong",{className:"text-foreground-secondary",children:"download the certificate file"})," ","from the service provider to connect to this server."]}),r==="bearer"&&l.jsx(Y0,{security:o("bearer")}),r==="apiKey"&&l.jsx(Z0,{security:o("apiKey")}),r==="openIdConnect"&&l.jsx(X0,{security:o("openIdConnect")}),r==="oauth2"&&l.jsx(Q0,{security:o("oauth2")})]})]})}const ls=({description:e,children:t})=>e?l.jsx(l.Fragment,{children:l.jsx(wt,{children:e})}):l.jsx("span",{children:t}),Y0=({security:e})=>e!=null&&e.description?l.jsx(wt,{children:e.description}):l.jsxs("span",{children:["You have to"," ",l.jsx("strong",{className:"text-foreground-secondary",children:"provide a bearer token"})," ","in the ",l.jsx("code",{children:"Authorization"})," header",e!=null&&e.bearerFormat?l.jsxs(l.Fragment,{children:[" (format: ",e.bearerFormat,")"]}):null," to connect to this server."]}),Z0=({security:e})=>{if(e!=null&&e.description)return l.jsx(wt,{children:e.description});const t=e==null?void 0:e.in;return t==="header"||t==="query"||t==="cookie"?l.jsxs("span",{children:["You have to"," ",l.jsxs("strong",{className:"text-foreground-secondary",children:["provide your API key in the ",t," parameter",e!=null&&e.name?l.jsxs(l.Fragment,{children:[" named ",l.jsx("code",{children:e.name})]}):null]})," ","to connect to this server."]}):t==="password"?l.jsxs("span",{children:["You have to"," ",l.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."]}):l.jsxs("span",{children:["You have to"," ",l.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."]})},X0=({security:e})=>{var n,r;const t=(n=e.requiredScopes)!=null&&n.length?e.requiredScopes:e.scopes;return l.jsxs(l.Fragment,{children:[e!=null&&e.description?l.jsx(wt,{children:e.description}):l.jsx("p",{children:"You can use OpenID to connect to this server."}),l.jsxs("p",{children:["The OpenID Connect URL is"," ",l.jsx("a",{href:e.openIdConnectUrl,target:"_blank",rel:"noreferrer",children:e.openIdConnectUrl}),"."]}),t&&t.length>0&&l.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 items-center @sm:gap-4",children:[l.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:(r=e.requiredScopes)!=null&&r.length?"Required scopes":"Scopes"}),l.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:l.jsx("code",{children:hh(t)})})]})]})},Q0=({security:e})=>{const t=e==null?void 0:e.flows;return l.jsxs(l.Fragment,{children:[(e==null?void 0:e.description)&&l.jsx(wt,{children:e.description}),t&&Object.entries(t).map(([n,r])=>{var c,u;let s="",o="";switch(n){case"clientCredentials":s=Qp,o=Gp;break;case"implicit":s=Zp,o=Xp;break;case"password":s=eh,o=th;break;case"authorizationCode":s=nh,o=rh;break}const i=(c=e.requiredScopes)!=null&&c.length?e.requiredScopes:r.availableScopes??r.scopes,a=(u=e.requiredScopes)!=null&&u.length?"Required scopes":"Available scopes";return l.jsxs("div",{children:[l.jsxs("div",{children:[l.jsx("h4",{className:"text-lg leading-6 font-bold text-foreground",children:s}),l.jsx("p",{className:"mt-1 max-w-2xl text-sm text-foreground-muted",children:o})]}),l.jsx("div",{className:"mt-5 border-t border-border",children:l.jsxs("dl",{className:"@sm:divide-y @sm:divide-border",children:[r.authorizationUrl&&l.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[l.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Authorization URL"}),l.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:l.jsx("a",{href:r.authorizationUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.authorizationUrl})})]}),r.tokenUrl&&l.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[l.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Token URL"}),l.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:l.jsx("a",{href:r.tokenUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.tokenUrl})})]}),r.refreshUrl&&l.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[l.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:"Refresh URL"}),l.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:l.jsx("a",{href:r.refreshUrl,target:"_blank",rel:"noreferrer",className:"text-foreground",children:r.refreshUrl})})]}),i&&l.jsxs("div",{className:"py-4 @sm:py-5 @sm:grid @sm:grid-cols-3 @sm:gap-4 items-center",children:[l.jsx("dt",{className:"text-sm font-medium text-foreground-muted",children:a}),l.jsx("dd",{className:"mt-1 text-sm text-foreground @sm:mt-0 @sm:col-span-2",children:l.jsx("div",{className:"flex flex-wrap gap-1.5",children:(Array.isArray(i)?i:Object.keys(i)).map(f=>l.jsx("code",{className:"text-xs bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:f},f))})})]})]})})]},n)})]})};function G0(e){return e.startsWith("http://")||e.startsWith("https://")}function fd(e){return e.replace(/([A-Z])/g," $1").replace(/^(.)/,t=>t.toUpperCase()).trim()}function dd({value:e}){if(e==null)return null;if(typeof e=="string"&&G0(e))return l.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 l.jsx("span",{className:`text-xs font-medium ${e?"text-green-600":"text-red-500"}`,children:e?"true":"false"});if(typeof e=="number")return l.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)?l.jsx("div",{className:"flex flex-wrap gap-1",children:t.enum.map((n,r)=>l.jsx("span",{className:"text-xs font-mono bg-neutral-100 text-foreground-secondary px-1.5 py-0.5 rounded",children:String(n)},r))}):typeof t.type=="string"&&typeof t.description=="string"&&Object.keys(t).length===2?l.jsx(wt,{className:"prose-sm",children:t.description}):l.jsx("div",{className:"mt-1 border-l-2 border-border pl-3 space-y-2",children:Object.entries(t).map(([n,r])=>l.jsxs("div",{className:"flex items-start gap-2",children:[l.jsx("span",{className:"text-xs text-foreground-muted shrink-0 w-36",children:fd(n)}),l.jsx(dd,{value:r})]},n))})}return l.jsx("span",{className:"text-xs text-foreground-secondary",children:String(e)})}function pd({bindings:e,expand:t=!1,protocol:n,focused:r}){const s=ih[n.toLowerCase()]??{label:n,color:"bg-neutral-100 text-foreground-secondary border-border"},o=Object.entries(e??{}).filter(([i,a])=>i!=="bindingVersion"&&a!==void 0&&a!==null);return o.length===0?null:l.jsx(Mr,{className:"mt-2",defaultExpanded:t,forceExpanded:r,trigger:l.jsx("span",{className:`text-xs font-medium px-2 py-0.5 rounded border ${s.color}`,children:s.label}),children:l.jsx("div",{className:"divide-y divide-neutral-100",children:o.length===0?l.jsx("p",{className:"px-4 py-3 text-xs text-foreground-muted italic",children:"No binding properties defined."}):o.map(([i,a])=>l.jsxs("div",{className:"flex items-center items-start gap-4 px-4 py-3",children:[l.jsx("span",{className:"text-xs font-medium text-foreground-muted w-40 shrink-0 pt-0.5",children:fd(i)}),l.jsx("div",{className:"flex-1 min-w-0",children:l.jsx(dd,{value:a})})]},i))})})}function eb({host:e,protocol:t,description:n,tags:r,variables:s,security:o,bindings:i,serverKey:a,focusSection:c=null}){const u=s,f=A.useId();return l.jsxs("div",{children:[l.jsx(cd,{address:e,variables:u,children:l.jsx("div",{className:"mt-2",children:r&&r.map((d,p)=>{const h=d,m=h.externalDocs;return l.jsx(Oa,{href:m&&m.url,title:h.description||(m&&m.description?m.description:void 0),name:h.name},p)})})}),l.jsx(wt,{children:n}),o&&o.length>0&&l.jsxs("div",{id:a?`server-${a}-security`:void 0,children:[l.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[l.jsx(ld,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Authorization"]}),l.jsxs("p",{className:"prose text-foreground-muted mt-4",children:["This server accepts the following authorization mechanism",o.length>1?"s":"",":"]}),l.jsx(Mr,{className:"mt-4",ariaLabelledBy:f,forceExpanded:c==="security",trigger:l.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:o.length}),children:l.jsx("div",{className:"px-4 py-2 border-t border-border",children:l.jsx(Ia,{securities:o})})})]}),(()=>{const d=i==null?void 0:i[t];return d&&Object.keys(d).some(h=>h!=="bindingVersion")?l.jsxs("div",{id:a?`server-${a}-bindings`:void 0,children:[l.jsxs("h3",{className:"font-bold text-foreground-secondary mt-8",children:[l.jsx(sa,{className:"inline-block mr-2 -mt-1 h-6 text-foreground-muted"}),"Connection Settings"]}),l.jsx("p",{className:"prose text-foreground-muted mt-4",children:"This server accepts the following connection configuration:"}),l.jsx(pd,{bindings:d,protocol:t,focused:c===`binding:${t}`})]}):null})()]})}function hd({servers:e,selectedServer:t,onSelectServer:n,focusSection:r=null}){const s=Object.keys(e),[o,i]=A.useState(void 0),a=[t,o].find(f=>!!f&&s.includes(f))??s[0],c=f=>{i(f),n==null||n(f)},u=l.jsx(eb,{...e[a],serverKey:a,focusSection:t||o?r:null});return l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{title:Su,content:u,sideContent:l.jsx(ad,{serverNames:s,current:a,setCurrent:c}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}const md=A.forwardRef(function({isOpen:t,side:n,onClose:r,title:s,headerActions:o,children:i,width:a="w-[50rem]"},c){A.useEffect(()=>{const g=v=>{v.key==="Escape"&&r()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[r]);const u=n==="right"?"translate-x-full":"-translate-x-full",f=n==="right"?"right-0":"left-0",{portalHost:d,rootElement:p}=Ve();A.useEffect(()=>{if(!(!t||!d))return Iu(Ru(d))},[t,d]);const h=Ks(p,!0),m=h?{position:"fixed",top:0,left:h.left,width:h.width,height:"100vh"}:{position:"fixed",inset:0};return d?Ar.createPortal(l.jsxs("div",{className:"z-50 overflow-hidden",style:{...m,pointerEvents:t?"auto":"none"},children:[l.jsx("div",{onClick:r,className:`absolute inset-0 bg-black/30 transition-opacity duration-300 ${t?"opacity-100":"opacity-0"}`,style:{pointerEvents:t?"auto":"none"}}),l.jsxs("div",{ref:c,className:`absolute top-0 ${f} h-full ${a} max-w-[100cqw] bg-background shadow-xl flex flex-col transition-transform duration-300 ease-in-out ${t?"translate-x-0":u}`,children:[s&&l.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[l.jsx("div",{className:"text-sm font-semibold text-foreground min-w-0 flex-1 overflow-hidden",children:typeof s=="string"?l.jsx("span",{className:"truncate block",children:s}):s}),o,l.jsx("button",{onClick:r,className:"ml-4 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors","aria-label":"Close panel",children:l.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:l.jsx("path",{d:"M2 2l12 12M14 2L2 14"})})})]}),l.jsx("div",{className:"flex-1 overflow-y-auto px-5 py-4",children:i})]})]}),d):null});function gd({getMarkdown:e,label:t}){const[n,r]=A.useState(!1),s=A.useRef(void 0);A.useEffect(()=>()=>{s.current&&clearTimeout(s.current)},[]);const o=async()=>{try{await navigator.clipboard.writeText(e()),r(!0),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>r(!1),2e3)}catch(i){console.error("[CopyMarkdownButton] copy failed:",i)}};return l.jsx("button",{type:"button",onClick:o,title:t,"aria-label":t,className:"ml-2 p-1 rounded hover:bg-neutral-100 text-foreground-muted hover:text-foreground-secondary transition-colors",children:n?l.jsx(ia,{className:"w-4 h-4 text-green-600"}):l.jsx(oa,{className:"w-4 h-4"})})}function yd({message:e,messageId:t,i:n}){const[r,s]=A.useState(!1);return l.jsxs("div",{className:"border border-border rounded-lg overflow-hidden",children:[l.jsxs("div",{className:"px-4 py-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsx("p",{className:"text-sm font-medium text-foreground",children:e.title??e.name??`Message ${n+1}`}),(t??e.name)&&l.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&&l.jsx("p",{className:"text-xs text-foreground-muted mt-1.5 leading-relaxed",children:e.summary}),l.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 mt-4",children:[e.contentType&&l.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&&l.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&&l.jsx("span",{className:"text-xs bg-red-50 text-red-500 px-1.5 py-0.5 rounded border border-red-200",children:"deprecated"})]})]}),l.jsx(od,{message:e,expanded:r,onToggleExpanded:()=>s(o=>!o)})]})}function tb({requestMessages:e,reply:t,isSend:n,operationId:r}){const[s,o]=A.useState("request"),i=t.messages??[],a=t.channel,c=t.address,u=s==="request"?e:i,f=s==="request"?n?"accepts":"expects":l.jsxs(l.Fragment,{children:["replies to"," ",c?l.jsxs(l.Fragment,{children:["a channel in"," ",l.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})]}):(a==null?void 0:a.address)&&l.jsx(Xt,{address:a.address,parameters:a.parameters,className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-semibold bg-surface border border-border text-foreground-secondary"})]});return l.jsxs("div",{children:[l.jsx("div",{className:"flex items-end gap-0.5 -ml-2",children:["request","reply"].map(d=>l.jsx("button",{onClick:()=>o(d),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize
|
|
128
|
-
${s===d?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:d},d))}),l.jsx("div",{className:"-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32",children:u.length>0?l.jsxs(l.Fragment,{children:[l.jsxs("p",{className:"text-sm text-foreground-secondary mb-3",children:[l.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:r})," ",f,u.length>1?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 font-bold text-foreground-secondary",children:"one of"}),"the following messages:"]}):l.jsxs("span",{children:[" "," with the following message:"]})]}),l.jsx("div",{className:"space-y-2",children:u.map((d,p)=>l.jsx(yd,{message:d,messageId:d.name,i:p},p))})]}):l.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No messages defined."})})]})}function nb({op:e,id:t,focusSection:n=null}){var m;const r=A.useId(),s=e.messages??[],o=e.tags??[],i=e.bindings,a=e.traits,c=e.reply,u=e.externalDocs,f=e.security,d=i??(Array.isArray(a)?(m=a.find(g=>g.bindings))==null?void 0:m.bindings:void 0),p=e.action===ks.SEND,h=l.jsx("div",{className:"space-y-2",children:s.map((g,v)=>l.jsx(yd,{message:g,messageId:g.name,i:v},v))});return l.jsxs("div",{className:"space-y-6",id:`operation-${t}-detail`,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.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]}),(u==null?void 0:u.url)&&l.jsxs("a",{href:u.url,target:"_blank",rel:"noreferrer",title:u.description||u.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",l.jsx(Ys,{className:"w-3.5 h-3.5"})]})]}),e.description&&l.jsx("div",{children:l.jsx(wt,{children:e.description})}),e.summary&&l.jsx("div",{children:l.jsx("p",{className:"text-sm text-foreground-secondary",children:e.summary})}),f&&f.length>0&&l.jsxs("div",{id:`operation-${t}-security`,children:[l.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Operation Authorization"}),l.jsx(Mr,{ariaLabelledBy:r,forceExpanded:n==="security",trigger:l.jsx("span",{className:"text-xs font-normal text-foreground-muted bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:f.length}),children:l.jsx("div",{className:"px-4 py-2 border-t border-border",children:l.jsx(Ia,{securities:f})})})]}),d&&Object.entries(d).map(([g,v])=>v?l.jsxs("div",{id:`operation-${t}-bindings-${g}`,children:[l.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-1",children:"Operation configuration"}),l.jsx(pd,{protocol:g,bindings:v,focused:n===`binding:${g}`})]},g):null),c?l.jsx(tb,{requestMessages:s,reply:c,isSend:p,operationId:t}):s.length>0&&l.jsxs("div",{children:[l.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:[l.jsx("span",{className:"font-bold",children:t})," ",p?"accepts":"expects",s.length>1?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded text-xs font-bold text-foreground-mute",children:"one of"}),"the following messages:"]}):" the following message:"]}),h]}),o.length>0&&l.jsxs("div",{children:[l.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Tags"}),l.jsx("div",{className:"flex flex-wrap gap-1.5",children:o.map((g,v)=>l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs bg-neutral-100 text-foreground-secondary",children:g.name},v))})]})]})}function xd({operations:e,selectedKey:t=null,onSelectKey:n,focusSection:r=null,showCopyMarkdown:s}){const o=m=>n==null?void 0:n(m),{document:i,deref:a}=Ve(),c=i;if(!Object.keys(e).length)return null;const u=t?e[t]:null,f=Object.keys(e).map(m=>{var k;const g=e[m],v=g.channel,j=v==null?void 0:v.address,y=v==null?void 0:v.parameters,b=((k=g.action)==null?void 0:k.toUpperCase())??"",S=t===m;return l.jsxs("tr",{id:`operation-${m}`,onClick:()=>o(m),role:"button",tabIndex:0,"aria-label":`${b||"Operation"} ${j??m}`,"aria-current":S?"true":void 0,onKeyDown:w=>{w.key!=="Enter"&&w.key!==" "||(w.preventDefault(),o(m))},className:`group cursor-pointer ${S?"bg-neutral-50":""}`,children:[l.jsx("td",{className:"px-6 py-4 max-w-0 w-full group-hover:bg-neutral-50",children:j&&l.jsx(Xt,{address:j,parameters:y,truncate:!0})}),l.jsx("td",{className:"px-6 py-4 w-32 group-hover:bg-neutral-50",children:l.jsx(Qt,{method:g.action,className:"w-24"})}),l.jsx("td",{className:"group-hover:bg-neutral-50"})]},m)}),d=u?u.channel:null,p=u&&(d!=null&&d.address)?l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Qt,{method:u.action}),l.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:l.jsx(Xt,{address:d.address,parameters:d.parameters})})]}):t??"Operation",h=l.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-neutral-100 w-full",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Operation"}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider"})]})}),l.jsx("tbody",{className:"bg-surface divide-y divide-border",children:f})]})});return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{title:sh,content:h,stickySideContent:!1})}),l.jsx(md,{isOpen:!!u,side:"right",onClose:()=>o(null),title:p,headerActions:u&&t&&s?l.jsx(gd,{getMarkdown:()=>Qm(c,t,a),label:"Copy operation for LLM"}):void 0,children:u&&l.jsx(nb,{op:u,id:t,focusSection:r})})]})}function no({schemas:e,selectedKey:t,focusTarget:n}){const{deref:r}=Ve(),s=ha(),o=A.useMemo(()=>Object.entries(e).map(([a,c])=>[a,vr(c,r)]),[e,r,s]),i=o.length?l.jsx("div",{className:"grid gap-6 w-full",children:o.map(([a,c])=>{const u=c.schema,f=Ju(c.schemaFormat),d=u.properties?Object.keys(u.properties).length:0;return l.jsxs("article",{id:`schema-${a}`,className:`rounded-xl border bg-surface p-5 shadow-sm transition-colors ${t===a?"border-primary-300 ring-1 ring-primary-200":"border-border"}`,children:[l.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-base font-semibold text-foreground",children:a}),c.description&&l.jsx("p",{className:"mt-1 text-sm text-foreground-secondary",children:c.description})]}),l.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||f||d>0)&&l.jsxs("div",{className:"mt-4 flex flex-wrap gap-2 text-xs text-foreground-secondary",children:[u.format&&l.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:["Format: ",u.format]}),f&&l.jsx("span",{className:"rounded-full bg-neutral-100 px-3 py-1",title:c.schemaFormat,children:f}),d>0&&l.jsxs("span",{className:"rounded-full bg-neutral-100 px-3 py-1",children:[d," properties"]})]}),c.conversionError&&l.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"," ",Yu(c.schemaFormat)??"the"," schema — showing raw definition. ",c.conversionError]}),c.pendingConversion&&l.jsx("p",{className:"mt-4 text-xs text-foreground-muted",children:"Loading Protobuf definition…"}),c.pendingConversion?null:c.conversionError&&typeof c.originalSchema=="string"?l.jsx("div",{className:"mt-4",children:l.jsx(Pf,{schema:c.originalSchema})}):l.jsx(Ra,{schema:u,rootName:a,className:"mt-4",focusTokens:a===t?(n==null?void 0:n.tokens)??null:null,focusId:a===t?(n==null?void 0:n.id)??null:null})]},a)})}):l.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 l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{content:i,stickySideContent:!1})})}const rb=e=>e==="operations"||e==="messages"||e==="schemas";function sb({asyncapi:e,config:t}){var k,w,E,C;const n=t.show??{},r=[...n.operations!==!1?[{id:"operations",name:"Operations",icon:Js}]:[],...n.messages!==!1?[{id:"messages",name:"Messages",icon:Cu}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:na}]:[]],{query:s,setQuery:o,results:i}=Em(e,{threshold:.3,limit:20}),{effectiveTab:a,focusTab:c,navActiveSection:u,selected:f,setSelectedKey:d,selectedNavItem:p,handleSearchSelect:h,handleNavItemSelect:m,handleNavServerSelect:g,handleContentTabChange:v,focusSection:j,schemaFocusTarget:y}=Vu({tabs:r,defaultTab:"operations",isTabKey:rb,sections:[{id:"operations",visible:n.operations!==!1},{id:"messages",visible:n.messages!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:s}),b=e.servers?Object.keys(e.servers):[],S=a==="operations"?l.jsx(xd,{operations:e.operations??{},selectedKey:f.operations,onSelectKey:O=>d("operations",O),focusSection:j,showCopyMarkdown:n.copyMarkdown!==!1}):a==="messages"?l.jsx(id,{messages:((k=e.components)==null?void 0:k.messages)??{},selectedKey:f.messages,focusSection:j}):a==="schemas"?l.jsx(no,{schemas:((w=e.components)==null?void 0:w.schemas)??{},selectedKey:f.schemas,focusTarget:y}):null;return l.jsx(ea,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:l.jsxs("div",{className:"px-4",children:[n.search!==!1&&l.jsx(Pu,{query:s,onQueryChange:o,results:i,onSelectResult:h}),n.copyMarkdown!==!1&&l.jsx($u,{serialize:O=>Zm(e,O),leftOffset:n.search!==!1?60:12}),n.info!==!1&&l.jsx("div",{id:"info-panel",children:l.jsx(If,{...e.info})}),n.servers!==!1&&b.length>0&&l.jsx("div",{id:`server-${f.servers??b[0]}`,children:l.jsx(hd,{servers:e.servers,selectedServer:f.servers,onSelectServer:O=>d("servers",O),focusSection:j})}),n.sidebar!==!1&&l.jsx(Eh,{operations:n.operations!==!1?e.operations:void 0,messages:n.messages!==!1?(E=e.components)==null?void 0:E.messages:void 0,schemas:n.schemas!==!1?(C=e.components)==null?void 0:C.schemas:void 0,servers:n.servers!==!1?e.servers:void 0,hasInfo:n.info!==!1,sidebarConfig:t.sidebar,activeTab:u,onTabChange:c,onItemSelect:m,onSelectServer:g,selectedItem:p}),l.jsx(ku,{tabs:r,current:a,onChange:v}),a&&l.jsx("div",{id:`panel-${a}`,role:"tabpanel","aria-labelledby":`tab-${a}`,children:S})]})})}const Pa=e=>l.jsx(Qi,{fallback:e.errorFallback,onError:e.onError,children:l.jsx(ob,{...e})}),ob=e=>{const t=e.asyncapi,n=A.useMemo(()=>Tr(t),[t]),r=e.kind;A.useEffect(()=>{r==="resolved"&&n!==t&&Xi(t)&&console.warn('[apiuikit] <AsyncAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??zn;return l.jsx(sb,{asyncapi:n,config:s})};function $a({document:e,config:t=zn,className:n="",children:r}){const{contextValue:s,themeVars:o,setPortalHost:i,setRootElement:a}=Eu("openapi",e,t);return l.jsx(Vs.Provider,{value:s,children:l.jsxs("div",{ref:a,style:o,className:`relative @container bg-background text-foreground p-2 ${n}`,children:[l.jsx("div",{ref:i,className:"openapi-portal-root"}),r]})})}function ib(e){var r;const t=[];if(e.info){const s=e.info.title??"Info";t.push({id:"info-panel",targetId:"info-panel",type:"info",tab:"info",key:"info",name:s,path:"info",location:"Info",subtitle:e.info.description,text:st([e.info,e.tags,e.externalDocs])})}e.servers&&e.servers.forEach((s,o)=>{const i=`server-${o}`;t.push({id:i,targetId:i,type:"server",tab:"servers",key:i,name:s.description??s.url??i,path:`servers[${o}]`,location:`Servers > ${s.url??i}`,subtitle:s.url,text:st([s.url,s.description,s.variables])})});const n=(s,{tab:o,type:i,idPrefix:a,docKey:c,sectionLabel:u})=>{for(const f of Object.keys(s)){const d=s[f];if(d)for(const p of ra){const h=d[p];if(!h)continue;const m=`${p} ${f}`,g=h.summary??`${p.toUpperCase()} ${f}`;t.push({id:`${a}-${m}`,targetId:`${a}-${m}-detail`,type:i,tab:o,key:m,name:g,path:`${c}.${f}.${p}`,location:`${u} > ${p.toUpperCase()} ${f}`,subtitle:h.description,text:st([p,f,h.summary,h.description,h.operationId,h.tags,h.parameters,h.security])})}}};if(e.paths&&n(e.paths,{tab:"endpoints",type:"endpoint",idPrefix:"endpoint",docKey:"paths",sectionLabel:"Endpoints"}),e.webhooks&&n(e.webhooks,{tab:"webhooks",type:"webhook",idPrefix:"webhook",docKey:"webhooks",sectionLabel:"Webhooks"}),(r=e.components)!=null&&r.schemas)for(const[s,o]of Object.entries(e.components.schemas))Mu(t,o,s,s);return t}function ab(e,t={}){return zu(e,ib,t)}function bd({info:e,tags:t,externalDocs:n}){const{title:r,description:s,license:o,contact:i}=e;return l.jsx(Rf,{title:r,description:s,license:o,contact:i,externalDocs:n,tags:t,extensionsSource:e})}function lb({url:e,description:t,variables:n}){return l.jsxs("div",{children:[l.jsx(cd,{address:e,variables:n}),t&&l.jsx(wt,{children:t})]})}const Ho=e=>`server-${e}`,qo=e=>Number(e.slice(7));function vd({servers:e,selectedServer:t,onSelectServer:n}){const r=e.map((d,p)=>d.url||Ho(p)),[s,o]=A.useState(void 0),i=d=>!!d&&qo(d)>=0&&qo(d)<e.length,a=i(t)?t:i(s)?s:Ho(0),c=e[qo(a)],u=d=>{o(d),n==null||n(d)},f=c?l.jsx(lb,{...c}):null;return l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{title:Su,content:f,sideContent:l.jsx(ad,{serverNames:r,current:(c==null?void 0:c.url)||a,setCurrent:d=>{const p=r.indexOf(d);u(p>=0?Ho(p):d)}}),stickySideContent:!0,reverseLayoutOnMobile:!0})})}function wd(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[r,s]of Object.entries(e.properties)){const o=/id$/i.test(r)&&s.type==="string"&&!s.format&&!s.examples,i=s.type==="string"&&!s.format&&!s.examples&&!s.enum;n[r]=o?{...s,format:"uuid"}:i?{...s,examples:["string"]}:wd(s,t)}return{...e,properties:n}}finally{t.delete(e)}}return e}async function cb(e){try{return await sd(wd(e),{seed:42,useExamplesValue:!0,optionalsProbability:1})}catch{return}}const Rc="",Ic=`
|
|
129
|
-
`;var he=class{constructor({indent:e,join:t}={}){this.postProcessors=[],this.code=[],this.indentationCharacter=Rc,this.lineJoin=Ic,this.indentLine=(n,r=0)=>`${this.indentationCharacter.repeat(r)}${n}`,this.unshift=(n,r)=>{const s=this.indentLine(n,r);this.code.unshift(s)},this.push=(n,r)=>{const s=this.indentLine(n,r);this.code.push(s)},this.pushToLast=n=>{this.code||this.push(n);const r=`${this.code[this.code.length-1]}${n}`;this.code[this.code.length-1]=r},this.blank=()=>{this.code.push("")},this.join=()=>{const n=this.code.join(this.lineJoin);return this.postProcessors.reduce((r,s)=>s(r),n)},this.addPostProcessor=n=>{this.postProcessors=[...this.postProcessors,n]},this.indentationCharacter=e||Rc,this.lineJoin=t??Ic}},ub=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},fb=function(e){var t=typeof e;return e!==null&&(t==="object"||t==="function")},Ma={};Object.defineProperty(Ma,"__esModule",{value:!0});Ma.default=e=>Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t));const db=ub,pb=fb,hb=Ma.default;var mb=(e,t,n)=>{const r=[];return(function s(o,i,a){i=i||{},i.indent=i.indent||" ",a=a||"";let c;i.inlineCharacterLimit===void 0?c={newLine:`
|
|
130
|
-
`,newLineOrSpace:`
|
|
131
|
-
`,pad:a,indent:a+i.indent}:c={newLine:"@@__STRINGIFY_OBJECT_NEW_LINE__@@",newLineOrSpace:"@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",pad:"@@__STRINGIFY_OBJECT_PAD__@@",indent:"@@__STRINGIFY_OBJECT_INDENT__@@"};const u=f=>{if(i.inlineCharacterLimit===void 0)return f;const d=f.replace(new RegExp(c.newLine,"g"),"").replace(new RegExp(c.newLineOrSpace,"g")," ").replace(new RegExp(c.pad+"|"+c.indent,"g"),"");return d.length<=i.inlineCharacterLimit?d:f.replace(new RegExp(c.newLine+"|"+c.newLineOrSpace,"g"),`
|
|
132
|
-
`).replace(new RegExp(c.pad,"g"),a).replace(new RegExp(c.indent,"g"),a+i.indent)};if(r.indexOf(o)!==-1)return'"[Circular]"';if(o==null||typeof o=="number"||typeof o=="boolean"||typeof o=="function"||typeof o=="symbol"||db(o))return String(o);if(o instanceof Date)return`new Date('${o.toISOString()}')`;if(Array.isArray(o)){if(o.length===0)return"[]";r.push(o);const f="["+c.newLine+o.map((d,p)=>{const h=o.length-1===p?c.newLine:","+c.newLineOrSpace;let m=s(d,i,a+i.indent);return i.transform&&(m=i.transform(o,p,m)),c.indent+m+h}).join("")+c.pad+"]";return r.pop(),u(f)}if(pb(o)){let f=Object.keys(o).concat(hb(o));if(i.filter&&(f=f.filter(p=>i.filter(o,p))),f.length===0)return"{}";r.push(o);const d="{"+c.newLine+f.map((p,h)=>{const m=f.length-1===h?c.newLine:","+c.newLineOrSpace,g=typeof p=="symbol",v=!g&&/^[a-z$_][a-z$_0-9]*$/i.test(p),j=g||v?p:s(p,i);let y=s(o[p],i,a+i.indent);return i.transform&&(y=i.transform(o,p,y)),c.indent+String(j)+": "+y+m}).join("")+c.pad+"}";return r.pop(),u(d)}return o=String(o).replace(/[\r\n]/g,f=>f===`
|
|
133
|
-
`?"\\n":"\\r"),i.singleQuotes===!1?(o=o.replace(/"/g,'\\"'),`"${o}"`):(o=o.replace(/\\?'/g,"\\'"),`'${o}'`)})(e,t,n)};const Ot=Zs(mb),Ze=(e,t)=>Object.keys(e).find(n=>n.toLowerCase()===t.toLowerCase()),Rt=(e,t)=>{const n=Ze(e,t);if(n)return e[n]},Ds=(e,t)=>!!Ze(e,t),gb=e=>["application/json","application/x-json","text/json","text/x-json","+json"].some(t=>e.indexOf(t)>-1),yb={info:{key:"agent",title:"Agent",default:"prompt"},clientsById:{prompt:{info:{key:"prompt",title:"Agent Prompt",link:"https://github.com/readmeio/httpsnippet",description:"A copy-and-pastable prompt, for any AI agent, describing how to make the request.",extname:".txt"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const o={indent:" ",join:`
|
|
134
|
-
`,...s},{blank:i,push:a,join:c}=new he(o);a("Write code that makes the HTTP request described below. Use my preferred programming language and HTTP client library — if I haven't told you what those are, ask me before writing any code."),i(),a(`Method: ${e}`),a(`URL: ${t}`);const u=Object.keys(n);return u.length&&(i(),a("Headers:"),u.forEach(f=>{a(`${f}: ${n[f]}`,1)})),r.text&&(i(),a(`Body (${r.mimeType}):`),a(r.text)),i(),a("The request the code makes must match the method, URL, headers, and body exactly as described above."),o.markdownURL&&(i(),a(`Check ${o.markdownURL} for more info.`)),c()}}}};function Er(e,t={}){const{delimiter:n='"',escapeChar:r="\\",escapeNewlines:s=!0}=t;return[...e.toString()].map(o=>o==="\b"?`${r}b`:o===" "?`${r}t`:o===`
|
|
135
|
-
`?s?`${r}n`:o:o==="\f"?`${r}f`:o==="\r"?s?`${r}r`:o:o===r?r+r:o===n?r+n:o<" "||o>"~"?JSON.stringify(o).slice(1,-1):o).join("")}const Un=e=>Er(e,{delimiter:"'"}),Ue=e=>Er(e,{delimiter:'"'}),xb={info:{key:"c",title:"C",default:"libcurl",cli:"c"},clientsById:{libcurl:{info:{key:"libcurl",title:"Libcurl",link:"http://curl.haxx.se/libcurl",description:"Simple REST and HTTP API Client for C",extname:".c"},convert:({method:e,fullUrl:t,headersObj:n,allHeaders:r,postData:s})=>{const{push:o,blank:i,join:a}=new he;o("CURL *hnd = curl_easy_init();"),i(),o(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`),o("curl_easy_setopt(hnd, CURLOPT_WRITEDATA, stdout);"),o(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);const c=Object.keys(n);return c.length&&(i(),o("struct curl_slist *headers = NULL;"),c.forEach(u=>{o(`headers = curl_slist_append(headers, "${u}: ${Ue(n[u])}");`)}),o("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")),r.cookie&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${r.cookie}");`)),s.text&&(i(),o(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(s.text)});`)),i(),o("CURLcode ret = curl_easy_perform(hnd);"),a()}}}};var Pc=class{constructor(e){this.name="",this.toString=()=>`:${this.name}`,this.name=e}},bb=class{constructor(e){this.path="",this.toString=()=>`(clojure.java.io/file "${this.path}")`,this.path=e}};const Sd=e=>e===void 0?null:e===null?"null":e.constructor.name.toLowerCase(),jd=e=>e===void 0?!0:Sd(e)==="object"?Object.keys(e).length===0:!1,$c=e=>(Object.keys(e).filter(t=>jd(e[t])).forEach(t=>{delete e[t]}),e),bs=(e,t)=>{const n=" ".repeat(e);return t.replace(/\n/g,`
|
|
136
|
-
${n}`)},$i=e=>{switch(Sd(e)){case"string":return`"${e.replace(/"/g,'\\"')}"`;case"file":return e.toString();case"keyword":return e.toString();case"null":return"nil";case"regexp":return`#"${e.source}"`;case"object":{const t=Object.keys(e).reduce((n,r)=>`${n}:${r} ${bs(r.length+2,$i(e[r]))}
|
|
137
|
-
`,"").trim();return`{${bs(1,t)}}`}case"array":{const t=e.reduce((n,r)=>`${n} ${$i(r)}`,"").trim();return`[${bs(1,t)}]`}default:return e.toString()}},vb={info:{key:"clojure",title:"Clojure",default:"clj_http"},clientsById:{clj_http:{info:{key:"clj_http",title:"clj-http",link:"https://github.com/dakrone/clj-http",description:"An idiomatic clojure http client wrapping the apache client.",extname:".clj"},convert:({queryObj:e,method:t,postData:n,url:r,allHeaders:s},o)=>{const{push:i,join:a}=new he({indent:o==null?void 0:o.indent}),c=["get","post","put","delete","patch","head","options"];if(t=t.toLowerCase(),!c.includes(t))return i("Method not supported"),a();const u={headers:s,"query-params":e};switch(n.mimeType){case"application/json":{u["content-type"]=new Pc("json"),u["form-params"]=n.jsonObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"application/x-www-form-urlencoded":{u["form-params"]=n.paramsObj;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"text/plain":{u.body=n.text;const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break;case"multipart/form-data":if(n.params){u.multipart=n.params.map(d=>d.fileName&&!d.value?{name:d.name,content:new bb(d.fileName)}:{name:d.name,content:d.value});const f=Ze(u.headers,"content-type");f&&delete u.headers[f]}break}switch(Rt(u.headers,"accept")){case"application/json":{u.accept=new Pc("json");const f=Ze(u.headers,"accept");f&&delete u.headers[f]}break}if(i(`(require '[clj-http.client :as client])
|
|
138
|
-
`),jd($c(u)))i(`(client/${t} "${r}")`);else{const f=11+t.length+r.length,d=bs(f,$i($c(u)));i(`(client/${t} "${r}" ${d})`)}return a()}}}},wb={info:{key:"crystal",title:"Crystal",default:"native"},clientsById:{native:{info:{key:"native",title:"http::client",link:"https://crystal-lang.org/api/master/HTTP/Client.html",description:"Crystal HTTP client",extname:".cr"},convert:({method:e,fullUrl:t,postData:n,allHeaders:r},s={})=>{const{insecureSkipVerify:o=!1}=s,{push:i,blank:a,join:c}=new he;i('require "http/client"'),a(),i(`url = "${t}"`);const u=Object.keys(r);u.length&&(i("headers = HTTP::Headers{"),u.forEach(g=>{i(` "${g}" => "${Ue(r[g])}"`)}),i("}")),n.text&&i(`reqBody = ${JSON.stringify(n.text)}`),a();const f=e.toUpperCase(),d=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS"],p=u.length?", headers: headers":"",h=n.text?", body: reqBody":"",m=o?", tls: OpenSSL::SSL::Context::Client.insecure":"";return d.includes(f)?i(`response = HTTP::Client.${f.toLowerCase()} url${p}${h}${m}`):i(`response = HTTP::Client.exec "${f}", url${p}${h}${m}`),i("puts response.body"),c()}}}},Sb=e=>{let t=Rt(e,"accept-encoding");if(!t)return[];const n={gzip:"DecompressionMethods.GZip",deflate:"DecompressionMethods.Deflate"},r=[];return typeof t=="string"&&(t=[t]),t.forEach(s=>{s.split(",").forEach(o=>{const i=/\s*([^;\s]+)/.exec(o);if(i){const a=n[i[1]];a&&r.push(a)}})}),r},jb={info:{key:"httpclient",title:"HttpClient",link:"https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",description:".NET Standard HTTP Client",extname:".cs"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var p,h;const{push:o,join:i}=new he({indent:{indent:" ",...s}.indent});o("using System.Net.Http.Headers;");let a="";const c=!!e.cookie,u=Sb(e);(c||u.length)&&(a="clientHandler",o("var clientHandler = new HttpClientHandler"),o("{"),c&&o("UseCookies = false,",1),u.length&&o(`AutomaticDecompression = ${u.join(" | ")},`,1),o("};")),o(`var client = new HttpClient(${a});`),o("var request = new HttpRequestMessage"),o("{");const f=["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS","TRACE"];n=n.toUpperCase(),n&&f.includes(n)?n=`HttpMethod.${n[0]}${n.substring(1).toLowerCase()}`:n=`new HttpMethod("${n}")`,o(`Method = ${n},`,1),o(`RequestUri = new Uri("${r}"),`,1);const d=Object.keys(e).filter(m=>{switch(m.toLowerCase()){case"content-type":case"content-length":case"accept-encoding":return!1;default:return!0}});if(d.length&&(o("Headers =",1),o("{",1),d.forEach(m=>{o(`{ "${m}", "${Ue(e[m])}" },`,2)}),o("},",1)),t.text){const m=t.mimeType;switch(m){case"application/x-www-form-urlencoded":o("Content = new FormUrlEncodedContent(new Dictionary<string, string>",1),o("{",1),(p=t.params)==null||p.forEach(g=>{o(`{ "${g.name}", "${g.value}" },`,2)}),o("}),",1);break;case"multipart/form-data":o("Content = new MultipartFormDataContent",1),o("{",1),(h=t.params)==null||h.forEach(g=>{o(`new StringContent(${JSON.stringify(g.value||"")})`,2),o("{",2),o("Headers =",3),o("{",3),g.contentType&&o(`ContentType = new MediaTypeHeaderValue("${g.contentType}"),`,4),o('ContentDisposition = new ContentDispositionHeaderValue("form-data")',4),o("{",4),o(`Name = "${g.name}",`,5),g.fileName&&o(`FileName = "${g.fileName}",`,5),o("}",4),o("}",3),o("},",2)}),o("},",1);break;default:o(`Content = new StringContent(${JSON.stringify(t.text||"")})`,1),o("{",1),o("Headers =",2),o("{",2),o(`ContentType = new MediaTypeHeaderValue("${m}")`,3),o("}",2),o("}",1);break}}return o("};"),o("using (var response = await client.SendAsync(request))"),o("{"),o("response.EnsureSuccessStatusCode();",1),o("var body = await response.Content.ReadAsStringAsync();",1),o("Console.WriteLine(body);",1),o("}"),i()}};function Eb(e){return e[0].toUpperCase()+e.slice(1).toLowerCase()}const kb={info:{key:"csharp",title:"C#",default:"restsharp",cli:"dotnet"},clientsById:{httpclient:jb,restsharp:{info:{key:"restsharp",title:"RestSharp",link:"http://restsharp.org/",description:"Simple REST and HTTP API Client for .NET",extname:".cs",installation:()=>"dotnet add package RestSharp"},convert:({method:e,fullUrl:t,headersObj:n,cookies:r,postData:s,uriObj:o})=>{const{push:i,join:a}=new he;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase()))return"Method not supported";i(`using RestSharp;
|
|
139
|
-
|
|
140
|
-
`),i(`var options = new RestClientOptions("${t}");`),i("var client = new RestClient(options);"),i('var request = new RestRequest("");');const c=s.mimeType&&s.mimeType==="multipart/form-data";switch(c&&i("request.AlwaysMultipartFormData = true;"),Object.keys(n).forEach(u=>{if(s.mimeType&&u.toLowerCase()==="content-type"&&s.text){c&&s.boundary&&i(`request.FormBoundary = "${s.boundary}";`);return}i(`request.AddHeader("${u}", "${Ue(n[u])}");`)}),r.forEach(({name:u,value:f})=>{i(`request.AddCookie("${u}", "${Ue(f)}", "${o.pathname}", "${o.host}");`)}),s.mimeType){case"multipart/form-data":if(!s.params)break;s.params.forEach(u=>{u.fileName?i(`request.AddFile("${u.name}", "${u.fileName}");`):i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/x-www-form-urlencoded":if(!s.params)break;s.params.forEach(u=>{i(`request.AddParameter("${u.name}", "${u.value}");`)});break;case"application/json":if(!s.text)break;i(`request.AddJsonBody(${JSON.stringify(s.text)}, false);`);break;default:if(!s.text)break;i(`request.AddStringBody("${s.text}", "${s.mimeType}");`)}return i(`var response = await client.${Eb(e)}Async(request);
|
|
141
|
-
`),i(`Console.WriteLine("{0}", response.Content);
|
|
142
|
-
`),a()}}}},Ab={info:{key:"go",title:"Go",default:"native",cli:"go"},clientsById:{native:{info:{key:"native",title:"NewRequest",link:"http://golang.org/pkg/net/http/#NewRequest",description:"Golang HTTP client request",extname:".go"},convert:({postData:e,method:t,allHeaders:n,fullUrl:r},s={})=>{const{blank:o,push:i,join:a}=new he({indent:" "}),{showBoilerplate:c=!0,checkErrors:u=!1,printBody:f=!0,timeout:d=-1,insecureSkipVerify:p=!1}=s,h=u?"err":"_",m=c?1:0,g=()=>{u&&(i("if err != nil {",m),i("panic(err)",m+1),i("}",m))};c&&(i("package main"),o(),i("import ("),i('"fmt"',m),d>0&&i('"time"',m),p&&i('"crypto/tls"',m),e.text&&i('"strings"',m),i('"net/http"',m),f&&i('"io"',m),i(")"),o(),i("func main() {"),o()),p&&(i("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()",m),i("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}",m));const v=d>0,j=v||p,y=j?"client":"http.DefaultClient";return j&&(i("client := http.Client{",m),v&&i(`Timeout: time.Duration(${d} * time.Second),`,m+1),p&&i("Transport: insecureTransport,",m+1),i("}",m),o()),i(`url := "${r}"`,m),o(),e.text?(i(`payload := strings.NewReader(${JSON.stringify(e.text)})`,m),o(),i(`req, ${h} := http.NewRequest("${t}", url, payload)`,m),o()):(i(`req, ${h} := http.NewRequest("${t}", url, nil)`,m),o()),g(),Object.keys(n).length&&(Object.keys(n).forEach(b=>{i(`req.Header.Add("${b}", "${Ue(n[b])}")`,m)}),o()),i(`res, ${h} := ${y}.Do(req)`,m),g(),f&&(o(),i("defer res.Body.Close()",m),i(`body, ${h} := io.ReadAll(res.Body)`,m),g()),o(),f&&i("fmt.Println(string(body))",m),c&&(o(),i("}")),a()}}}},Mc=`\r
|
|
143
|
-
`,Tb={info:{key:"http",title:"HTTP",default:"http1.1"},clientsById:{"http1.1":{info:{key:"http1.1",title:"HTTP/1.1",link:"https://tools.ietf.org/html/rfc7230",description:"HTTP/1.1 request string in accordance with RFC 7230",extname:null},convert:({method:e,fullUrl:t,uriObj:n,httpVersion:r,allHeaders:s,postData:o},i)=>{const a={absoluteURI:!1,autoContentLength:!0,autoHost:!0,...i},{blank:c,push:u,join:f}=new he({indent:"",join:Mc});u(`${e} ${a.absoluteURI?t:n.path} ${r}`);const d=Object.keys(s);d.forEach(m=>{const g=m.toLowerCase().replace(/(^|-)(\w)/g,v=>v.toUpperCase());u(`${g}: ${s[m]}`)}),a.autoHost&&!d.includes("host")&&u(`Host: ${n.host}`),a.autoContentLength&&o.text&&!d.includes("content-length")&&u(`Content-Length: ${Buffer.byteLength(o.text,"ascii").toString()}`),c();const p=f(),h=o.text||"";return`${p}${Mc}${h}`}}}},Ob={info:{key:"java",title:"Java",default:"unirest"},clientsById:{asynchttp:{info:{key:"asynchttp",title:"AsyncHttp",link:"https://github.com/AsyncHttpClient/async-http-client",description:"Asynchronous Http and WebSocket Client library for Java",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{blank:o,push:i,join:a}=new he({indent:{indent:" ",...s}.indent});return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"),i(`client.prepare("${e.toUpperCase()}", "${r}")`),Object.keys(t).forEach(c=>{i(`.setHeader("${c}", "${Ue(t[c])}")`,1)}),n.text&&i(`.setBody(${JSON.stringify(n.text)})`,1),i(".execute()",1),i(".toCompletableFuture()",1),i(".thenAccept(System.out::println)",1),i(".join();",1),o(),i("client.close();"),a()}},nethttp:{info:{key:"nethttp",title:"java.net.http",link:"https://openjdk.java.net/groups/net/httpclient/intro.html",description:"Java Standardized HTTP Client API",extname:".java"},convert:({allHeaders:e,fullUrl:t,method:n,postData:r},s)=>{const{push:o,join:i}=new he({indent:{indent:" ",...s}.indent});return o("HttpRequest request = HttpRequest.newBuilder()"),o(`.uri(URI.create("${t}"))`,2),Object.keys(e).forEach(a=>{o(`.header("${a}", "${Ue(e[a])}")`,2)}),r.text?o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`,2):o(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`,2),o(".build();",2),o("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"),o("System.out.println(response.body());"),i()}},okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".java"},convert:({postData:e,method:t,fullUrl:n,allHeaders:r},s)=>{const{push:o,blank:i,join:a}=new he({indent:{indent:" ",...s}.indent}),c=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return o("OkHttpClient client = new OkHttpClient();"),i(),e.text&&(e.boundary?o(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`):o(`MediaType mediaType = MediaType.parse("${e.mimeType}");`),o(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)),o("Request request = new Request.Builder()"),o(`.url("${n}")`,1),c.includes(t.toUpperCase())?u.includes(t.toUpperCase())?e.text?o(`.${t.toLowerCase()}(body)`,1):o(`.${t.toLowerCase()}(null)`,1):o(`.${t.toLowerCase()}()`,1):e.text?o(`.method("${t.toUpperCase()}", body)`,1):o(`.method("${t.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{o(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),o(".build();",1),i(),o("Response response = client.newCall(request).execute();"),a()}},unirest:{info:{key:"unirest",title:"Unirest",link:"http://unirest.io/java.html",description:"Lightweight HTTP Request Client Library",extname:".java"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const{join:o,push:i}=new he({indent:{indent:" ",...s}.indent});return["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(e.toUpperCase())?i(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${r}")`):i(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${r}")`),Object.keys(t).forEach(a=>{i(`.header("${a}", "${Ue(t[a])}")`,1)}),n.text&&i(`.body(${JSON.stringify(n.text)})`,1),i(".asString();",1),o()}}}},Nb={info:{key:"javascript",title:"JavaScript",default:"fetch"},clientsById:{xhr:{info:{key:"xhr",title:"XMLHttpRequest",link:"https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",description:"W3C Standard API that provides scripted client functionality",extname:".js"},convert:({postData:e,allHeaders:t,method:n,fullUrl:r},s)=>{var u;const o={indent:" ",cors:!0,...s},{blank:i,push:a,join:c}=new he({indent:o.indent});switch(e.mimeType){case"application/json":a(`const data = JSON.stringify(${Ot(e.jsonObj,{indent:o.indent})});`),i();break;case"multipart/form-data":if(!e.params)break;if(a("const data = new FormData();"),e.params.forEach(f=>{a(`data.append('${f.name}', '${f.value||f.fileName||""}');`)}),Ds(t,"content-type")&&(u=Rt(t,"content-type"))!=null&&u.includes("boundary")){const f=Ze(t,"content-type");f&&delete t[f]}i();break;default:a(`const data = ${e.text?`'${e.text}'`:"null"};`),i()}return a("const xhr = new XMLHttpRequest();"),o.cors&&a("xhr.withCredentials = true;"),i(),a("xhr.addEventListener('readystatechange', function () {"),a("if (this.readyState === this.DONE) {",1),a("console.log(this.responseText);",2),a("}",1),a("});"),i(),a(`xhr.open('${n}', '${r}');`),Object.keys(t).forEach(f=>{a(`xhr.setRequestHeader('${f}', '${Un(t[f])}');`)}),i(),a("xhr.send(data);"),c()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({allHeaders:e,method:t,url:n,queryObj:r,postData:s},o)=>{const{blank:i,push:a,join:c,addPostProcessor:u}=new he({indent:{indent:" ",...o}.indent});a("import axios from 'axios';"),i();const f={method:t,url:n};switch(Object.keys(r).length&&(f.params=r),Object.keys(e).length&&(f.headers=e),s.mimeType){case"application/x-www-form-urlencoded":s.params&&(a("const encodedParams = new URLSearchParams();"),s.params.forEach(d=>{a(`encodedParams.set('${d.name}', '${d.value}');`)}),i(),f.data="encodedParams,",u(d=>d.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":s.jsonObj&&(f.data=s.jsonObj);break;case"multipart/form-data":if(!s.params)break;a("const form = new FormData();"),s.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i(),f.data="[form]";break;default:s.text&&(f.data=s.text)}return a(`const options = ${Ot(f,{indent:" ",inlineCharacterLimit:80}).replace('"[form]"',"form")};`),i(),a("try {"),a("const { data } = await axios.request(options);",1),a("console.log(data);",1),a("} catch (error) {"),a("console.error(error);",1),a("}"),c()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,allHeaders:t,postData:n,fullUrl:r},s)=>{const o={indent:" ",credentials:null,...s},{blank:i,join:a,push:c}=new he({indent:o.indent}),u={method:e};switch(Object.keys(t).length&&(u.headers=t),o.credentials!==null&&(u.credentials=o.credentials),n.mimeType){case"application/x-www-form-urlencoded":u.body=n.paramsObj?n.paramsObj:n.text;break;case"application/json":n.jsonObj&&(u.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const f=Ze(t,"content-type");f&&delete t[f],c("const form = new FormData();"),n.params.forEach(d=>{c(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),i();break}default:n.text&&(u.body=n.text)}return u.headers&&!Object.keys(u.headers).length&&delete u.headers,c(`const options = ${Ot(u,{indent:o.indent,inlineCharacterLimit:80,transform:(f,d,p)=>{if(d==="body"){if(n.mimeType==="application/x-www-form-urlencoded")return`new URLSearchParams(${p})`;if(n.mimeType==="application/json")return`JSON.stringify(${p})`}return p}})};`),i(),n.params&&n.mimeType==="multipart/form-data"&&(c("options.body = form;"),i()),c(`fetch('${r}', options)`),c(".then(res => res.json())",1),c(".then(res => console.log(res))",1),c(".catch(err => console.error(err));",1),a()}},jquery:{info:{key:"jquery",title:"jQuery",link:"http://api.jquery.com/jquery.ajax/",description:"Perform an asynchronous HTTP (Ajax) requests with jQuery",extname:".js"},convert:({fullUrl:e,method:t,allHeaders:n,postData:r},s)=>{var f;const o={indent:" ",...s},{blank:i,push:a,join:c}=new he({indent:o.indent}),u={async:!0,crossDomain:!0,url:e,method:t,headers:n};switch(r.mimeType){case"application/x-www-form-urlencoded":u.data=r.paramsObj?r.paramsObj:r.text;break;case"application/json":u.processData=!1,u.data=r.text;break;case"multipart/form-data":if(!r.params)break;if(a("const form = new FormData();"),r.params.forEach(d=>{a(`form.append('${d.name}', '${d.value||d.fileName||""}');`)}),u.processData=!1,u.contentType=!1,u.mimeType="multipart/form-data",u.data="[form]",Ds(n,"content-type")&&(f=Rt(n,"content-type"))!=null&&f.includes("boundary")){const d=Ze(n,"content-type");d&&delete u.headers[d]}i();break;default:r.text&&(u.data=r.text)}return a(`const settings = ${Ot(u,{indent:o.indent}).replace("'[form]'","form")};`),i(),a("$.ajax(settings).done(res => {"),a("console.log(res);",1),a("});"),c()}}}},Cb={info:{key:"json",title:"JSON",default:"native"},clientsById:{native:{info:{key:"native",title:"Native JSON",link:"https://www.json.org/json-en.html",description:"A JSON represetation of any HAR payload.",extname:".json"},convert:({postData:e},t)=>{const n={indent:" ",...t};let r="";switch(e.mimeType){case"application/x-www-form-urlencoded":r=e.paramsObj?e.paramsObj:e.text;break;case"application/json":e.jsonObj&&(r=e.jsonObj);break;case"multipart/form-data":{if(!e.params)break;const s={};e.params.forEach(o=>{s[o.name]=o.value}),r=s;break}default:e.text&&(r=e.text)}return typeof r>"u"||r===""?"No JSON body":JSON.stringify(r,null,n.indent)}}}},_b={info:{key:"kotlin",title:"Kotlin",default:"okhttp"},clientsById:{okhttp:{info:{key:"okhttp",title:"OkHttp",link:"http://square.github.io/okhttp/",description:"An HTTP Request Client Library",extname:".kt"},convert:({postData:e,fullUrl:t,method:n,allHeaders:r},s)=>{const{blank:o,join:i,push:a}=new he({indent:{indent:" ",...s}.indent}),c=["GET","POST","PUT","DELETE","PATCH","HEAD"],u=["POST","PUT","DELETE","PATCH"];return a("val client = OkHttpClient()"),o(),e.text&&(e.boundary?a(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`):a(`val mediaType = MediaType.parse("${e.mimeType}")`),a(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)),a("val request = Request.Builder()"),a(`.url("${t}")`,1),c.includes(n.toUpperCase())?u.includes(n.toUpperCase())?e.text?a(`.${n.toLowerCase()}(body)`,1):a(`.${n.toLowerCase()}(null)`,1):a(`.${n.toLowerCase()}()`,1):e.text?a(`.method("${n.toUpperCase()}", body)`,1):a(`.method("${n.toUpperCase()}", null)`,1),Object.keys(r).forEach(f=>{a(`.addHeader("${f}", "${Ue(r[f])}")`,1)}),a(".build()",1),o(),a("val response = client.newCall(request).execute()"),i()}}}},Rb={info:{key:"node",title:"Node.js",default:"fetch",cli:"node %s"},clientsById:{native:{info:{key:"native",title:"HTTP",link:"http://nodejs.org/api/http.html#http_http_request_options_callback",description:"Node.js native HTTP interface",extname:".cjs"},convert:({uriObj:e,method:t,allHeaders:n,postData:r},s={})=>{var d;const{indent:o=" "}=s,{blank:i,join:a,push:c,unshift:u}=new he({indent:o}),f={method:t,hostname:e.hostname,port:e.port,path:e.path,headers:n};switch(c(`const http = require('${(d=e.protocol)==null?void 0:d.replace(":","")}');`),i(),c(`const options = ${Ot(f,{indent:o})};`),i(),c("const req = http.request(options, function (res) {"),c("const chunks = [];",1),i(),c("res.on('data', function (chunk) {",1),c("chunks.push(chunk);",2),c("});",1),i(),c("res.on('end', function () {",1),c("const body = Buffer.concat(chunks);",2),c("console.log(body.toString());",2),c("});",1),c("});"),i(),r.mimeType){case"application/x-www-form-urlencoded":r.paramsObj&&(u("const qs = require('querystring');"),c(`req.write(qs.stringify(${Ot(r.paramsObj,{indent:" ",inlineCharacterLimit:80})}));`));break;case"application/json":r.jsonObj&&c(`req.write(JSON.stringify(${Ot(r.jsonObj,{indent:" ",inlineCharacterLimit:80})}));`);break;default:r.text&&c(`req.write(${Ot(r.text,{indent:o})});`)}return c("req.end();"),a()}},axios:{info:{key:"axios",title:"Axios",link:"https://github.com/axios/axios",description:"Promise based HTTP client for the browser and node.js",extname:".js",installation:()=>"npm install axios --save"},convert:({method:e,fullUrl:t,allHeaders:n,postData:r},s)=>{const{blank:o,join:i,push:a,addPostProcessor:c}=new he({indent:{indent:" ",...s}.indent});a("import axios from 'axios';"),o();const u={method:e,url:t};switch(Object.keys(n).length&&(u.headers=n),r.mimeType){case"application/x-www-form-urlencoded":r.params&&(a("const encodedParams = new URLSearchParams();"),r.params.forEach(f=>{a(`encodedParams.set('${f.name}', '${f.value}');`)}),o(),u.data="encodedParams,",c(f=>f.replace(/'encodedParams,'/,"encodedParams,")));break;case"application/json":r.jsonObj&&(u.data=r.jsonObj);break;default:r.text&&(u.data=r.text)}return a(`const options = ${Ot(u,{indent:" ",inlineCharacterLimit:80})};`),o(),a("axios"),a(".request(options)",1),a(".then(res => console.log(res.data))",1),a(".catch(err => console.error(err));",1),i()}},fetch:{info:{key:"fetch",title:"fetch",link:"https://nodejs.org/docs/latest/api/globals.html#fetch",description:"Perform asynchronous HTTP requests with the Fetch API",extname:".js"},convert:({method:e,fullUrl:t,postData:n,headersObj:r,cookies:s},o)=>{var m;const i={indent:" ",...o};let a=!1;const{blank:c,push:u,join:f,unshift:d}=new he({indent:i.indent}),p=t,h={method:e};switch(Object.keys(r).length&&(h.headers=r),n.mimeType){case"application/x-www-form-urlencoded":u("const encodedParams = new URLSearchParams();"),(m=n.params)==null||m.forEach(g=>{u(`encodedParams.set('${g.name}', '${g.value}');`)}),h.body="encodedParams",c();break;case"application/json":n.jsonObj&&(h.body=n.jsonObj);break;case"multipart/form-data":{if(!n.params)break;const g=Ze(r,"content-type");g&&delete r[g],u("const formData = new FormData();"),n.params.forEach(v=>{if(!v.fileName&&!v.contentType){u(`formData.append('${v.name}', '${v.value}');`);return}v.fileName&&(a=!0,u(`formData.append('${v.name}', await new Response(fs.createReadStream('${v.fileName}')).blob());`))}),h.body="formData",c();break}default:n.text&&(h.body=n.text)}if(s.length){const g=s.map(({name:v,value:j})=>`${encodeURIComponent(v)}=${encodeURIComponent(j)}`).join("; ");h.headers||(h.headers={}),h.headers.cookie=g}return u(`const url = '${p}';`),h.headers&&!Object.keys(h.headers).length&&delete h.headers,u(`const options = ${Ot(h,{indent:" ",inlineCharacterLimit:80,transform:(g,v,j)=>v==="body"&&n.mimeType==="application/json"?`JSON.stringify(${j})`:j})};`),c(),a&&d(`import fs from 'fs';
|
|
144
|
-
`),u("fetch(url, options)"),u(".then(res => res.json())",1),u(".then(json => console.log(json))",1),u(".catch(err => console.error(err));",1),f().replace(/'encodedParams'/,"encodedParams").replace(/'formData'/,"formData")}}}},zo=(e,t,n,r)=>{const s=`${e} *${t} = `;return`${s}${Mi(n,r?s.length:void 0)};`},Mi=(e,t)=>{const n=t===void 0?", ":`,
|
|
145
|
-
${" ".repeat(t)}`;switch(Object.prototype.toString.call(e)){case"[object Number]":return`@${e}`;case"[object Array]":return`@[ ${e.map(r=>Mi(r)).join(n)} ]`;case"[object Object]":{const r=[];return Object.keys(e).forEach(s=>{r.push(`@"${s}": ${Mi(e[s])}`)}),`@{ ${r.join(n)} }`}case"[object Boolean]":return e?"@YES":"@NO";default:return e==null?"":`@"${e.toString().replace(/"/g,'\\"')}"`}},Ib={info:{key:"objc",title:"Objective-C",default:"nsurlsession"},clientsById:{nsurlsession:{info:{key:"nsurlsession",title:"NSURLSession",link:"https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",description:"Foundation's NSURLSession request",extname:".m"},convert:({allHeaders:e,postData:t,method:n,fullUrl:r},s)=>{var f;const o={indent:" ",pretty:!0,timeout:10,...s},{push:i,join:a,blank:c}=new he({indent:o.indent}),u={hasHeaders:!1,hasBody:!1};if(i("#import <Foundation/Foundation.h>"),Object.keys(e).length&&(u.hasHeaders=!0,c(),i(zo("NSDictionary","headers",e,o.pretty))),t.text||t.jsonObj||t.params)switch(u.hasBody=!0,t.mimeType){case"application/x-www-form-urlencoded":if((f=t.params)!=null&&f.length){c();const[d,...p]=t.params;i(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${d.name}=${d.value}" dataUsingEncoding:NSUTF8StringEncoding]];`),p.forEach(({name:h,value:m})=>{i(`[postData appendData:[@"&${h}=${m}" dataUsingEncoding:NSUTF8StringEncoding]];`)})}else u.hasBody=!1;break;case"application/json":t.jsonObj&&(i(zo("NSDictionary","parameters",t.jsonObj,o.pretty)),c(),i("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));break;case"multipart/form-data":i(zo("NSArray","parameters",t.params||[],o.pretty)),i(`NSString *boundary = @"${t.boundary}";`),c(),i("NSError *error;"),i("NSMutableString *body = [NSMutableString string];"),i("for (NSDictionary *param in parameters) {"),i('[body appendFormat:@"--%@\\r\\n", boundary];',1),i('if (param[@"fileName"]) {',1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];',2),i('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];',2),i('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];',2),i("if (error) {",2),i('NSLog(@"%@", error);',3),i("}",2),i("} else {",1),i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];',2),i('[body appendFormat:@"%@", param[@"value"]];',2),i("}",1),i("}"),i('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'),i("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");break;default:c(),i(`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`)}return c(),i(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${r}"]`),i(" cachePolicy:NSURLRequestUseProtocolCachePolicy"),i(` timeoutInterval:${o.timeout.toFixed(1)}];`),i(`[request setHTTPMethod:@"${n}"];`),u.hasHeaders&&i("[request setAllHTTPHeaderFields:headers];"),u.hasBody&&i("[request setHTTPBody:postData];"),c(),i("NSURLSession *session = [NSURLSession sharedSession];"),i("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"),i(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"),i(" if (error) {",1),i(' NSLog(@"%@", error);',2),i(" } else {",1),i(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;",2),i(' NSLog(@"%@", httpResponse);',2),i(" }",1),i(" }];"),i("[dataTask resume];"),a()}}}},Pb={info:{key:"ocaml",title:"OCaml",default:"cohttp"},clientsById:{cohttp:{info:{key:"cohttp",title:"CoHTTP",link:"https://github.com/mirage/ocaml-cohttp",description:"Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml",extname:".ml",installation:()=>"opam install cohttp-lwt-unix cohttp-async"},convert:({fullUrl:e,allHeaders:t,postData:n,method:r},s)=>{const o={indent:" ",...s},i=["get","post","head","delete","patch","put","options"],{push:a,blank:c,join:u}=new he({indent:o.indent});a("open Cohttp_lwt_unix"),a("open Cohttp"),a("open Lwt"),c(),a(`let uri = Uri.of_string "${e}" in`);const f=Object.keys(t);return f.length===1?a(`let headers = Header.add (Header.init ()) "${f[0]}" "${Ue(t[f[0]])}" in`):f.length>1&&(a("let headers = Header.add_list (Header.init ()) ["),f.forEach(d=>{a(`("${d}", "${Ue(t[d])}");`,1)}),a("] in")),n.text&&a(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`),c(),a(`Client.call ${f.length?"~headers ":""}${n.text?"~body ":""}${i.includes(r.toLowerCase())?`\`${r.toUpperCase()}`:`(Code.method_of_string "${r}")`} uri`),a(">>= fun (res, body_stream) ->"),a("(* Do stuff with the result *)",1),u()}}}},Ae=(e,t,n)=>{switch(n=n||"",t=t||"",Object.prototype.toString.call(e)){case"[object Boolean]":return e;case"[object Null]":return"null";case"[object Undefined]":return"null";case"[object String]":return`'${Er(e,{delimiter:"'",escapeNewlines:!1})}'`;case"[object Number]":return e.toString();case"[object Array]":{const r=e.map(s=>Ae(s,`${t}${t}`,t)).join(`,
|
|
146
|
-
${t}`);return`[
|
|
147
|
-
${t}${r}
|
|
148
|
-
${n}]`}case"[object Object]":{const r=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.push(`${Ae(s,t)} => ${Ae(e[s],`${t}${t}`,t)}`);return`[
|
|
149
|
-
${t}${r.join(`,
|
|
150
|
-
${t}`)}
|
|
151
|
-
${n}]`}default:return"null"}},Lc=["ACL","BASELINE_CONTROL","CHECKIN","CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LABEL","LOCK","MERGE","MKACTIVITY","MKCOL","MKWORKSPACE","MOVE","OPTIONS","POST","PROPFIND","PROPPATCH","PUT","REPORT","TRACE","UNCHECKOUT","UNLOCK","UPDATE","VERSION_CONTROL"],$b={info:{key:"php",title:"PHP",default:"curl",cli:"php %s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://php.net/manual/en/book.curl.php",description:"PHP with ext-curl",extname:".php"},convert:({uriObj:e,postData:t,fullUrl:n,method:r,httpVersion:s,cookies:o,headersObj:i},a={})=>{const{closingTag:c=!1,indent:u=" ",maxRedirects:f=10,namedErrors:d=!1,noTags:p=!1,shortTags:h=!1,timeout:m=30}=a,{push:g,blank:v,join:j}=new he({indent:u});p||(g(h?"<?":"<?php"),v()),g("$curl = curl_init();"),v();const y=[{escape:!0,name:"CURLOPT_PORT",value:e.port},{escape:!0,name:"CURLOPT_URL",value:n},{escape:!1,name:"CURLOPT_RETURNTRANSFER",value:"true"},{escape:!0,name:"CURLOPT_ENCODING",value:""},{escape:!1,name:"CURLOPT_MAXREDIRS",value:f},{escape:!1,name:"CURLOPT_TIMEOUT",value:m},{escape:!1,name:"CURLOPT_HTTP_VERSION",value:s==="HTTP/1.0"?"CURL_HTTP_VERSION_1_0":"CURL_HTTP_VERSION_1_1"},{escape:!0,name:"CURLOPT_CUSTOMREQUEST",value:r},{escape:!t.jsonObj,name:"CURLOPT_POSTFIELDS",value:t?t.jsonObj?`json_encode(${Ae(t.jsonObj,u.repeat(2),u)})`:t.text:void 0}];g("curl_setopt_array($curl, [");const b=new he({indent:u,join:`
|
|
152
|
-
${u}`});y.forEach(({value:w,name:E,escape:C})=>{w!=null&&b.push(`${E} => ${C?JSON.stringify(w):w},`)});const S=o.map(w=>`${encodeURIComponent(w.name)}=${encodeURIComponent(w.value)}`);S.length&&b.push(`CURLOPT_COOKIE => "${S.join("; ")}",`);const k=Object.keys(i).sort().map(w=>`"${w}: ${Ue(i[w])}"`);return k.length&&(b.push("CURLOPT_HTTPHEADER => ["),b.push(k.join(`,
|
|
153
|
-
${u}${u}`),1),b.push("],")),g(b.join(),1),g("]);"),v(),g("$response = curl_exec($curl);"),g("$err = curl_error($curl);"),v(),g("curl_close($curl);"),v(),g("if ($err) {"),g(d?'echo array_flip(get_defined_constants(true)["curl"])[$err];':'echo "cURL Error #:" . $err;',1),g("} else {"),g("echo $response;",1),g("}"),!p&&c&&(v(),g("?>")),j()}},guzzle:{info:{key:"guzzle",title:"Guzzle",link:"http://docs.guzzlephp.org/en/stable/",description:"PHP with Guzzle",extname:".php",installation:()=>"composer require guzzlehttp/guzzle"},convert:({postData:e,fullUrl:t,method:n,cookies:r,headersObj:s},o)=>{var g;const i={closingTag:!1,indent:" ",noTags:!1,shortTags:!1,...o},{push:a,blank:c,join:u}=new he({indent:i.indent}),{code:f,push:d,join:p}=new he({indent:i.indent});switch(i.noTags||a(i.shortTags?"<?":"<?php"),a("require_once('vendor/autoload.php');"),c(),e.mimeType){case"application/x-www-form-urlencoded":d(`'form_params' => ${Ae(e.paramsObj,i.indent+i.indent,i.indent)},`,1);break;case"multipart/form-data":{const v=[];if(e.params&&e.params.forEach(j=>{if(j.fileName){const y={name:j.name,filename:j.fileName,contents:j.value};j.contentType&&(y.headers={"Content-Type":j.contentType}),v.push(y)}else j.value&&v.push({name:j.name,contents:j.value})}),v.length&&(d(`'multipart' => ${Ae(v,i.indent+i.indent,i.indent)}`,1),Ds(s,"content-type")&&(g=Rt(s,"content-type"))!=null&&g.indexOf("boundary"))){const j=Ze(s,"content-type");j&&delete s[j]}break}default:e.text&&d(`'body' => ${Ae(e.text)},`,1)}const h=Object.keys(s).sort().map(v=>`${i.indent}${i.indent}'${v}' => '${Un(s[v])}',`),m=r.map(v=>`${encodeURIComponent(v.name)}=${encodeURIComponent(v.value)}`).join("; ");return m.length&&h.push(`${i.indent}${i.indent}'cookie' => '${Un(m)}',`),h.length&&(d("'headers' => [",1),d(h.join(`
|
|
154
|
-
`)),d("],",1)),a("$client = new \\GuzzleHttp\\Client();"),c(),f.length?(a(`$response = $client->request('${n}', '${t}', [`),a(p()),a("]);")):a(`$response = $client->request('${n}', '${t}');`),c(),a("echo $response->getBody();"),!i.noTags&&i.closingTag&&(c(),a("?>")),u()}},http1:{info:{key:"http1",title:"HTTP v1",link:"http://php.net/manual/en/book.http.php",description:"PHP with pecl/http v1",extname:".php"},convert:({method:e,url:t,postData:n,queryObj:r,headersObj:s,cookiesObj:o},i={})=>{const{closingTag:a=!1,indent:c=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new he({indent:c});switch(u||(d(f?"<?":"<?php"),p()),Lc.includes(e.toUpperCase())||d(`HttpRequest::methodRegister('${e}');`),d("$request = new HttpRequest();"),d(`$request->setUrl(${Ae(t)});`),Lc.includes(e.toUpperCase())?d(`$request->setMethod(HTTP_METH_${e.toUpperCase()});`):d(`$request->setMethod(HttpRequest::HTTP_METH_${e.toUpperCase()});`),p(),Object.keys(r).length&&(d(`$request->setQueryData(${Ae(r,c)});`),p()),Object.keys(s).length&&(d(`$request->setHeaders(${Ae(s,c)});`),p()),Object.keys(o).length&&(d(`$request->setCookies(${Ae(o,c)});`),p()),n.mimeType){case"application/x-www-form-urlencoded":d(`$request->setContentType(${Ae(n.mimeType)});`),d(`$request->setPostFields(${Ae(n.paramsObj,c)});`),p();break;case"application/json":d(`$request->setContentType(${Ae(n.mimeType)});`),d(`$request->setBody(json_encode(${Ae(n.jsonObj,c)}));`),p();break;default:n.text&&(d(`$request->setBody(${Ae(n.text)});`),p())}return d("try {"),d("$response = $request->send();",1),p(),d("echo $response->getBody();",1),d("} catch (HttpException $ex) {"),d("echo $ex;",1),d("}"),!u&&a&&(p(),d("?>")),h()}},http2:{info:{key:"http2",title:"HTTP v2",link:"http://devel-m6w6.rhcloud.com/mdref/http",description:"PHP with pecl/http v2",extname:".php"},convert:({postData:e,headersObj:t,method:n,queryObj:r,cookiesObj:s,url:o},i={})=>{var g;const{closingTag:a=!1,indent:c=" ",noTags:u=!1,shortTags:f=!1}=i,{push:d,blank:p,join:h}=new he({indent:c});let m=!1;switch(u||(d(f?"<?":"<?php"),p()),d("$client = new http\\Client;"),d("$request = new http\\Client\\Request;"),p(),e.mimeType){case"application/x-www-form-urlencoded":d("$body = new http\\Message\\Body;"),d(`$body->append(new http\\QueryString(${Ae(e.paramsObj,c)}));`),p(),m=!0;break;case"multipart/form-data":{if(!e.params)break;const v=[],j={};e.params.forEach(({name:S,fileName:k,value:w,contentType:E})=>{if(k){v.push({name:S,type:E,file:k,data:w});return}w&&(j[S]=w)});const y=Object.keys(j).length?Ae(j,c):"null",b=v.length?Ae(v,c):"null";if(d("$body = new http\\Message\\Body;"),d(`$body->addForm(${y}, ${b});`),Ds(t,"content-type")&&(g=Rt(t,"content-type"))!=null&&g.indexOf("boundary")){const S=Ze(t,"content-type");S&&delete t[S]}p(),m=!0;break}case"application/json":d("$body = new http\\Message\\Body;"),d(`$body->append(json_encode(${Ae(e.jsonObj,c)}));`),m=!0;break;default:e.text&&(d("$body = new http\\Message\\Body;"),d(`$body->append(${Ae(e.text)});`),p(),m=!0)}return d(`$request->setRequestUrl(${Ae(o)});`),d(`$request->setRequestMethod(${Ae(n)});`),m&&(d("$request->setBody($body);"),p()),Object.keys(r).length&&(d(`$request->setQuery(new http\\QueryString(${Ae(r,c)}));`),p()),Object.keys(t).length&&(d(`$request->setHeaders(${Ae(t,c)});`),p()),Object.keys(s).length&&(p(),d(`$client->setCookies(${Ae(s,c)});`),p()),d("$client->enqueue($request)->send();"),d("$response = $client->getResponse();"),p(),d("echo $response->getBody();"),!u&&a&&(p(),d("?>")),h()}}}},Ed=e=>({method:n,headersObj:r,cookies:s,uriObj:o,fullUrl:i,postData:a,allHeaders:c})=>{const{push:u,join:f}=new he;if(!["GET","POST","PUT","DELETE","PATCH","HEAD","OPTIONS"].includes(n.toUpperCase()))return"Method not supported";const d=[],p=Object.keys(r);return p.length&&(u("$headers=@{}"),p.forEach(h=>{h!=="connection"&&u(`$headers.Add("${h}", "${Er(r[h],{escapeChar:"`"})}")`)}),d.push("-Headers $headers")),s.length&&(u("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"),s.forEach(h=>{u("$cookie = New-Object System.Net.Cookie"),u(`$cookie.Name = '${h.name}'`),u(`$cookie.Value = '${h.value}'`),u(`$cookie.Domain = '${o.host}'`),u("$session.Cookies.Add($cookie)")}),d.push("-WebSession $session")),a.text&&(d.push(`-ContentType '${Er(Rt(c,"content-type"),{delimiter:"'",escapeChar:"`"})}'`),d.push(`-Body '${a.text}'`)),u(`$response = ${e} -Uri '${i}' -Method ${n} ${d.join(" ")}`.trim()),f()},Mb={info:{key:"restmethod",title:"Invoke-RestMethod",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",description:"Powershell Invoke-RestMethod client",extname:".ps1"},convert:Ed("Invoke-RestMethod")},Lb={info:{key:"powershell",title:"Powershell",default:"webrequest"},clientsById:{webrequest:{info:{key:"webrequest",title:"Invoke-WebRequest",link:"https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",description:"Powershell Invoke-WebRequest client",extname:".ps1"},convert:Ed("Invoke-WebRequest")},restmethod:Mb}};function Dc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
|
|
155
|
-
${o}`:", ",c=e==="object"?"{":"[",u=e==="object"?"}":"]";return n?`${c}
|
|
156
|
-
${o}${t.join(a)}
|
|
157
|
-
${i}${u}`:e==="object"&&t.length>0?`${c} ${t.join(a)} ${u}`:`${c}${t.join(a)}${u}`}const Pn=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;return Dc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),Pn(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Pn(e[s],t,n)}`);return Dc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"None";case"[object Boolean]":return e?"True":"False";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},Db=["HEAD","GET","POST","PUT","PATCH","DELETE","OPTIONS"],Bb={info:{key:"python",title:"Python",default:"requests",cli:"python3 %s"},clientsById:{requests:{info:{key:"requests",title:"Requests",link:"http://docs.python-requests.org/en/latest/api/#requests.request",description:"Requests HTTP library",extname:".py",installation:()=>"python -m pip install requests"},convert:({fullUrl:e,postData:t,allHeaders:n,method:r},s)=>{const o={indent:" ",pretty:!0,...s},{push:i,blank:a,join:c,addPostProcessor:u}=new he({indent:o.indent});i("import requests"),a(),i(`url = "${e}"`),a();const f=n;let d={};const p={};let h=!1,m=!1,g=!1;switch(t.mimeType){case"application/json":t.jsonObj&&(i(`payload = ${Pn(t.jsonObj,o)}`),g=!0,m=!0);break;case"multipart/form-data":if(!t.params)break;if(d={},t.params.forEach(y=>{y.fileName?(y.contentType?p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'), '${y.contentType}')`:p[y.name]=`('${y.fileName}', open('${y.fileName}', 'rb'))`,h=!0):(d[y.name]=y.value,m=!0)}),h){i(`files = ${Pn(p,o)}`),m&&i(`payload = ${Pn(d,o)}`);const y=Ze(f,"content-type");y&&delete f[y]}else{const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}u(y=>y.replace(/"\('(.+)', open\('(.+)', 'rb'\)\)"/g,'("$1", open("$2", "rb"))').replace(/"\('(.+)', open\('(.+)', 'rb'\), '(.+)'\)"/g,'("$1", open("$2", "rb"), "$3")'));break;default:{if(t.mimeType==="application/x-www-form-urlencoded"&&t.paramsObj){i(`payload = ${Pn(t.paramsObj,o)}`),m=!0;break}const y=JSON.stringify(t.text);y&&(i(`payload = ${y}`),m=!0)}}const v=Object.keys(f).length;if(v===0&&(m||h))a();else if(v===1)Object.keys(f).forEach(y=>{i(`headers = {"${y}": "${Ue(f[y])}"}`),a()});else if(v>1){let y=1;i("headers = {"),Object.keys(f).forEach(b=>{i(y!==v?`"${b}": "${Ue(f[b])}",`:`"${b}": "${Ue(f[b])}"`,1),y+=1}),i("}"),a()}let j=Db.includes(r)?`response = requests.${r.toLowerCase()}(url`:`response = requests.request("${r}", url`;return m&&(g?j+=", json=payload":j+=", data=payload"),h&&(j+=", files=files"),v>0&&(j+=", headers=headers"),j+=")",i(j),a(),i("print(response.text)"),c()}}}},Fb={info:{key:"r",title:"R",default:"httr"},clientsById:{httr:{info:{key:"httr",title:"httr",link:"https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",description:"httr: Tools for Working with URLs and HTTP",extname:".r"},convert:({url:e,queryObj:t,queryString:n,postData:r,allHeaders:s,method:o})=>{const{push:i,blank:a,join:c}=new he;i("library(httr)"),a(),i(`url <- "${e}"`),a();const u=t;delete t.key;const f=Object.keys(u).length;n.length===1?(i(`queryString <- list(${Object.keys(u)} = "${Object.values(u).toString()}")`),a()):n.length>1&&(i("queryString <- list("),Object.keys(u).forEach((k,w)=>{w!==f-1?i(` ${k} = "${u[k].toString()}",`):i(` ${k} = "${u[k].toString()}"`)}),i(")"),a());const d=JSON.stringify(r.text);if(d&&(i(`payload <- ${d}`),a()),r.text||r.jsonObj||r.params)switch(r.mimeType){case"application/x-www-form-urlencoded":i('encode <- "form"'),a();break;case"application/json":i('encode <- "json"'),a();break;case"multipart/form-data":i('encode <- "multipart"'),a();break;default:i('encode <- "raw"'),a();break}const p=Rt(s,"cookie"),h=Rt(s,"accept"),m=p?`set_cookies(\`${String(p).replace(/;/g,'", `').replace(/` /g,"`").replace(/[=]/g,'` = "')}")`:void 0,g=h?`accept("${Ue(h)}")`:void 0,v=`content_type("${Ue(r.mimeType)}")`,j=Object.entries(s).filter(([k])=>!["cookie","accept","content-type"].includes(k.toLowerCase())).map(([k,w])=>`'${k}' = '${Un(w)}'`).join(", "),y=j?`add_headers(${j})`:void 0;let b=`response <- VERB("${o}", url`;d&&(b+=", body = payload"),n.length&&(b+=", query = queryString");const S=[y,v,g,m].filter(k=>!!k).join(", ");return S&&(b+=`, ${S}`),(r.text||r.jsonObj||r.params)&&(b+=", encode = encode"),b+=")",i(b),a(),i('content(response, "text")'),c()}}}},Ub={info:{key:"ruby",title:"Ruby",default:"native"},clientsById:{native:{info:{key:"native",title:"net::http",link:"http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",description:"Ruby HTTP client",extname:".rb"},convert:({uriObj:e,method:t,fullUrl:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new he;o("require 'uri'"),o("require 'net/http'"),i();const c=t.toUpperCase(),u=["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"],f=c.charAt(0)+c.substring(1).toLowerCase();u.includes(c)||(o(`class Net::HTTP::${f} < Net::HTTPRequest`),o(` METHOD = '${c.toUpperCase()}'`),o(` REQUEST_HAS_BODY = '${r.text?"true":"false"}'`),o(" RESPONSE_HAS_BODY = true"),o("end"),i()),o(`url = URI("${n}")`),i(),o("http = Net::HTTP.new(url.host, url.port)"),e.protocol==="https:"&&o("http.use_ssl = true"),i(),o(`request = Net::HTTP::${f}.new(url)`);const d=Object.keys(s);return d.length&&d.forEach(p=>{o(`request["${p}"] = '${Un(s[p])}'`)}),r.text&&o(`request.body = ${JSON.stringify(r.text)}`),i(),o("response = http.request(request)"),o("puts response.read_body"),a()}},faraday:{info:{key:"faraday",title:"faraday",link:"https://github.com/lostisland/faraday",description:"Faraday HTTP client",extname:".rb"},convert:({uriObj:e,queryObj:t,method:n,postData:r,allHeaders:s})=>{const{push:o,blank:i,join:a}=new he,c=n.toUpperCase();if(!["GET","POST","HEAD","DELETE","PATCH","PUT","OPTIONS","COPY","LOCK","UNLOCK","MOVE","TRACE"].includes(c))return o(`# Faraday cannot currently run ${c} requests. Please use another client.`),a();o("require 'faraday'"),i(),r.mimeType==="application/x-www-form-urlencoded"&&r.params&&(o("data = {"),r.params.forEach(f=>{o(` :${f.name} => ${JSON.stringify(f.value)},`)}),o("}"),i()),o("conn = Faraday.new("),o(` url: '${e.protocol}//${e.host}',`),(s["content-type"]||s["Content-Type"])&&o(` headers: {'Content-Type' => '${s["content-type"]||s["Content-Type"]}'}`),o(")"),i(),o(`response = conn.${c.toLowerCase()}('${e.pathname}') do |req|`);const u=Object.keys(s);switch(u.length&&u.forEach(f=>{f.toLowerCase()!=="content-type"&&o(` req.headers['${f}'] = '${Un(s[f])}'`)}),Object.keys(t).forEach(f=>{const d=t[f];Array.isArray(d)?o(` req.params['${f}'] = ${JSON.stringify(d)}`):o(` req.params['${f}'] = '${d}'`)}),r.mimeType){case"application/x-www-form-urlencoded":r.params&&o(" req.body = URI.encode_www_form(data)");break;case"application/json":r.jsonObj&&o(` req.body = ${JSON.stringify(r.text)}`);break;default:r.text&&o(` req.body = ${JSON.stringify(r.text)}`)}return o("end"),i(),o("puts response.status"),o("puts response.body"),a()}}}};function Bc(e,t,n,r,s){const o=r.repeat(s),i=r.repeat(s-1),a=n?`,
|
|
158
|
-
${o}`:", ",c=e==="object"?"json!({":"(",u=e==="object"?"})":")";return n?`${c}
|
|
159
|
-
${o}${t.join(a)}
|
|
160
|
-
${i}${u}`:`${c}${t.join(a)}${u}`}const $n=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{if(e.length===0)return"json!([])";let r=!1;return Bc("array",e.map(s=>(Object.prototype.toString.call(s)==="[object Object]"&&(r=Object.keys(s).length>1),$n(s,t,n))),r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${$n(e[s],t,n)}`);return Bc("object",r,t.pretty&&r.length>1,t.indent,n)}case"[object Null]":return"json!(null)";case"[object Boolean]":return e?"true":"false";default:return e==null?"":`"${e.toString().replace(/"/g,'\\"')}"`}},Hb={info:{key:"reqwest",title:"reqwest",link:"https://docs.rs/reqwest/latest/reqwest/",description:"reqwest HTTP library",extname:".rs"},convert:({queryObj:e,url:t,postData:n,allHeaders:r,method:s},o)=>{const i={indent:" ",pretty:!0,...o};let a=0;const{push:c,blank:u,join:f,pushToLast:d,unshift:p}=new he({indent:i.indent});c("use reqwest;",a),u(),c("#[tokio::main]",a),c("pub async fn main() {",a),a+=1,c(`let url = "${t}";`,a),u();let h=!1;if(Object.keys(e).length){h=!0,c("let querystring = [",a),a+=1;for(const[w,E]of Object.entries(e))if(Array.isArray(E))for(const C of E)c(`("${w}", "${decodeURIComponent(C)}"),`,a);else c(`("${w}", "${decodeURIComponent(String(E))}"),`,a);a-=1,c("];",a),u()}let m={};const g={};let v=!1,j=!1,y=!1,b=!1,S=!1;switch(n.mimeType){case"application/json":n.jsonObj&&c(`let payload = ${$n(n.jsonObj,i,a)};`,a),b=!0;break;case"multipart/form-data":if(S=!0,!n.params){c("let form = reqwest::multipart::Form::new()",a),c('.text("", "");',a+1);break}if(m={},n.params.forEach(w=>{w.fileName?(g[w.name]=w.fileName,v=!0):m[w.name]=w.value}),v){for(const w of qb)c(w,a);u()}c("let form = reqwest::multipart::Form::new()",a);for(const[w,E]of Object.entries(g))c(`.part("${w}", file_to_part("${E}").await)`,a+1);for(const[w,E]of Object.entries(m))c(`.text("${w}", "${E}")`,a+1);d(";");break;default:if(n.mimeType==="application/x-www-form-urlencoded"&&n.paramsObj){c(`let payload = ${$n(n.paramsObj,i,a)};`,a),j=!0;break}if(n.text){c(`let payload = ${$n(n.text,i,a)};`,a),y=!0;break}}(j||b)&&p("use serde_json::json;"),(j||b||y||S)&&u();const k=Object.entries(r).filter(([w])=>!(w.toLowerCase()==="content-type"&&S));switch(c("let client = reqwest::Client::new();",a),s){case"POST":c("let response = client.post(url)",a);break;case"GET":c("let response = client.get(url)",a);break;default:c(`let response = client.request(reqwest::Method::from_str("${s}").unwrap(), url)`,a),p("use std::str::FromStr;");break}h&&c(".query(&querystring)",a+1),S&&c(".multipart(form)",a+1);for(const[w,E]of k)c(`.header("${w}", ${$n(E,i)})`,a+1);return b&&c(".json(&payload)",a+1),j&&c(".form(&payload)",a+1),y&&c(".body(payload)",a+1),c(".send()",a+1),c(".await;",a+1),u(),c("let results = response.unwrap()",a),c(".json::<serde_json::Value>()",a+1),c(".await",a+1),c(".unwrap();",a+1),u(),c('println!("{}", results);',a),c(`}
|
|
161
|
-
`),f()}},qb=["async fn file_to_part(file_name: &'static str) -> reqwest::multipart::Part {"," let bytes = tokio::fs::read(file_name).await.unwrap();"," reqwest::multipart::Part::bytes(bytes)"," .file_name(file_name)",' .mime_str("text/plain").unwrap()',"}"],zb={info:{key:"rust",title:"Rust",default:"reqwest",cli:"rust"},clientsById:{reqwest:Hb}},We=(e="")=>/^[a-z0-9-_/.@%^=:]+$/i.test(e)?e:`'${e.replace(/'/g,"'\\''")}'`,Wb=e=>e.replace(/\r/g,"\\r").replace(/\n/g,"\\n"),Vb={"http1.0":"0","url ":"",cookie:"b",data:"d",form:"F",globoff:"g",header:"H",insecure:"k",request:"X"},Kb=e=>t=>{if(e){const n=Vb[t];return n?`-${n}`:""}return`--${t}`},Jb={info:{key:"shell",title:"Shell",default:"curl",cli:"%s"},clientsById:{curl:{info:{key:"curl",title:"cURL",link:"http://curl.haxx.se/",description:"cURL is a command line tool and library for transferring data with URL syntax",extname:".sh"},convert:({fullUrl:e,method:t,httpVersion:n,headersObj:r,allHeaders:s,postData:o},i={})=>{var j;const{binary:a=!1,globOff:c=!1,indent:u=" ",insecureSkipVerify:f=!1,short:d=!1}=i,p=" ",{push:h,join:m}=new he({...typeof u=="string"?{indent:u}:{},join:u!==!1?` \\
|
|
162
|
-
${u}`:" "}),g=Kb(d);let v=We(e);if(h(`curl ${g("request")} ${t}`),c&&(v=unescape(v),h(g("globoff"))),h(`${g("url ")}${v}`),f&&h(g("insecure")),n==="HTTP/1.0"&&h(g("http1.0")),Rt(s,"accept-encoding")&&h("--compressed"),o.mimeType==="multipart/form-data"){const y=Ze(r,"content-type");if(y){const b=r[y];if(y&&b){const S=String(b).replace(/; boundary.+?(?=(;|$))/,"");r[y]=S,s[y]=S}}}switch(Object.keys(r).sort().forEach(y=>{const b=`${y}: ${r[y]}`;h(`${g("header")} ${We(b)}`)}),s.cookie&&h(`${g("cookie")} ${We(s.cookie)}`),o.mimeType){case"multipart/form-data":(j=o.params)==null||j.forEach(y=>{let b="";y.fileName?b=`${y.name}='@${y.fileName}'`:b=We(`${y.name}=${y.value}`),h(`${g("form")} ${b}`)});break;case"application/x-www-form-urlencoded":o.params?o.params.forEach(y=>{const b=encodeURIComponent(y.name),S=b!==y.name?b:y.name;h(`${a?"--data-binary":"--data-urlencode"} ${We(`${S}=${y.value}`)}`)}):h(`${a?"--data-binary":g("data")} ${We(o.text)}`);break;default:{if(!o.text)break;let y=!1;if(gb(o.mimeType)&&o.text.length>20)try{const b=JSON.parse(o.text);y=!0,o.text.indexOf("'")>0?h(`${a?"--data-binary":g("data")} @- <<EOF
|
|
163
|
-
${JSON.stringify(b,null,p)}
|
|
164
|
-
EOF`):h(`${a?"--data-binary":g("data")} '
|
|
165
|
-
${JSON.stringify(b,null,p)}
|
|
166
|
-
'`)}catch{}y||h(`${a?"--data-binary":g("data")} ${We(o.text)}`)}}return m()}},httpie:{info:{key:"httpie",title:"HTTPie",link:"http://httpie.org/",description:"a CLI, cURL-like tool for humans",extname:".sh",installation:()=>"brew install httpie"},convert:({allHeaders:e,postData:t,queryObj:n,fullUrl:r,method:s,url:o},i)=>{var m;const a={body:!1,cert:!1,headers:!1,indent:" ",pretty:!1,print:!1,queryParams:!1,short:!1,style:!1,timeout:!1,verbose:!1,verify:!1,...i},{push:c,join:u,unshift:f}=new he({indent:a.indent,join:a.indent!==!1?` \\
|
|
167
|
-
${a.indent}`:" "});let d=!1;const p=[];a.headers&&p.push(a.short?"-h":"--headers"),a.body&&p.push(a.short?"-b":"--body"),a.verbose&&p.push(a.short?"-v":"--verbose"),a.print&&p.push(`${a.short?"-p":"--print"}=${a.print}`),a.verify&&p.push(`--verify=${a.verify}`),a.cert&&p.push(`--cert=${a.cert}`),a.pretty&&p.push(`--pretty=${a.pretty}`),a.style&&p.push(`--style=${a.style}`),a.timeout&&p.push(`--timeout=${a.timeout}`),a.queryParams&&Object.keys(n).forEach(g=>{const v=n[g];Array.isArray(v)?v.forEach(j=>{c(`${g}==${We(j)}`)}):c(`${g}==${We(v)}`)}),Object.keys(e).sort().forEach(g=>{c(`${g}:${We(e[g])}`)}),t.mimeType==="application/x-www-form-urlencoded"?(m=t.params)!=null&&m.length&&(p.push(a.short?"-f":"--form"),t.params.forEach(g=>{c(`${g.name}=${We(g.value)}`)})):d=!0;const h=p.length?`${p.join(" ")} `:"";return o=We(a.queryParams?o:r),f(`http ${h}${s} ${o}`),d&&t.text&&f(`echo ${We(t.text)} | `),u()}},wget:{info:{key:"wget",title:"Wget",link:"https://www.gnu.org/software/wget/",description:"a free software package for retrieving files using HTTP, HTTPS",extname:".sh"},convert:({method:e,postData:t,allHeaders:n,fullUrl:r},s)=>{const o={indent:" ",short:!1,verbose:!1,...s},{push:i,join:a}=new he({...typeof o.indent=="string"?{indent:o.indent}:{},join:o.indent!==!1?` \\
|
|
168
|
-
${o.indent}`:" "});return o.verbose?i(`wget ${o.short?"-v":"--verbose"}`):i(`wget ${o.short?"-q":"--quiet"}`),i(`--method ${We(e)}`),Object.keys(n).forEach(c=>{const u=`${c}: ${n[c]}`;i(`--header ${We(u)}`)}),t.text&&i(`--body-data ${Wb(We(t.text))}`),i(o.short?"-O":"--output-document"),i(`- ${We(r)}`),a()}}}},Fc=(e,t)=>t.repeat(e),Uc=(e,t,n,r)=>{const s=Fc(r,n),o=Fc(r-1,n),i=t?`,
|
|
169
|
-
${s}`:", ";return t?`[
|
|
170
|
-
${s}${e.join(i)}
|
|
171
|
-
${o}]`:`[${e.join(i)}]`},Hc=(e,t,n)=>`let ${e} = ${Bs(t,n)}`,Bs=(e,t,n)=>{switch(n=n===void 0?1:n+1,Object.prototype.toString.call(e)){case"[object Number]":return e;case"[object Array]":{let r=!1;const s=e.map(o=>(Object.prototype.toString.call(o)==="[object Object]"&&(r=Object.keys(o).length>1),Bs(o,t,n)));return Uc(s,r,t.indent,n)}case"[object Object]":{const r=[];for(const s in e)r.push(`"${s}": ${Bs(e[s],t,n)}`);return Uc(r,t.pretty&&r.length>1,t.indent,n)}case"[object Boolean]":return e.toString();default:return e==null?"nil":`"${e.toString().replace(/"/g,'\\"')}"`}},Mn={agent:yb,c:xb,clojure:vb,crystal:wb,csharp:kb,go:Ab,http:Tb,java:Ob,javascript:Nb,json:Cb,kotlin:_b,node:Rb,objc:Ib,ocaml:Pb,php:$b,powershell:Lb,python:Bb,r:Fb,ruby:Ub,rust:zb,shell:Jb,swift:{info:{key:"swift",title:"Swift",default:"urlsession"},clientsById:{urlsession:{info:{key:"urlsession",title:"URLSession",link:"https://developer.apple.com/documentation/foundation/urlsession",description:"Foundation's URLSession request",extname:".swift"},convert:({allHeaders:e,postData:t,uriObj:n,queryObj:r,method:s},o)=>{var p;const i={indent:" ",pretty:!0,timeout:10,...o},{push:a,blank:c,join:u}=new he({indent:i.indent});a("import Foundation"),c();const f=t.text||t.jsonObj||t.params;if(f)switch(t.mimeType){case"application/x-www-form-urlencoded":if((p=t.params)!=null&&p.length){const h=t.params.map(m=>`"${m.name}": "${m.value}"`);i.pretty?(a("let parameters = ["),h.forEach(m=>{a(`${m},`,1)}),a("]")):a(`let parameters = [${h.join(", ")}]`),a('let joinedParameters = parameters.map { "\\($0.key)=\\($0.value)" }.joined(separator: "&")'),a("let postData = Data(joinedParameters.utf8)"),c()}break;case"application/json":t.jsonObj&&(a(`${Hc("parameters",t.jsonObj,i)} as [String : Any?]`),c(),a("let postData = try JSONSerialization.data(withJSONObject: parameters, options: [])"),c());break;case"multipart/form-data":a(Hc("parameters",t.params,i)),c(),a(`let boundary = "${t.boundary}"`),c(),a('var body = ""'),a("for param in parameters {"),a('let paramName = param["name"]!',1),a('body += "--\\(boundary)\\r\\n"',1),a('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""',1),a('if let filename = param["fileName"] {',1),a('let contentType = param["contentType"]!',2),a("let fileContent = try String(contentsOfFile: filename, encoding: .utf8)",2),a('body += "; filename=\\"\\(filename)\\"\\r\\n"',2),a('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"',2),a("body += fileContent",2),a('} else if let paramValue = param["value"] {',1),a('body += "\\r\\n\\r\\n\\(paramValue)"',2),a("}",1),a("}"),c(),a("let postData = Data(body.utf8)"),c();break;default:a(`let postData = Data("${t.text}".utf8)`),c()}a(`let url = URL(string: "${n.href}")!`);const d=r?Object.entries(r):[];return d.length<1?a("var request = URLRequest(url: url)"):(a("var components = URLComponents(url: url, resolvingAgainstBaseURL: true)!"),a("let queryItems: [URLQueryItem] = ["),d.forEach(h=>{const m=h[0],g=h[1];switch(Object.prototype.toString.call(g)){case"[object String]":a(`URLQueryItem(name: "${m}", value: "${g}"),`,1);break;case"[object Array]":g.forEach(v=>{a(`URLQueryItem(name: "${m}", value: "${v}"),`,1)});break}}),a("]"),a("components.queryItems = components.queryItems.map { $0 + queryItems } ?? queryItems"),c(),a("var request = URLRequest(url: components.url!)")),a(`request.httpMethod = "${s}"`),a(`request.timeoutInterval = ${i.timeout}`),Object.keys(e).length&&a(`request.allHTTPHeaderFields = ${Bs(e,i)}`),f&&a("request.httpBody = postData"),c(),a("let (data, _) = try await URLSession.shared.data(for: request)"),a("print(String(decoding: data, as: UTF8.self))"),u()}}}}},qc=(e,t)=>{const n=e[t.name];return n===void 0?(e[t.name]=t.value,e):Array.isArray(n)?(n.push(t.value),e):(e[t.name]=[n,t.value],e)};var Fs={exports:{}};/*! https://mths.be/punycode v1.4.1 by @mathias */var Yb=Fs.exports;(function(e,t){(function(n){var r=t&&!t.nodeType&&t,s=e&&!e.nodeType&&e,o=typeof wr=="object"&≀(o.global===o||o.window===o||o.self===o)&&(n=o);var i,a=2147483647,c=36,u=1,f=26,d=38,p=700,h=72,m=128,g="-",v=/^xn--/,j=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=c-u,k=Math.floor,w=String.fromCharCode,E;function C($){throw new RangeError(b[$])}function O($,B){for(var D=$.length,L=[];D--;)L[D]=B($[D]);return L}function T($,B){var D=$.split("@"),L="";D.length>1&&(L=D[0]+"@",$=D[1]),$=$.replace(y,".");var re=$.split("."),te=O(re,B).join(".");return L+te}function P($){for(var B=[],D=0,L=$.length,re,te;D<L;)re=$.charCodeAt(D++),re>=55296&&re<=56319&&D<L?(te=$.charCodeAt(D++),(te&64512)==56320?B.push(((re&1023)<<10)+(te&1023)+65536):(B.push(re),D--)):B.push(re);return B}function R($){return O($,function(B){var D="";return B>65535&&(B-=65536,D+=w(B>>>10&1023|55296),B=56320|B&1023),D+=w(B),D}).join("")}function U($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:c}function J($,B){return $+22+75*($<26)-((B!=0)<<5)}function Z($,B,D){var L=0;for($=D?k($/p):$>>1,$+=k($/B);$>S*f>>1;L+=c)$=k($/S);return k(L+(S+1)*$/($+d))}function _($){var B=[],D=$.length,L,re=0,te=m,me=h,I,Q,ae,se,ue,fe,pe,Ne,Se;for(I=$.lastIndexOf(g),I<0&&(I=0),Q=0;Q<I;++Q)$.charCodeAt(Q)>=128&&C("not-basic"),B.push($.charCodeAt(Q));for(ae=I>0?I+1:0;ae<D;){for(se=re,ue=1,fe=c;ae>=D&&C("invalid-input"),pe=U($.charCodeAt(ae++)),(pe>=c||pe>k((a-re)/ue))&&C("overflow"),re+=pe*ue,Ne=fe<=me?u:fe>=me+f?f:fe-me,!(pe<Ne);fe+=c)Se=c-Ne,ue>k(a/Se)&&C("overflow"),ue*=Se;L=B.length+1,me=Z(re-se,L,se==0),k(re/L)>a-te&&C("overflow"),te+=k(re/L),re%=L,B.splice(re++,0,te)}return R(B)}function M($){var B,D,L,re,te,me,I,Q,ae,se,ue,fe=[],pe,Ne,Se,Xe;for($=P($),pe=$.length,B=m,D=0,te=h,me=0;me<pe;++me)ue=$[me],ue<128&&fe.push(w(ue));for(L=re=fe.length,re&&fe.push(g);L<pe;){for(I=a,me=0;me<pe;++me)ue=$[me],ue>=B&&ue<I&&(I=ue);for(Ne=L+1,I-B>k((a-D)/Ne)&&C("overflow"),D+=(I-B)*Ne,B=I,me=0;me<pe;++me)if(ue=$[me],ue<B&&++D>a&&C("overflow"),ue==B){for(Q=D,ae=c;se=ae<=te?u:ae>=te+f?f:ae-te,!(Q<se);ae+=c)Xe=Q-se,Se=c-se,fe.push(w(J(se+Xe%Se,0))),Q=k(Xe/Se);fe.push(w(J(Q,0))),te=Z(D,Ne,L==re),D=0,++L}++D,++B}return fe.join("")}function K($){return T($,function(B){return v.test(B)?_(B.slice(4).toLowerCase()):B})}function Y($){return T($,function(B){return j.test(B)?"xn--"+M(B):B})}if(i={version:"1.4.1",ucs2:{decode:P,encode:R},decode:_,encode:M,toASCII:Y,toUnicode:K},r&&s)if(e.exports==r)s.exports=i;else for(E in i)i.hasOwnProperty(E)&&(r[E]=i[E]);else n.punycode=i})(Yb)})(Fs,Fs.exports);var Zb=Fs.exports,Kn=TypeError;const Xb={},Qb=Object.freeze(Object.defineProperty({__proto__:null,default:Xb},Symbol.toStringTag,{value:"Module"})),kd=ng(Qb);var La=typeof Map=="function"&&Map.prototype,Wo=Object.getOwnPropertyDescriptor&&La?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Us=La&&Wo&&typeof Wo.get=="function"?Wo.get:null,zc=La&&Map.prototype.forEach,Da=typeof Set=="function"&&Set.prototype,Vo=Object.getOwnPropertyDescriptor&&Da?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Hs=Da&&Vo&&typeof Vo.get=="function"?Vo.get:null,Wc=Da&&Set.prototype.forEach,Gb=typeof WeakMap=="function"&&WeakMap.prototype,pr=Gb?WeakMap.prototype.has:null,e1=typeof WeakSet=="function"&&WeakSet.prototype,hr=e1?WeakSet.prototype.has:null,t1=typeof WeakRef=="function"&&WeakRef.prototype,Vc=t1?WeakRef.prototype.deref:null,n1=Boolean.prototype.valueOf,r1=Object.prototype.toString,s1=Function.prototype.toString,o1=String.prototype.match,Ba=String.prototype.slice,Zt=String.prototype.replace,i1=String.prototype.toUpperCase,Kc=String.prototype.toLowerCase,Ad=RegExp.prototype.test,Jc=Array.prototype.concat,Nt=Array.prototype.join,a1=Array.prototype.slice,Yc=Math.floor,Li=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ko=Object.getOwnPropertySymbols,Di=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Hn=typeof Symbol=="function"&&typeof Symbol.iterator=="object",mr=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Hn||!0)?Symbol.toStringTag:null,Td=Object.prototype.propertyIsEnumerable,Zc=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function Xc(e,t){if(e===1/0||e===-1/0||e!==e||e&&e>-1e3&&e<1e3||Ad.call(/e/,t))return t;var n=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof e=="number"){var r=e<0?-Yc(-e):Yc(e);if(r!==e){var s=String(r),o=Ba.call(t,s.length+1);return Zt.call(s,n,"$&_")+"."+Zt.call(Zt.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Zt.call(t,n,"$&_")}var Bi=kd,Qc=Bi.custom,Gc=Cd(Qc)?Qc:null,Od={__proto__:null,double:'"',single:"'"},l1={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},ro=function e(t,n,r,s){var o=n||{};if(Mt(o,"quoteStyle")&&!Mt(Od,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Mt(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var i=Mt(o,"customInspect")?o.customInspect:!0;if(typeof i!="boolean"&&i!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Mt(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Mt(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=o.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Rd(t,o);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?Xc(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return a?Xc(t,u):u}var f=typeof o.depth>"u"?5:o.depth;if(typeof r>"u"&&(r=0),r>=f&&f>0&&typeof t=="object")return Fi(t)?"[Array]":"[Object]";var d=A1(o,r);if(typeof s>"u")s=[];else if(_d(s,t)>=0)return"[Circular]";function p(U,J,Z){if(J&&(s=a1.call(s),s.push(J)),Z){var _={depth:o.depth};return Mt(o,"quoteStyle")&&(_.quoteStyle=o.quoteStyle),e(U,_,r+1,s)}return e(U,o,r+1,s)}if(typeof t=="function"&&!eu(t)){var h=y1(t),m=cs(t,p);return"[Function"+(h?": "+h:" (anonymous)")+"]"+(m.length>0?" { "+Nt.call(m,", ")+" }":"")}if(Cd(t)){var g=Hn?Zt.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Di.call(t);return typeof t=="object"&&!Hn?lr(g):g}if(j1(t)){for(var v="<"+Kc.call(String(t.nodeName)),j=t.attributes||[],y=0;y<j.length;y++)v+=" "+j[y].name+"="+Nd(c1(j[y].value),"double",o);return v+=">",t.childNodes&&t.childNodes.length&&(v+="..."),v+="</"+Kc.call(String(t.nodeName))+">",v}if(Fi(t)){if(t.length===0)return"[]";var b=cs(t,p);return d&&!k1(b)?"["+Ui(b,d)+"]":"[ "+Nt.call(b,", ")+" ]"}if(f1(t)){var S=cs(t,p);return!("cause"in Error.prototype)&&"cause"in t&&!Td.call(t,"cause")?"{ ["+String(t)+"] "+Nt.call(Jc.call("[cause]: "+p(t.cause),S),", ")+" }":S.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Nt.call(S,", ")+" }"}if(typeof t=="object"&&i){if(Gc&&typeof t[Gc]=="function"&&Bi)return Bi(t,{depth:f-r});if(i!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(x1(t)){var k=[];return zc&&zc.call(t,function(U,J){k.push(p(J,t,!0)+" => "+p(U,t))}),tu("Map",Us.call(t),k,d)}if(w1(t)){var w=[];return Wc&&Wc.call(t,function(U){w.push(p(U,t))}),tu("Set",Hs.call(t),w,d)}if(b1(t))return Jo("WeakMap");if(S1(t))return Jo("WeakSet");if(v1(t))return Jo("WeakRef");if(p1(t))return lr(p(Number(t)));if(m1(t))return lr(p(Li.call(t)));if(h1(t))return lr(n1.call(t));if(d1(t))return lr(p(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof wr<"u"&&t===wr)return"{ [object globalThis] }";if(!u1(t)&&!eu(t)){var E=cs(t,p),C=Zc?Zc(t)===Object.prototype:t instanceof Object||t.constructor===Object,O=t instanceof Object?"":"null prototype",T=!C&&mr&&Object(t)===t&&mr in t?Ba.call(nn(t),8,-1):O?"Object":"",P=C||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",R=P+(T||O?"["+Nt.call(Jc.call([],T||[],O||[]),": ")+"] ":"");return E.length===0?R+"{}":d?R+"{"+Ui(E,d)+"}":R+"{ "+Nt.call(E,", ")+" }"}return String(t)};function Nd(e,t,n){var r=n.quoteStyle||t,s=Od[r];return s+e+s}function c1(e){return Zt.call(String(e),/"/g,""")}function vn(e){return!mr||!(typeof e=="object"&&(mr in e||typeof e[mr]<"u"))}function Fi(e){return nn(e)==="[object Array]"&&vn(e)}function u1(e){return nn(e)==="[object Date]"&&vn(e)}function eu(e){return nn(e)==="[object RegExp]"&&vn(e)}function f1(e){return nn(e)==="[object Error]"&&vn(e)}function d1(e){return nn(e)==="[object String]"&&vn(e)}function p1(e){return nn(e)==="[object Number]"&&vn(e)}function h1(e){return nn(e)==="[object Boolean]"&&vn(e)}function Cd(e){if(Hn)return e&&typeof e=="object"&&e instanceof Symbol;if(typeof e=="symbol")return!0;if(!e||typeof e!="object"||!Di)return!1;try{return Di.call(e),!0}catch{}return!1}function m1(e){if(!e||typeof e!="object"||!Li)return!1;try{return Li.call(e),!0}catch{}return!1}var g1=Object.prototype.hasOwnProperty||function(e){return e in this};function Mt(e,t){return g1.call(e,t)}function nn(e){return r1.call(e)}function y1(e){if(e.name)return e.name;var t=o1.call(s1.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}function _d(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}function x1(e){if(!Us||!e||typeof e!="object")return!1;try{Us.call(e);try{Hs.call(e)}catch{return!0}return e instanceof Map}catch{}return!1}function b1(e){if(!pr||!e||typeof e!="object")return!1;try{pr.call(e,pr);try{hr.call(e,hr)}catch{return!0}return e instanceof WeakMap}catch{}return!1}function v1(e){if(!Vc||!e||typeof e!="object")return!1;try{return Vc.call(e),!0}catch{}return!1}function w1(e){if(!Hs||!e||typeof e!="object")return!1;try{Hs.call(e);try{Us.call(e)}catch{return!0}return e instanceof Set}catch{}return!1}function S1(e){if(!hr||!e||typeof e!="object")return!1;try{hr.call(e,hr);try{pr.call(e,pr)}catch{return!0}return e instanceof WeakSet}catch{}return!1}function j1(e){return!e||typeof e!="object"?!1:typeof HTMLElement<"u"&&e instanceof HTMLElement?!0:typeof e.nodeName=="string"&&typeof e.getAttribute=="function"}function Rd(e,t){if(e.length>t.maxStringLength){var n=e.length-t.maxStringLength,r="... "+n+" more character"+(n>1?"s":"");return Rd(Ba.call(e,0,t.maxStringLength),t)+r}var s=l1[t.quoteStyle||"single"];s.lastIndex=0;var o=Zt.call(Zt.call(e,s,"\\$1"),/[\x00-\x1f]/g,E1);return Nd(o,"single",t)}function E1(e){var t=e.charCodeAt(0),n={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return n?"\\"+n:"\\x"+(t<16?"0":"")+i1.call(t.toString(16))}function lr(e){return"Object("+e+")"}function Jo(e){return e+" { ? }"}function tu(e,t,n,r){var s=r?Ui(n,r):Nt.call(n,", ");return e+" ("+t+") {"+s+"}"}function k1(e){for(var t=0;t<e.length;t++)if(_d(e[t],`
|
|
172
|
-
`)>=0)return!1;return!0}function A1(e,t){var n;if(e.indent===" ")n=" ";else if(typeof e.indent=="number"&&e.indent>0)n=Nt.call(Array(e.indent+1)," ");else return null;return{base:n,prev:Nt.call(Array(t+1),n)}}function Ui(e,t){if(e.length===0)return"";var n=`
|
|
173
|
-
`+t.prev+t.base;return n+Nt.call(e,","+n)+`
|
|
174
|
-
`+t.prev}function cs(e,t){var n=Fi(e),r=[];if(n){r.length=e.length;for(var s=0;s<e.length;s++)r[s]=Mt(e,s)?t(e[s],e):""}var o=typeof Ko=="function"?Ko(e):[],i;if(Hn){i={};for(var a=0;a<o.length;a++)i["$"+o[a]]=o[a]}for(var c in e)Mt(e,c)&&(n&&String(Number(c))===c&&c<e.length||Hn&&i["$"+c]instanceof Symbol||(Ad.call(/[^\w$]/,c)?r.push(t(c,e)+": "+t(e[c],e)):r.push(c+": "+t(e[c],e))));if(typeof Ko=="function")for(var u=0;u<o.length;u++)Td.call(e,o[u])&&r.push("["+t(o[u])+"]: "+t(e[o[u]],e));return r}var T1=ro,O1=Kn,so=function(e,t,n){for(var r=e,s;(s=r.next)!=null;r=s)if(s.key===t)return r.next=s.next,n||(s.next=e.next,e.next=s),s},N1=function(e,t){if(e){var n=so(e,t);return n&&n.value}},C1=function(e,t,n){var r=so(e,t);r?r.value=n:e.next={key:t,next:e.next,value:n}},_1=function(e,t){return e?!!so(e,t):!1},R1=function(e,t){if(e)return so(e,t,!0)},I1=function(){var t,n={assert:function(r){if(!n.has(r))throw new O1("Side channel does not contain "+T1(r))},delete:function(r){var s=R1(t,r);return s&&t&&!t.next&&(t=void 0),!!s},get:function(r){return N1(t,r)},has:function(r){return _1(t,r)},set:function(r,s){t||(t={next:void 0}),C1(t,r,s)}};return n},Id=Object,P1=Error,$1=EvalError,M1=RangeError,L1=ReferenceError,D1=SyntaxError,B1=URIError,F1=Math.abs,U1=Math.floor,H1=Math.max,q1=Math.min,z1=Math.pow,W1=Math.round,V1=Number.isNaN||function(t){return t!==t},K1=V1,J1=function(t){return K1(t)||t===0?t:t<0?-1:1},Y1=Object.getOwnPropertyDescriptor,vs=Y1;if(vs)try{vs([],"length")}catch{vs=null}var Pd=vs,ws=Object.defineProperty||!1;if(ws)try{ws({},"a",{value:1})}catch{ws=!1}var $d=ws,Yo,nu;function Z1(){return nu||(nu=1,Yo=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},n=Symbol("test"),r=Object(n);if(typeof n=="string"||Object.prototype.toString.call(n)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var s=42;t[n]=s;for(var o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var i=Object.getOwnPropertySymbols(t);if(i.length!==1||i[0]!==n||!Object.prototype.propertyIsEnumerable.call(t,n))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,n);if(a.value!==s||a.enumerable!==!0)return!1}return!0}),Yo}var Zo,ru;function X1(){if(ru)return Zo;ru=1;var e=typeof Symbol<"u"&&Symbol,t=Z1();return Zo=function(){return typeof e!="function"||typeof Symbol!="function"||typeof e("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},Zo}var Xo,su;function Md(){return su||(su=1,Xo=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Xo}var Qo,ou;function Ld(){if(ou)return Qo;ou=1;var e=Id;return Qo=e.getPrototypeOf||null,Qo}var Q1="Function.prototype.bind called on incompatible ",G1=Object.prototype.toString,ev=Math.max,tv="[object Function]",iu=function(t,n){for(var r=[],s=0;s<t.length;s+=1)r[s]=t[s];for(var o=0;o<n.length;o+=1)r[o+t.length]=n[o];return r},nv=function(t,n){for(var r=[],s=n,o=0;s<t.length;s+=1,o+=1)r[o]=t[s];return r},rv=function(e,t){for(var n="",r=0;r<e.length;r+=1)n+=e[r],r+1<e.length&&(n+=t);return n},sv=function(t){var n=this;if(typeof n!="function"||G1.apply(n)!==tv)throw new TypeError(Q1+n);for(var r=nv(arguments,1),s,o=function(){if(this instanceof s){var f=n.apply(this,iu(r,arguments));return Object(f)===f?f:this}return n.apply(t,iu(r,arguments))},i=ev(0,n.length-r.length),a=[],c=0;c<i;c++)a[c]="$"+c;if(s=Function("binder","return function ("+rv(a,",")+"){ return binder.apply(this,arguments); }")(o),n.prototype){var u=function(){};u.prototype=n.prototype,s.prototype=new u,u.prototype=null}return s},ov=sv,oo=Function.prototype.bind||ov,Fa=Function.prototype.call,Go,au;function Dd(){return au||(au=1,Go=Function.prototype.apply),Go}var iv=typeof Reflect<"u"&&Reflect&&Reflect.apply,av=oo,lv=Dd(),cv=Fa,uv=iv,fv=uv||av.call(cv,lv),dv=oo,pv=Kn,hv=Fa,mv=fv,Bd=function(t){if(t.length<1||typeof t[0]!="function")throw new pv("a function is required");return mv(dv,hv,t)},ei,lu;function gv(){if(lu)return ei;lu=1;var e=Bd,t=Pd,n;try{n=[].__proto__===Array.prototype}catch(i){if(!i||typeof i!="object"||!("code"in i)||i.code!=="ERR_PROTO_ACCESS")throw i}var r=!!n&&t&&t(Object.prototype,"__proto__"),s=Object,o=s.getPrototypeOf;return ei=r&&typeof r.get=="function"?e([r.get]):typeof o=="function"?function(a){return o(a==null?a:s(a))}:!1,ei}var ti,cu;function yv(){if(cu)return ti;cu=1;var e=Md(),t=Ld(),n=gv();return ti=e?function(s){return e(s)}:t?function(s){if(!s||typeof s!="object"&&typeof s!="function")throw new TypeError("getProto: not an object");return t(s)}:n?function(s){return n(s)}:null,ti}var ni,uu;function xv(){if(uu)return ni;uu=1;var e=Function.prototype.call,t=Object.prototype.hasOwnProperty,n=oo;return ni=n.call(e,t),ni}var ge,bv=Id,vv=P1,wv=$1,Sv=M1,jv=L1,qn=D1,Dn=Kn,Ev=B1,kv=F1,Av=U1,Tv=H1,Ov=q1,Nv=z1,Cv=W1,_v=J1,Fd=Function,ri=function(e){try{return Fd('"use strict"; return ('+e+").constructor;")()}catch{}},kr=Pd,Rv=$d,si=function(){throw new Dn},Iv=kr?(function(){try{return arguments.callee,si}catch{try{return kr(arguments,"callee").get}catch{return si}}})():si,On=X1()(),qe=yv(),Pv=Ld(),$v=Md(),Ud=Dd(),Lr=Fa,In={},Mv=typeof Uint8Array>"u"||!qe?ge:qe(Uint8Array),hn={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?ge:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ge:ArrayBuffer,"%ArrayIteratorPrototype%":On&&qe?qe([][Symbol.iterator]()):ge,"%AsyncFromSyncIteratorPrototype%":ge,"%AsyncFunction%":In,"%AsyncGenerator%":In,"%AsyncGeneratorFunction%":In,"%AsyncIteratorPrototype%":In,"%Atomics%":typeof Atomics>"u"?ge:Atomics,"%BigInt%":typeof BigInt>"u"?ge:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ge:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ge:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ge:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":vv,"%eval%":eval,"%EvalError%":wv,"%Float16Array%":typeof Float16Array>"u"?ge:Float16Array,"%Float32Array%":typeof Float32Array>"u"?ge:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ge:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ge:FinalizationRegistry,"%Function%":Fd,"%GeneratorFunction%":In,"%Int8Array%":typeof Int8Array>"u"?ge:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ge:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ge:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":On&&qe?qe(qe([][Symbol.iterator]())):ge,"%JSON%":typeof JSON=="object"?JSON:ge,"%Map%":typeof Map>"u"?ge:Map,"%MapIteratorPrototype%":typeof Map>"u"||!On||!qe?ge:qe(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":bv,"%Object.getOwnPropertyDescriptor%":kr,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ge:Promise,"%Proxy%":typeof Proxy>"u"?ge:Proxy,"%RangeError%":Sv,"%ReferenceError%":jv,"%Reflect%":typeof Reflect>"u"?ge:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ge:Set,"%SetIteratorPrototype%":typeof Set>"u"||!On||!qe?ge:qe(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ge:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":On&&qe?qe(""[Symbol.iterator]()):ge,"%Symbol%":On?Symbol:ge,"%SyntaxError%":qn,"%ThrowTypeError%":Iv,"%TypedArray%":Mv,"%TypeError%":Dn,"%Uint8Array%":typeof Uint8Array>"u"?ge:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ge:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ge:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ge:Uint32Array,"%URIError%":Ev,"%WeakMap%":typeof WeakMap>"u"?ge:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ge:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ge:WeakSet,"%Function.prototype.call%":Lr,"%Function.prototype.apply%":Ud,"%Object.defineProperty%":Rv,"%Object.getPrototypeOf%":Pv,"%Math.abs%":kv,"%Math.floor%":Av,"%Math.max%":Tv,"%Math.min%":Ov,"%Math.pow%":Nv,"%Math.round%":Cv,"%Math.sign%":_v,"%Reflect.getPrototypeOf%":$v};if(qe)try{null.error}catch(e){var Lv=qe(qe(e));hn["%Error.prototype%"]=Lv}var Dv=function e(t){var n;if(t==="%AsyncFunction%")n=ri("async function () {}");else if(t==="%GeneratorFunction%")n=ri("function* () {}");else if(t==="%AsyncGeneratorFunction%")n=ri("async function* () {}");else if(t==="%AsyncGenerator%"){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var s=e("%AsyncGenerator%");s&&qe&&(n=qe(s.prototype))}return hn[t]=n,n},fu={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Dr=oo,qs=xv(),Bv=Dr.call(Lr,Array.prototype.concat),Fv=Dr.call(Ud,Array.prototype.splice),du=Dr.call(Lr,String.prototype.replace),zs=Dr.call(Lr,String.prototype.slice),Uv=Dr.call(Lr,RegExp.prototype.exec),Hv=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,qv=/\\(\\)?/g,zv=function(t){var n=zs(t,0,1),r=zs(t,-1);if(n==="%"&&r!=="%")throw new qn("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&n!=="%")throw new qn("invalid intrinsic syntax, expected opening `%`");var s=[];return du(t,Hv,function(o,i,a,c){s[s.length]=a?du(c,qv,"$1"):i||o}),s},Wv=function(t,n){var r=t,s;if(qs(fu,r)&&(s=fu[r],r="%"+s[0]+"%"),qs(hn,r)){var o=hn[r];if(o===In&&(o=Dv(r)),typeof o>"u"&&!n)throw new Dn("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:s,name:r,value:o}}throw new qn("intrinsic "+t+" does not exist!")},Ua=function(t,n){if(typeof t!="string"||t.length===0)throw new Dn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof n!="boolean")throw new Dn('"allowMissing" argument must be a boolean');if(Uv(/^%?[^%]*%?$/,t)===null)throw new qn("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=zv(t),s=r.length>0?r[0]:"",o=Wv("%"+s+"%",n),i=o.name,a=o.value,c=!1,u=o.alias;u&&(s=u[0],Fv(r,Bv([0,1],u)));for(var f=1,d=!0;f<r.length;f+=1){var p=r[f],h=zs(p,0,1),m=zs(p,-1);if((h==='"'||h==="'"||h==="`"||m==='"'||m==="'"||m==="`")&&h!==m)throw new qn("property names with quotes must have matching quotes");if((p==="constructor"||!d)&&(c=!0),s+="."+p,i="%"+s+"%",qs(hn,i))a=hn[i];else if(a!=null){if(!(p in a)){if(!n)throw new Dn("base intrinsic for "+t+" exists, but the property is not available.");return}if(kr&&f+1>=r.length){var g=kr(a,p);d=!!g,d&&"get"in g&&!("originalValue"in g.get)?a=g.get:a=a[p]}else d=qs(a,p),a=a[p];d&&!c&&(hn[i]=a)}}return a},Hd=Ua,qd=Bd,Vv=qd([Hd("%String.prototype.indexOf%")]),zd=function(t,n){var r=Hd(t,!!n);return typeof r=="function"&&Vv(t,".prototype.")>-1?qd([r]):r},Kv=Ua,Br=zd,Jv=ro,Yv=Kn,pu=Kv("%Map%",!0),Zv=Br("Map.prototype.get",!0),Xv=Br("Map.prototype.set",!0),Qv=Br("Map.prototype.has",!0),Gv=Br("Map.prototype.delete",!0),ew=Br("Map.prototype.size",!0),Wd=!!pu&&function(){var t,n={assert:function(r){if(!n.has(r))throw new Yv("Side channel does not contain "+Jv(r))},delete:function(r){if(t){var s=Gv(t,r);return ew(t)===0&&(t=void 0),s}return!1},get:function(r){if(t)return Zv(t,r)},has:function(r){return t?Qv(t,r):!1},set:function(r,s){t||(t=new pu),Xv(t,r,s)}};return n},tw=Ua,io=zd,nw=ro,us=Wd,rw=Kn,Nn=tw("%WeakMap%",!0),sw=io("WeakMap.prototype.get",!0),ow=io("WeakMap.prototype.set",!0),iw=io("WeakMap.prototype.has",!0),aw=io("WeakMap.prototype.delete",!0),lw=Nn?function(){var t,n,r={assert:function(s){if(!r.has(s))throw new rw("Side channel does not contain "+nw(s))},delete:function(s){if(Nn&&s&&(typeof s=="object"||typeof s=="function")){if(t)return aw(t,s)}else if(us&&n)return n.delete(s);return!1},get:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?sw(t,s):n&&n.get(s)},has:function(s){return Nn&&s&&(typeof s=="object"||typeof s=="function")&&t?iw(t,s):!!n&&n.has(s)},set:function(s,o){Nn&&s&&(typeof s=="object"||typeof s=="function")?(t||(t=new Nn),ow(t,s,o)):us&&(n||(n=us()),n.set(s,o))}};return r}:us,cw=Kn,uw=ro,fw=I1,dw=Wd,pw=lw,hw=pw||dw||fw,Vd=function(){var t,n={assert:function(r){if(!n.has(r)){var s=r&&Object(r)===r?"the given object key":uw(r);throw new cw("Side channel does not contain "+s)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,s){t||(t=hw()),t.set(r,s)}};return n},mw=String.prototype.replace,gw=/%20/g,oi={RFC1738:"RFC1738",RFC3986:"RFC3986"},Ha={default:oi.RFC3986,formatters:{RFC1738:function(e){return mw.call(e,gw,"+")},RFC3986:function(e){return String(e)}},RFC1738:oi.RFC1738,RFC3986:oi.RFC3986},yw=Ha,Kd=Vd,hu=$d,ii=Object.prototype.hasOwnProperty,un=Array.isArray,ao=Kd(),fn=function(t,n){return ao.set(t,n),t},dn=function(t){return ao.has(t)},ur=function(t){return ao.get(t)},Hi=function(t,n){ao.set(t,n)},kt=(function(){for(var e=[],t=0;t<256;++t)e[e.length]="%"+((t<16?"0":"")+t.toString(16)).toUpperCase();return e})(),xw=function(t){for(;t.length>1;){var n=t.pop(),r=n.obj[n.prop];if(un(r)){for(var s=[],o=0;o<r.length;++o)typeof r[o]<"u"&&(s[s.length]=r[o]);n.obj[n.prop]=s}}},Ln=function(t,n){for(var r=n&&n.plainObjects?{__proto__:null}:{},s=0;s<t.length;++s)typeof t[s]<"u"&&(r[s]=t[s]);return r},qi=function(t,n,r){n==="__proto__"&&hu?hu(t,n,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[n]=r},bw=function e(t,n,r){if(!n)return t;if(typeof n!="object"&&typeof n!="function"){if(un(t)){var s=t.length;if(r&&typeof r.arrayLimit=="number"&&s>=r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t.concat(n),r),s)}t[s]=n}else if(t&&typeof t=="object")if(dn(t)){var o=ur(t)+1;t[o]=n,Hi(t,o)}else{if(r&&r.strictMerge)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!ii.call(Object.prototype,n))&&(t[n]=!0)}else return[t,n];return t}if(!t||typeof t!="object"){if(dn(n)){for(var i=Object.keys(n),a=r&&r.plainObjects?{__proto__:null,0:t}:{0:t},c=0;c<i.length;c++){var u=parseInt(i[c],10);a[u+1]=n[i[c]]}return fn(a,ur(n)+1)}var f=[t].concat(n);if(r&&typeof r.arrayLimit=="number"&&f.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(f,r),f.length-1)}return f}var d=t;if(un(t)&&!un(n)&&(d=Ln(t,r)),un(t)&&un(n)){if(n.forEach(function(p,h){if(ii.call(t,h)){var m=t[h];m&&typeof m=="object"&&p&&typeof p=="object"?t[h]=e(m,p,r):t[t.length]=p}else t[h]=p}),r&&typeof r.arrayLimit=="number"&&t.length>r.arrayLimit){if(r.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+r.arrayLimit+" element"+(r.arrayLimit===1?"":"s")+" allowed in an array.");return fn(Ln(t,r),t.length-1)}return t}return Object.keys(n).reduce(function(p,h){var m=n[h];if(ii.call(p,h)?qi(p,h,e(p[h],m,r)):qi(p,h,m),dn(n)&&!dn(p)&&fn(p,ur(n)),dn(p)){var g=parseInt(h,10);String(g)===h&&g>=0&&g>ur(p)&&Hi(p,g)}return p},d)},vw=function(t,n){return Object.keys(n).reduce(function(r,s){return qi(r,s,n[s]),r},t)},ww=function(e,t,n){var r=e.replace(/\+/g," ");if(n==="iso-8859-1")return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch{return r}},fs=1024,Sw=function(t,n,r,s,o){if(t.length===0)return t;var i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(m){return"%26%23"+parseInt(m.slice(2),16)+"%3B"});for(var a="",c=0;c<i.length;c+=fs){var u=i.length>=fs?i.slice(c,c+fs):i;if(c+fs<i.length){var f=u.charCodeAt(u.length-1);f>=55296&&f<=56319&&(u=u.slice(0,-1),c-=1)}for(var d=[],p=0;p<u.length;++p){var h=u.charCodeAt(p);if(h===45||h===46||h===95||h===126||h>=48&&h<=57||h>=65&&h<=90||h>=97&&h<=122||o===yw.RFC1738&&(h===40||h===41)){d[d.length]=u.charAt(p);continue}if(h<128){d[d.length]=kt[h];continue}if(h<2048){d[d.length]=kt[192|h>>6]+kt[128|h&63];continue}if(h<55296||h>=57344){d[d.length]=kt[224|h>>12]+kt[128|h>>6&63]+kt[128|h&63];continue}p+=1,h=65536+((h&1023)<<10|u.charCodeAt(p)&1023),d[d.length]=kt[240|h>>18]+kt[128|h>>12&63]+kt[128|h>>6&63]+kt[128|h&63]}a+=d.join("")}return a},jw=function(t){for(var n=[{obj:{o:t},prop:"o"}],r=Kd(),s=0;s<n.length;++s)for(var o=n[s],i=o.obj[o.prop],a=Object.keys(i),c=0;c<a.length;++c){var u=a[c],f=i[u];typeof f=="object"&&f!==null&&!r.has(f)&&(n[n.length]={obj:i,prop:u},r.set(f,!0))}return xw(n),t},Ew=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},kw=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Aw=function(t,n,r,s,o){if(dn(t)){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");var i=ur(t)+1;return t[i]=n,Hi(t,i),t}var a=[].concat(t,n);if(a.length>r){if(o)throw new RangeError("Array limit exceeded. Only "+r+" element"+(r===1?"":"s")+" allowed in an array.");return fn(Ln(a,{plainObjects:s}),a.length-1)}return a},Tw=function(t,n){if(un(t)){for(var r=[],s=0;s<t.length;s+=1)r[r.length]=n(t[s]);return r}return n(t)},Jd={arrayToObject:Ln,assign:vw,combine:Aw,compact:jw,decode:ww,encode:Sw,isBuffer:kw,isOverflow:dn,isRegExp:Ew,markOverflow:fn,maybeMap:Tw,merge:bw},Yd=Vd,Ss=Jd,gr=Ha,Ow=Object.prototype.hasOwnProperty,Zd={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,n){return t+"["+n+"]"},repeat:function(t){return t}},Tt=Array.isArray,Nw=Array.prototype.push,Xd=function(e,t){Nw.apply(e,Tt(t)?t:[t])},Cw=Date.prototype.toISOString,mu=gr.default,Fe={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ss.encode,encodeValuesOnly:!1,filter:void 0,format:mu,formatter:gr.formatters[mu],indices:!1,serializeDate:function(t){return Cw.call(t)},skipNulls:!1,strictNullHandling:!1},_w=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},ai={},Rw=function e(t,n,r,s,o,i,a,c,u,f,d,p,h,m,g,v,j,y){for(var b=t,S=y,k=0,w=!1;(S=S.get(ai))!==void 0&&!w;){var E=S.get(t);if(k+=1,typeof E<"u"){if(E===k)throw new RangeError("Cyclic object value");w=!0}typeof S.get(ai)>"u"&&(k=0)}if(typeof f=="function"?b=f(n,b):b instanceof Date?b=h(b):r==="comma"&&Tt(b)&&(b=Ss.maybeMap(b,function($){return $ instanceof Date?h($):$})),b===null){if(i)return g(u&&!v?u(n,Fe.encoder,j,"key",m):n);b=""}if(_w(b)||Ss.isBuffer(b)){if(u){var C=v?n:u(n,Fe.encoder,j,"key",m);return[g(C)+"="+g(u(b,Fe.encoder,j,"value",m))]}return[g(n)+"="+g(String(b))]}var O=[];if(typeof b>"u")return O;var T;if(r==="comma"&&Tt(b))v&&u&&(b=Ss.maybeMap(b,function($){return $==null?$:u($)})),T=[{value:b.length>0?b.join(",")||null:void 0}];else if(Tt(f))T=f;else{var P=Object.keys(b);T=d?P.sort(d):P}var R=c?String(n).replace(/\./g,"%2E"):String(n),U=s&&Tt(b)&&b.length===1?R+"[]":R;if(o&&Tt(b)&&b.length===0)return U+"[]";for(var J=0;J<T.length;++J){var Z=T[J],_=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:b[Z];if(!(a&&_===null)){var M=p&&c?String(Z).replace(/\./g,"%2E"):String(Z),K=Tt(b)?typeof r=="function"?r(U,M):U:U+(p?"."+M:"["+M+"]");y.set(t,k);var Y=Yd();Y.set(ai,y),Xd(O,e(_,K,r,s,o,i,a,c,r==="comma"&&v&&Tt(b)?null:u,f,d,p,h,m,g,v,j,Y))}}return O},Iw=function(t){if(!t)return Fe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.encodeDotInKeys<"u"&&typeof t.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var n=t.charset||Fe.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=gr.default;if(typeof t.format<"u"){if(!Ow.call(gr.formatters,t.format))throw new TypeError("Unknown format option provided.");r=t.format}var s=gr.formatters[r],o=Fe.filter;(typeof t.filter=="function"||Tt(t.filter))&&(o=t.filter);var i;if(t.arrayFormat in Zd?i=t.arrayFormat:"indices"in t?i=t.indices?"indices":"repeat":i=Fe.arrayFormat,"commaRoundTrip"in t&&typeof t.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var a=typeof t.allowDots>"u"?t.encodeDotInKeys===!0?!0:Fe.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Fe.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Fe.allowEmptyArrays,arrayFormat:i,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Fe.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Fe.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Fe.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Fe.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Fe.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Fe.encodeValuesOnly,filter:o,format:r,formatter:s,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Fe.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Fe.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Fe.strictNullHandling}},Pw=function(e,t){var n=e,r=Iw(t),s,o;typeof r.filter=="function"?(o=r.filter,n=o("",n)):Tt(r.filter)&&(o=r.filter,s=o);var i=[];if(typeof n!="object"||n===null)return"";var a=Zd[r.arrayFormat],c=a==="comma"&&r.commaRoundTrip;s||(s=Object.keys(n)),r.sort&&s.sort(r.sort);for(var u=Yd(),f=0;f<s.length;++f){var d=s[f];if(!(typeof d>"u"||d===null)){var p=n[d];r.skipNulls&&p===null||Xd(i,Rw(p,d,a,c,r.allowEmptyArrays,r.strictNullHandling,r.skipNulls,r.encodeDotInKeys,r.encode?r.encoder:null,r.filter,r.sort,r.allowDots,r.serializeDate,r.format,r.formatter,r.encodeValuesOnly,r.charset,u))}}var h=i.join(r.delimiter),m=r.addQueryPrefix===!0?"?":"";return r.charsetSentinel&&(r.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B"+r.delimiter:m+="utf8=%E2%9C%93"+r.delimiter),h.length>0?m+h:""},_t=Jd,js=Object.prototype.hasOwnProperty,li=Array.isArray,Oe={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:_t.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictMerge:!0,strictNullHandling:!1,throwOnLimitExceeded:!1},$w=function(e){return e.replace(/&#(\d+);/g,function(t,n){return String.fromCharCode(parseInt(n,10))})},Qd=function(e,t,n,r){if(e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1){if(r&&t.throwOnLimitExceeded)for(var s=0,o=e.indexOf(",");o>-1;){if(s+=1,s>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");o=e.indexOf(",",o+1)}return e.split(",")}if(t.throwOnLimitExceeded&&n>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(t.arrayLimit===1?"":"s")+" allowed in an array.");return e},Mw="utf8=%26%2310003%3B",Lw="utf8=%E2%9C%93",Dw=function(t,n){var r={__proto__:null},s=n.ignoreQueryPrefix?t.replace(/^\?/,""):t;s=s.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=n.parameterLimit===1/0?void 0:n.parameterLimit,i=s.split(n.delimiter,n.throwOnLimitExceeded&&typeof o<"u"?o+1:o);if(n.throwOnLimitExceeded&&typeof o<"u"&&i.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var a=-1,c,u=n.charset;if(n.charsetSentinel)for(c=0;c<i.length;++c)i[c].indexOf("utf8=")===0&&(i[c]===Lw?u="utf-8":i[c]===Mw&&(u="iso-8859-1"),a=c,c=i.length);for(c=0;c<i.length;++c)if(c!==a){var f=i[c],d=f.indexOf("]="),p=d===-1?f.indexOf("="):d+1,h,m;if(p===-1?(h=n.decoder(f,Oe.decoder,u,"key"),m=n.strictNullHandling?null:""):(h=n.decoder(f.slice(0,p),Oe.decoder,u,"key"),h!==null&&(m=_t.maybeMap(Qd(f.slice(p+1),n,li(r[h])?r[h].length:0,f.indexOf("[]=")===-1),function(v){return n.decoder(v,Oe.decoder,u,"value")}))),m&&n.interpretNumericEntities&&u==="iso-8859-1"&&(m=$w(String(m))),f.indexOf("[]=")>-1&&(m=li(m)?[m]:m),n.comma&&li(m)&&m.length>n.arrayLimit&&(m=_t.combine([],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded)),h!==null){var g=js.call(r,h);g&&(n.duplicates==="combine"||f.indexOf("[]=")>-1)?r[h]=_t.combine(r[h],m,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded):(!g||n.duplicates==="last")&&(r[h]=m)}}return r},Bw=function(e,t,n,r){var s=0;if(e.length>0&&e[e.length-1]==="[]"){var o=e.slice(0,-1).join("");s=Array.isArray(t)&&t[o]?t[o].length:0}for(var i=r?t:Qd(t,n,s),a=e.length-1;a>=0;--a){var c,u=e[a];if(u==="[]"&&n.parseArrays)_t.isOverflow(i)?c=i:c=n.allowEmptyArrays&&(i===""||n.strictNullHandling&&i===null)?[]:_t.combine([],i,n.arrayLimit,n.plainObjects,n.throwOnLimitExceeded);else{c=n.plainObjects?{__proto__:null}:{};var f=u.charAt(0)==="["&&u.charAt(u.length-1)==="]"?u.slice(1,-1):u,d=n.decodeDotInKeys?f.replace(/%2E/g,"."):f,p=parseInt(d,10),h=!isNaN(p)&&u!==d&&String(p)===d&&p>=0&&n.parseArrays;if(!n.parseArrays&&d==="")c={0:i};else if(h&&p<n.arrayLimit)c=[],c[p]=i;else{if(h&&n.throwOnLimitExceeded)throw new RangeError("Array limit exceeded. Only "+n.arrayLimit+" element"+(n.arrayLimit===1?"":"s")+" allowed in an array.");h?(c[p]=i,_t.markOverflow(c,p)):d!=="__proto__"&&(c[d]=i)}}i=c}return i},Fw=function(t,n){var r=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t;if(n.depth<=0)return!n.plainObjects&&js.call(Object.prototype,r)&&!n.allowPrototypes?void 0:[r];var s=[],o=r.indexOf("["),i=o>=0?r.slice(0,o):r;if(i){if(!n.plainObjects&&js.call(Object.prototype,i)&&!n.allowPrototypes)return;s[s.length]=i}for(var a=r.length,c=o,u=0;c>=0&&u<n.depth;){for(var f=1,d=c+1,p=-1;d<a&&p<0;){var h=r.charCodeAt(d);h===91?f+=1:h===93&&(f-=1,f===0&&(p=d)),d+=1}if(p<0)return s[s.length]="["+r.slice(c)+"]",s;var m=r.slice(c,p+1),g=m.slice(1,-1);if(!n.plainObjects&&js.call(Object.prototype,g)&&!n.allowPrototypes)return;s[s.length]=m,u+=1,c=r.indexOf("[",p+1)}if(c>=0){if(n.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+n.depth+" and strictDepth is true");s[s.length]="["+r.slice(c)+"]"}return s},Uw=function(t,n,r,s){if(t){var o=Fw(t,r);if(o)return Bw(o,n,r,s)}},Hw=function(t){if(!t)return Oe;if(typeof t.allowEmptyArrays<"u"&&typeof t.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof t.decodeDotInKeys<"u"&&typeof t.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(t.decoder!==null&&typeof t.decoder<"u"&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof t.throwOnLimitExceeded<"u"&&typeof t.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var n=typeof t.charset>"u"?Oe.charset:t.charset,r=typeof t.duplicates>"u"?Oe.duplicates:t.duplicates;if(r!=="combine"&&r!=="first"&&r!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var s=typeof t.allowDots>"u"?t.decodeDotInKeys===!0?!0:Oe.allowDots:!!t.allowDots;return{allowDots:s,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Oe.allowEmptyArrays,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:Oe.allowPrototypes,allowSparse:typeof t.allowSparse=="boolean"?t.allowSparse:Oe.allowSparse,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:Oe.arrayLimit,charset:n,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Oe.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:Oe.comma,decodeDotInKeys:typeof t.decodeDotInKeys=="boolean"?t.decodeDotInKeys:Oe.decodeDotInKeys,decoder:typeof t.decoder=="function"?t.decoder:Oe.decoder,delimiter:typeof t.delimiter=="string"||_t.isRegExp(t.delimiter)?t.delimiter:Oe.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:Oe.depth,duplicates:r,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:Oe.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:Oe.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:Oe.plainObjects,strictDepth:typeof t.strictDepth=="boolean"?!!t.strictDepth:Oe.strictDepth,strictMerge:typeof t.strictMerge=="boolean"?!!t.strictMerge:Oe.strictMerge,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Oe.strictNullHandling,throwOnLimitExceeded:typeof t.throwOnLimitExceeded=="boolean"?t.throwOnLimitExceeded:!1}},qw=function(e,t){var n=Hw(t);if(e===""||e===null||typeof e>"u")return n.plainObjects?{__proto__:null}:{};for(var r=typeof e=="string"?Dw(e,n):e,s=n.plainObjects?{__proto__:null}:{},o=Object.keys(r),i=0;i<o.length;++i){var a=o[i],c=Uw(a,r[a],n,typeof e=="string");s=_t.merge(s,c,n)}return n.allowSparse===!0?s:_t.compact(s)},zw=Pw,Ww=qw,Vw=Ha,Es={formats:Vw,parse:Ww,stringify:zw},Kw=Zb;function bt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var Jw=/^([a-z0-9.+-]+:)/i,Yw=/:[0-9]*$/,Zw=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Xw=["<",">",'"',"`"," ","\r",`
|
|
175
|
-
`," "],Qw=["{","}","|","\\","^","`"].concat(Xw),zi=["'"].concat(Qw),gu=["%","/","?",";","#"].concat(zi),yu=["/","?","#"],Gw=255,xu=/^[+a-z0-9A-Z_-]{0,63}$/,eS=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,tS={javascript:!0,"javascript:":!0},Wi={javascript:!0,"javascript:":!0},Bn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Vi=Es;function qa(e,t,n){if(e&&typeof e=="object"&&e instanceof bt)return e;var r=new bt;return r.parse(e,t,n),r}bt.prototype.parse=function(e,t,n){if(typeof e!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var r=e.indexOf("?"),s=r!==-1&&r<e.indexOf("#")?"?":"#",o=e.split(s),i=/\\/g;o[0]=o[0].replace(i,"/"),e=o.join(s);var a=e;if(a=a.trim(),!n&&e.split("#").length===1){var c=Zw.exec(a);if(c)return this.path=a,this.href=a,this.pathname=c[1],c[2]?(this.search=c[2],t?this.query=Vi.parse(this.search.substr(1)):this.query=this.search.substr(1)):t&&(this.search="",this.query={}),this}var u=Jw.exec(a);if(u){u=u[0];var f=u.toLowerCase();this.protocol=f,a=a.substr(u.length)}if(n||u||a.match(/^\/\/[^@/]+@[^@/]+/)){var d=a.substr(0,2)==="//";d&&!(u&&Wi[u])&&(a=a.substr(2),this.slashes=!0)}if(!Wi[u]&&(d||u&&!Bn[u])){for(var p=-1,h=0;h<yu.length;h++){var m=a.indexOf(yu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}var g,v;p===-1?v=a.lastIndexOf("@"):v=a.lastIndexOf("@",p),v!==-1&&(g=a.slice(0,v),a=a.slice(v+1),this.auth=decodeURIComponent(g)),p=-1;for(var h=0;h<gu.length;h++){var m=a.indexOf(gu[h]);m!==-1&&(p===-1||m<p)&&(p=m)}p===-1&&(p=a.length),this.host=a.slice(0,p),a=a.slice(p),this.parseHost(),this.hostname=this.hostname||"";var j=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!j)for(var y=this.hostname.split(/\./),h=0,b=y.length;h<b;h++){var S=y[h];if(S&&!S.match(xu)){for(var k="",w=0,E=S.length;w<E;w++)S.charCodeAt(w)>127?k+="x":k+=S[w];if(!k.match(xu)){var C=y.slice(0,h),O=y.slice(h+1),T=S.match(eS);T&&(C.push(T[1]),O.unshift(T[2])),O.length&&(a="/"+O.join(".")+a),this.hostname=C.join(".");break}}}this.hostname.length>Gw?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=Kw.toASCII(this.hostname));var P=this.port?":"+this.port:"",R=this.hostname||"";this.host=R+P,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),a[0]!=="/"&&(a="/"+a))}if(!tS[f])for(var h=0,b=zi.length;h<b;h++){var U=zi[h];if(a.indexOf(U)!==-1){var J=encodeURIComponent(U);J===U&&(J=escape(U)),a=a.split(U).join(J)}}var Z=a.indexOf("#");Z!==-1&&(this.hash=a.substr(Z),a=a.slice(0,Z));var _=a.indexOf("?");if(_!==-1?(this.search=a.substr(_),this.query=a.substr(_+1),t&&(this.query=Vi.parse(this.query)),a=a.slice(0,_)):t&&(this.search="",this.query={}),a&&(this.pathname=a),Bn[f]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var P=this.pathname||"",M=this.search||"";this.path=P+M}return this.href=this.format(),this};function nS(e){return typeof e=="string"&&(e=qa(e)),e instanceof bt?e.format():bt.prototype.format.call(e)}bt.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",r=this.hash||"",s=!1,o="";this.host?s=e+this.host:this.hostname&&(s=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(s+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Vi.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var i=this.search||o&&"?"+o||"";return t&&t.substr(-1)!==":"&&(t+=":"),this.slashes||(!t||Bn[t])&&s!==!1?(s="//"+(s||""),n&&n.charAt(0)!=="/"&&(n="/"+n)):s||(s=""),r&&r.charAt(0)!=="#"&&(r="#"+r),i&&i.charAt(0)!=="?"&&(i="?"+i),n=n.replace(/[?#]/g,function(a){return encodeURIComponent(a)}),i=i.replace("#","%23"),t+s+n+i+r};bt.prototype.resolve=function(e){return this.resolveObject(qa(e,!1,!0)).format()};bt.prototype.resolveObject=function(e){if(typeof e=="string"){var t=new bt;t.parse(e,!1,!0),e=t}for(var n=new bt,r=Object.keys(this),s=0;s<r.length;s++){var o=r[s];n[o]=this[o]}if(n.hash=e.hash,e.href==="")return n.href=n.format(),n;if(e.slashes&&!e.protocol){for(var i=Object.keys(e),a=0;a<i.length;a++){var c=i[a];c!=="protocol"&&(n[c]=e[c])}return Bn[n.protocol]&&n.hostname&&!n.pathname&&(n.pathname="/",n.path=n.pathname),n.href=n.format(),n}if(e.protocol&&e.protocol!==n.protocol){if(!Bn[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var d=u[f];n[d]=e[d]}return n.href=n.format(),n}if(n.protocol=e.protocol,!e.host&&!Wi[e.protocol]){for(var b=(e.pathname||"").split("/");b.length&&!(e.host=b.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),b[0]!==""&&b.unshift(""),b.length<2&&b.unshift(""),n.pathname=b.join("/")}else n.pathname=e.pathname;if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var p=n.pathname||"",h=n.search||"";n.path=p+h}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var m=n.pathname&&n.pathname.charAt(0)==="/",g=e.host||e.pathname&&e.pathname.charAt(0)==="/",v=g||m||n.host&&e.pathname,j=v,y=n.pathname&&n.pathname.split("/")||[],b=e.pathname&&e.pathname.split("/")||[],S=n.protocol&&!Bn[n.protocol];if(S&&(n.hostname="",n.port=null,n.host&&(y[0]===""?y[0]=n.host:y.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(b[0]===""?b[0]=e.host:b.unshift(e.host)),e.host=null),v=v&&(b[0]===""||y[0]==="")),g)n.host=e.host||e.host===""?e.host:n.host,n.hostname=e.hostname||e.hostname===""?e.hostname:n.hostname,n.search=e.search,n.query=e.query,y=b;else if(b.length)y||(y=[]),y.pop(),y=y.concat(b),n.search=e.search,n.query=e.query;else if(e.search!=null){if(S){n.host=y.shift(),n.hostname=n.host;var k=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;k&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname)}return n.search=e.search,n.query=e.query,(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!y.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var w=y.slice(-1)[0],E=(n.host||e.host||y.length>1)&&(w==="."||w==="..")||w==="",C=0,O=y.length;O>=0;O--)w=y[O],w==="."?y.splice(O,1):w===".."?(y.splice(O,1),C++):C&&(y.splice(O,1),C--);if(!v&&!j)for(;C--;C)y.unshift("..");v&&y[0]!==""&&(!y[0]||y[0].charAt(0)!=="/")&&y.unshift(""),E&&y.join("/").substr(-1)!=="/"&&y.push("");var T=y[0]===""||y[0]&&y[0].charAt(0)==="/";if(S){n.hostname=T?"":y.length?y.shift():"",n.host=n.hostname;var k=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;k&&(n.auth=k.shift(),n.hostname=k.shift(),n.host=n.hostname)}return v=v||n.host&&y.length,v&&!T&&y.unshift(""),y.length>0?n.pathname=y.join("/"):(n.pathname=null,n.path=null),(n.pathname!==null||n.search!==null)&&(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n};bt.prototype.parseHost=function(){var e=this.host,t=Yw.exec(e);t&&(t=t[0],t!==":"&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var rS=qa,bu=nS;const sS=()=>Object.keys(Mn).map(e=>({...Mn[e].info,clients:Object.keys(Mn[e].clientsById).map(t=>Mn[e].clientsById[t].info)})),oS=e=>typeof e=="object"&&"log"in e&&typeof e.log=="object"&&"entries"in e.log&&Array.isArray(e.log.entries);var iS=class{constructor(e,t={}){this.initCalled=!1,this.entries=[],this.requests=[],this.options={},this.options={harIsAlreadyEncoded:!1,...t},this.requests=[],oS(e)?this.entries=e.log.entries:this.entries=[{request:e}]}init(){return this.initCalled=!0,this.requests=this.entries.map(({request:e})=>{var n;const t={bodySize:0,headersSize:0,headers:[],cookies:[],httpVersion:"HTTP/1.1",queryString:[],postData:{mimeType:((n=e.postData)==null?void 0:n.mimeType)||"application/octet-stream"},...e};return t.postData&&!t.postData.mimeType&&(t.postData.mimeType="application/octet-stream"),this.prepare(t,this.options)}),this}prepare(e,t){var f,d,p;const n={...e,fullUrl:"",uriObj:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{}};if(n!=null&&n.queryString.length&&(n.queryObj=n.queryString.reduce(qc,{})),n!=null&&n.headers.length){const h=/^HTTP\/2/;n.headersObj=n.headers.reduce((m,{name:g,value:v})=>{const j=h.exec(n.httpVersion)?g.toLocaleLowerCase():g;return{...m,[j]:v}},{})}n!=null&&n.cookies.length&&(n.cookiesObj=n.cookies.reduceRight((h,{name:m,value:g})=>({...h,[m]:g}),{}));const r=(f=n.cookies)==null?void 0:f.map(({name:h,value:m})=>t.harIsAlreadyEncoded?`${h}=${m}`:`${encodeURIComponent(h)}=${encodeURIComponent(m)}`);switch(r!=null&&r.length&&(n.allHeaders.cookie=r.join("; ")),n.postData.mimeType){case"multipart/mixed":case"multipart/related":case"multipart/form-data":case"multipart/alternative":if(n.postData.text="",n.postData.mimeType="multipart/form-data",(d=n.postData)!=null&&d.params){const h="---011000010111000001101001",m=`${h}--`,g=`\r
|
|
176
|
-
`;/*! formdata-polyfill. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> */const v=S=>S.replace(/\n/g,"%0A").replace(/\r/g,"%0D").replace(/"/g,"%22"),j=S=>S.replace(/\r?\n|\r/g,`\r
|
|
177
|
-
`),y=[`--${h}`];(p=n.postData)==null||p.params.forEach((S,k)=>{const w=S.name,E=S.value||"",C=S.fileName||null,O=S.contentType||"application/octet-stream";C?(y.push(`Content-Disposition: form-data; name="${v(j(w))}"; filename="${C}"`),y.push(`Content-Type: ${O}`)):y.push(`Content-Disposition: form-data; name="${escape(j(w))}"`),y.push(""),y.push(j(E)),k!==n.postData.params.length-1&&y.push(`--${h}`)}),y.push(`--${m}`),n.postData.boundary=h,n.postData.text=y.join(g);const b=Ze(n.headersObj,"content-type")||"content-type";n.headersObj[b]=`multipart/form-data; boundary=${h}`}break;case"application/x-www-form-urlencoded":n.postData.params?(n.postData.paramsObj=n.postData.params.reduce(qc,{}),n.postData.text=Es.stringify(n.postData.paramsObj)):n.postData.text="";break;case"text/json":case"text/x-json":case"application/json":case"application/x-json":if(n.postData.mimeType="application/json",n.postData.text)try{n.postData.jsonObj=JSON.parse(n.postData.text)}catch{n.postData.mimeType="text/plain"}break}const s={...n.allHeaders,...n.headersObj},o=rS(n.url,!0,!0);n.queryObj={...n.queryObj,...o.query};let i;t.harIsAlreadyEncoded?i=Es.stringify(n.queryObj,{encode:!1,indices:!1}):i=Es.stringify(n.queryObj,{indices:!1});const a={...o,query:n.queryObj,search:i,path:i?`${o.pathname}?${i}`:o.pathname},c=bu({...o,query:null,search:null}),u=bu({...o,...a});return{...n,allHeaders:s,fullUrl:u,url:c,uriObj:a}}convert(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{convert:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s(o,n))}installation(e,t,n){this.initCalled||this.init(),!n&&t&&(n={clientId:t});const r=Mn[e];if(!r)return[!1];const{info:s}=r.clientsById[t||r.info.default];return this.requests.map(o=>s!=null&&s.installation?s.installation(o,n):!1)}};const aS="agent",lS="prompt";function cS(){return sS()}function uS(e){var r;const t=e==null?void 0:e[0];if(!t)return"http://localhost";let n=t.url;for(const[s,o]of Object.entries(t.variables??{})){const i=o.default??((r=o.enum)==null?void 0:r[0])??`{${s}}`;n=n.replace(new RegExp(`\\{${s}\\}`,"g"),String(i))}return n}function fS(e){if(e.example!==void 0||e.examples&&Object.keys(e.examples).length>0)return!0;const t=e.schema;return!!((t==null?void 0:t.example)!==void 0||t!=null&&t.enum&&t.enum.length>0)}function Gd(e){if(e.example!==void 0)return String(e.example);if(e.examples){for(const n of Object.values(e.examples))if(n&&typeof n=="object"&&"value"in n&&n.value!==void 0)return String(n.value)}const t=e.schema;return(t==null?void 0:t.example)!==void 0?String(t.example):t!=null&&t.enum&&t.enum.length>0?String(t.enum[0]):`{${e.name}}`}function dS(e,t,n){const r=t.replace(/\{([^}]+)\}/g,(s,o)=>{const i=n.find(c=>c.in==="path"&&c.name===o);if(!i)return s;const a=Gd(i);return a===`{${o}}`?a:encodeURIComponent(a)});return`${e.replace(/\/$/,"")}${r}`}function pS(e,t){var s;const n=e[0];if(!n||!t)return[];const r=[];for(const o of Object.keys(n)){const i=t[o];if(i)if(i.type==="apiKey"){const a=i.in==="query"||i.in==="cookie"?i.in:"header";r.push({location:a,name:i.name,value:"YOUR_API_KEY"})}else if(i.type==="http"){const a=((s=i.scheme)==null?void 0:s.toLowerCase())==="basic";r.push({location:"header",name:"Authorization",value:a?"Basic BASE64_ENCODED_CREDENTIALS":"Bearer YOUR_ACCESS_TOKEN"})}else(i.type==="oauth2"||i.type==="openIdConnect")&&r.push({location:"header",name:"Authorization",value:"Bearer YOUR_ACCESS_TOKEN"})}return r}function hS(e){const t=e==null?void 0:e.content;if(!t)return null;const n="application/json"in t?"application/json":Object.keys(t)[0];if(!n)return null;const r=t[n];let s=r.example;if(s===void 0&&r.examples){for(const o of Object.values(r.examples))if(o&&typeof o=="object"&&"value"in o&&o.value!==void 0){s=o.value;break}}return{contentType:n,schema:r.schema,authorExample:s}}function mS(e){const t=uS(e.servers),n=dS(t,e.path,e.parameters),r=pS(e.security,e.securitySchemes),s=[],o=[],i=[];for(const c of r)(c.location==="header"?s:c.location==="query"?o:i).push({name:c.name,value:c.value});for(const c of e.parameters)c.in==="query"&&(c.required||fS(c))&&o.push({name:c.name,value:Gd(c)});const a={method:e.method.toUpperCase(),url:n,httpVersion:"HTTP/1.1",headers:s,queryString:o,cookies:i};return e.media&&e.resolvedBodyValue!==void 0&&(s.push({name:"Content-Type",value:e.media.contentType}),a.postData={mimeType:e.media.contentType,text:JSON.stringify(e.resolvedBodyValue,null,2)}),a}function gS(e,t,n){try{const r=new iS(e),[s]=r.convert(t,n);return typeof s=="string"?s:""}catch{return""}}const yS={agent:"plaintext",c:"c",clojure:"clojure",crystal:"crystal",csharp:"csharp",go:"go",http:"http",java:"java",javascript:"javascript",json:"json",kotlin:"kotlin",node:"javascript",objc:"objectivec",ocaml:"ocaml",php:"php",powershell:"powershell",python:"python",r:"r",ruby:"ruby",rust:"rust",shell:"bash",swift:"swift"};function xS(e){return yS[e]??"plaintext"}const bS={c:()=>Promise.resolve().then(()=>require("./c-C_Sx7N-F.cjs")),clojure:()=>Promise.resolve().then(()=>require("./clojure-DWYEZwCD.cjs")),crystal:()=>Promise.resolve().then(()=>require("./crystal-BcGgviMR.cjs")),csharp:()=>Promise.resolve().then(()=>require("./csharp-yuAGIuP4.cjs")),go:()=>Promise.resolve().then(()=>require("./go-BpetKc7b.cjs")),http:()=>Promise.resolve().then(()=>require("./http--XH4hLDt.cjs")),java:()=>Promise.resolve().then(()=>require("./java-BIk0G-rH.cjs")),kotlin:()=>Promise.resolve().then(()=>require("./kotlin-kGuORR5a.cjs")),objectivec:()=>Promise.resolve().then(()=>require("./objectivec-CoeV81Tz.cjs")),ocaml:()=>Promise.resolve().then(()=>require("./ocaml-0j7KDjso.cjs")),php:()=>Promise.resolve().then(()=>require("./php-DF4zG2hq.cjs")),powershell:()=>Promise.resolve().then(()=>require("./powershell-CvydS3ek.cjs")),r:()=>Promise.resolve().then(()=>require("./r-CYaZnHkA.cjs")),ruby:()=>Promise.resolve().then(()=>require("./ruby-nPcbuC2a.cjs")),rust:()=>Promise.resolve().then(()=>require("./rust-DKnYCg2f.cjs")),swift:()=>Promise.resolve().then(()=>require("./swift-CAnH__EC.cjs"))};function Ki(e){return e==="plaintext"||!!vt.getLanguage(e)}async function vS(e){if(Ki(e))return;const t=bS[e];if(!t)return;const n=await t();vt.registerLanguage(e,n.default)}const wS=`${aS}:${lS}`;function SS({method:e,path:t,parameters:n,requestBody:r,security:s,id:o}){var w;const{document:i,showCodeSamples:a}=Gi(),c=i,u=A.useId(),f=A.useMemo(()=>cS(),[]),[d,p]=A.useState(wS),[h,m]=d.split(":"),g=xS(h),v=A.useMemo(()=>hS(r),[r]),[j,y]=A.useState(void 0);A.useEffect(()=>{if(y(void 0),!v||v.authorExample!==void 0||!v.schema)return;let E=!1;return cb(v.schema).then(C=>{E||y(C)}),()=>{E=!0}},[v]);const[,b]=A.useState(()=>Ki(g));A.useEffect(()=>{b(Ki(g));let E=!1;return vS(g).then(()=>{E||b(!0)}),()=>{E=!0}},[g]);const S=A.useMemo(()=>{var E;return mS({method:e,path:t,servers:c.servers,parameters:n,security:s,securitySchemes:(E=c.components)==null?void 0:E.securitySchemes,media:v,resolvedBodyValue:(v==null?void 0:v.authorExample)??j})},[e,t,c.servers,n,s,(w=c.components)==null?void 0:w.securitySchemes,v,j]),k=A.useMemo(()=>gS(S,h,m),[S,h,m]);return a?l.jsxs("div",{id:`endpoint-${o}-code-samples`,children:[l.jsxs("div",{className:"flex items-center justify-between mb-2",children:[l.jsx("label",{htmlFor:u,className:"text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Example Request"}),l.jsx("select",{id:u,value:d,onChange:E=>p(E.target.value),"aria-label":"Code sample language",className:"text-xs font-medium rounded-md border border-border bg-surface px-2 py-1 text-foreground-secondary focus:border-secondary-500 focus:ring-secondary-500",children:f.map(E=>l.jsx("optgroup",{label:E.title,children:E.clients.map(C=>l.jsx("option",{value:`${E.key}:${C.key}`,children:C.title},C.key))},E.key))})]}),l.jsx(Na,{code:k,language:g})]}):null}function jS({className:e}){return l.jsxs("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",className:e,fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[l.jsx("circle",{cx:"12",cy:"12",r:"9"}),l.jsx("path",{d:"M12 11v5"}),l.jsx("path",{d:"M12 8h.01"})]})}function ep(e){return typeof e!="string"?JSON.stringify(e):e.startsWith("$")?e.slice(1).replace(/#\//g,".").replace(/\//g,"."):e}function ES(e){return e.replace(/\{\$([^}]+)\}/g,(t,n)=>`{${ep(`$${n}`)}}`)}function kS(e){return e.operationId??e.operationRef??null}const AS=e=>e.trim().replace(/[.:;]+$/,""),ci=({children:e})=>l.jsx("code",{className:"font-mono text-foreground-secondary",children:e});function TS({links:e,onFollowOperation:t,isOperationKnown:n}){return l.jsx("div",{className:"mt-3 space-y-1",children:Object.entries(e).map(([r,s])=>{var f;const o=kS(s),i=Object.entries(s.parameters??{}),a=s.description?AS(s.description):null,c=!!s.operationId&&!!t&&!!(n!=null&&n(s.operationId)),u=a??o??r;return l.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-foreground-muted leading-relaxed",children:[l.jsx(jS,{className:"w-3.5 h-3.5 shrink-0 mt-0.5"}),l.jsxs("span",{children:[c?l.jsx("button",{type:"button",onClick:()=>t(s.operationId),className:"text-primary-600 underline underline-offset-2 hover:text-primary-500",children:u}):l.jsx("span",{className:"text-foreground-secondary",children:u}),i.length>0&&l.jsxs(l.Fragment,{children:[" using ",i.map(([d,p],h)=>l.jsxs(A.Fragment,{children:[h>0&&(h===i.length-1?" and ":", "),l.jsx(ci,{children:d})," from ",l.jsx(ci,{children:ep(p)})]},d))]}),(f=s.server)!=null&&f.url?l.jsxs(l.Fragment,{children:[" via ",l.jsx(ci,{children:s.server.url})]}):null,"."]})]},r)})})}function OS(e){return Object.entries(e).flatMap(([t,n])=>Object.entries(n??{}).flatMap(([r,s],o)=>ra.filter(i=>s==null?void 0:s[i]).map(i=>({name:t,url:r,method:i,op:s[i],urlIndex:o}))))}function NS({callbacks:e,id:t,renderOperation:n,depth:r}){const s=OS(e);return s.length===0?null:l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-foreground-muted mb-3",children:"Requests the API sends to you after this operation, not ones you call."}),l.jsx("div",{className:"space-y-2",children:s.map(({name:o,url:i,method:a,op:c,urlIndex:u})=>l.jsx(Mr,{trigger:l.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal min-w-0",children:[l.jsx(Qt,{method:a,size:"xs",className:"shrink-0"}),l.jsx("span",{className:"font-medium text-foreground-secondary shrink-0",children:o}),l.jsx("code",{className:"font-mono text-foreground-muted truncate",children:ES(i)})]}),children:l.jsx("div",{className:"px-4 py-3 border-t border-border",children:l.jsx(n,{method:a,path:i,op:c,id:`${t}-${o}-${u}-${a}`,idPrefix:"callback",depth:r+1})})},`${o}-${u}-${a}`))})]})}function CS(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2")}function tp({prefix:e,mediaTypes:t,selected:n,onChange:r}){return t.length<=1?l.jsx(l.Fragment,{children:t[0]?`${e} (${t[0]})`:e}):l.jsxs(l.Fragment,{children:[e," (",l.jsx("select",{"aria-label":`${e} media type`,value:n,onChange:s=>r(s.target.value),className:"bg-transparent border-0 p-0 cursor-pointer underline decoration-dotted focus:outline-none",children:t.map(s=>l.jsx("option",{value:s,children:s},s))}),")"]})}function np(e){if(!e)return;if(e.example!==void 0)return e.example;const t=e.examples?Object.values(e.examples)[0]:void 0;return t&&"value"in t?t.value:void 0}function _S(e){return e.startsWith("2")?"bg-green-100 text-green-800":e.startsWith("4")||e.startsWith("5")?"bg-red-100 text-red-800":"bg-neutral-100 text-foreground-secondary"}function RS({responses:e,onFollowOperation:t,isOperationKnown:n}){var w,E;const r=Object.keys(e),[s,o]=A.useState(r[0]),i=e[s],a=Object.keys((i==null?void 0:i.content)??{}),[c,u]=A.useState(a[0]),f=c?(w=i==null?void 0:i.content)==null?void 0:w[c]:void 0,d=(i==null?void 0:i.headers)??{},p=(i==null?void 0:i.links)??{},[h,m]=A.useState("body"),g=a.length>0&&!!f,v=Object.keys(d).length>0,j=Object.keys(p).length>0,y=[...g?[{id:"body",name:"Body"}]:[],...v?[{id:"headers",name:"Headers"}]:[]],b=y.length>1,S=y.some(C=>C.id===h)?h:(E=y[0])==null?void 0:E.id,k=y.length>0;return A.useEffect(()=>{u(Object.keys((i==null?void 0:i.content)??{})[0]),m("body")},[s]),l.jsxs("div",{children:[l.jsx("div",{className:"flex items-center gap-1.5 flex-wrap mb-3",role:"tablist","aria-label":"Response status",children:r.map(C=>l.jsx("button",{role:"tab","aria-selected":s===C,onClick:()=>o(C),className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-mono transition-all ${_S(C)} ${s===C?"ring-1 ring-inset ring-foreground-muted/40":"opacity-50 hover:opacity-80"}`,children:C},C))}),(i==null?void 0:i.description)&&l.jsx("p",{className:"text-sm text-foreground-secondary mb-3",children:i.description}),k?l.jsxs(l.Fragment,{children:[b&&l.jsx(Wn,{tabs:y,current:S,onChange:C=>m(C)}),l.jsx("div",{className:b?"mt-4":void 0,children:S==="headers"?l.jsx(yn,{schema:PS(d),label:"Headers",rootName:"Headers",defaultView:"schema"},"headers"):l.jsx(yn,{schema:(f==null?void 0:f.schema)??{},label:l.jsx(tp,{prefix:"Body",mediaTypes:a,selected:c,onChange:u}),rootName:"Body",example:np(f)},"body")})]}):l.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No response body."}),j&&l.jsx(TS,{links:p,onFollowOperation:t,isOperationKnown:n})]})}function rp(e){const t={},n=[];for(const r of e){const s=r.schema??{};t[r.name]={...s,description:s.description??r.description},r.required&&n.push(r.name)}return{type:"object",properties:t,...n.length>0?{required:n}:{}}}const IS=e=>rp(e),PS=e=>rp(Object.entries(e).map(([t,n])=>({name:t,...n})));function $S({parameters:e}){var a;const t=ah.filter(({location:c})=>e.some(u=>u.in===c)),[n,r]=A.useState(((a=t[0])==null?void 0:a.location)??null);if(t.length===0)return null;const s=t.some(c=>c.location===n)?n:t[0].location,o=t.find(c=>c.location===s),i=IS(e.filter(c=>c.in===s));return l.jsxs("div",{children:[t.length>1&&l.jsx(Wn,{tabs:t.map(({location:c,label:u})=>({id:c,name:u.replace(/ Parameters$/,"")})),current:s,onChange:r}),l.jsx("div",{className:t.length>1?"mt-4":void 0,children:l.jsx(yn,{schema:i,label:o.label,rootName:o.label,defaultView:"schema"})})]})}function MS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}){const s=t.length>0,o=Object.keys(n),i=o.length>0,[a,c]=A.useState(s?"parameters":"body"),[u,f]=A.useState(o[0]),d=u?n[u]:void 0;if(!s&&!i)return l.jsx("p",{className:"text-xs text-foreground-muted italic",children:"No request body or parameters."});const p=[i?"request body":null,t.some(h=>h.in==="header")?"headers":null,t.some(h=>h.in==="cookie")?"cookie":null].filter(h=>!!h);return l.jsxs("div",{children:[l.jsxs("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-3",children:[l.jsx("span",{className:"font-bold",children:e})," expects the following ",LS(p),":"]}),s&&i&&l.jsx(Wn,{tabs:[{id:"parameters",name:"Parameters"},{id:"body",name:"Request Body"}],current:a,onChange:h=>c(h)}),l.jsxs("div",{className:s&&i?"mt-4":void 0,children:[(a==="parameters"||!i)&&s&&l.jsx($S,{parameters:t}),(a==="body"||!s)&&i&&d&&l.jsx(yn,{schema:d.schema??{},label:l.jsx(tp,{prefix:"Request Body",mediaTypes:o,selected:u,onChange:f}),rootName:"Body ",description:r,example:np(d)})]})]})}function LS(e){return e.length<=1?e[0]??"request":e.length===2?`${e[0]} and ${e[1]}`:`${e.slice(0,-1).join(", ")}, and ${e[e.length-1]}`}function DS({label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r,responses:s,callbacks:o,id:i,depth:a,fillHeight:c=!1,onFollowOperation:u,isOperationKnown:f}){const d=t.length>0||Object.keys(n).length>0,p=Object.keys(s).length>0,h=!!o&&Object.keys(o).length>0&&a<BS,m=[...d?["request"]:[],...p?["response"]:[],...h?["callbacks"]:[]],[g,v]=A.useState(m[0]??"request");if(m.length===0)return null;const j=m.includes(g)?g:m[0];return l.jsxs("div",{className:c?"flex-1 flex flex-col min-h-0":void 0,children:[l.jsx("div",{className:"flex items-end gap-0.5 -ml-2",role:"tablist","aria-label":"Operation exchange",children:m.map(y=>l.jsx("button",{role:"tab","aria-selected":j===y,onClick:()=>v(y),className:`px-3 py-1.5 text-sm font-medium rounded-t-md transition-colors capitalize ${j===y?"bg-neutral-100 text-foreground border border-b-0 border-border":"text-foreground-muted hover:text-foreground-secondary"}`,children:y},y))}),l.jsxs("div",{className:`-mx-5 px-5 py-4 bg-neutral-100 border-t border-border min-h-32 ${c?"flex-1 -mb-4":""}`,children:[j==="request"&&l.jsx(MS,{label:e,parameters:t,requestBodyContent:n,requestBodyDescription:r}),j==="response"&&l.jsx(RS,{responses:s,onFollowOperation:u,isOperationKnown:f}),j==="callbacks"&&o&&l.jsx(NS,{callbacks:o,id:i,depth:a,renderOperation:sp})]})]})}const BS=1;function sp({method:e,path:t,op:n,id:r,idPrefix:s="endpoint",globalSecurity:o,securitySchemes:i,onFollowOperation:a,isOperationKnown:c,depth:u=0}){var y,b,S;const f=(n.parameters??[]).filter(k=>k.in!=="query"&&k.in!=="path"),d=n.security??o??[],p=n.responses??{},h=((y=n.requestBody)==null?void 0:y.content)??{},m=n.operationId?CS(n.operationId):`${e.toUpperCase()} ${t}`,g=new Map;for(const k of d)for(const[w,E]of Object.entries(k)){if(E.length===0)continue;const C=g.get(w)??[];g.set(w,Array.from(new Set([...C,...E])))}const v=Array.from(new Set(d.flatMap(k=>Object.keys(k)))).map(k=>{const w=i==null?void 0:i[k];if(!w)return null;const E=g.get(k);return E?{...w,requiredScopes:E}:w}).filter(k=>!!k),j=u===0;return l.jsxs("div",{className:`flex flex-col gap-6 ${j?"min-h-full":""}`,id:`${s}-${r}-detail`,children:[l.jsxs("div",{className:"flex items-center gap-2",children:[n.deprecated&&l.jsx("span",{className:"inline-flex items-center px-2 py-0.5 rounded text-xs font-medium bg-amber-100 text-amber-800",children:"Deprecated"}),((b=n.externalDocs)==null?void 0:b.url)&&l.jsxs("a",{href:n.externalDocs.url,target:"_blank",rel:"noreferrer",title:n.externalDocs.description||n.externalDocs.url,className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-md text-xs font-medium bg-neutral-100 text-foreground-secondary border border-border hover:bg-neutral-200 transition-colors",children:["External Documentation",l.jsx(Ys,{className:"w-3.5 h-3.5"})]})]}),n.summary&&l.jsx("p",{className:"text-sm text-foreground-secondary",children:n.summary}),n.description&&l.jsx(wt,{children:n.description}),l.jsx(SS,{method:e,path:t,parameters:f,requestBody:n.requestBody,security:d,id:r}),d.length>0&&l.jsxs("div",{id:`${s}-${r}-security`,children:[l.jsx("p",{className:"text-xs font-medium text-foreground-muted uppercase tracking-wider mb-2",children:"Authorization"}),v.length>0&&l.jsx(Mr,{className:"mt-3",trigger:l.jsxs("span",{className:"flex items-center gap-2 text-xs font-normal text-foreground-muted",children:[l.jsx(ld,{className:"h-4 w-4 text-foreground-muted"}),l.jsx("span",{className:"bg-neutral-100 border border-border rounded-full px-2 py-0.5",children:v.length})]}),children:l.jsx("div",{className:"px-4 py-2 border-t border-border",children:l.jsx(Ia,{securities:v})})})]}),l.jsx(DS,{label:m,parameters:f,requestBodyContent:h,requestBodyDescription:(S=n.requestBody)==null?void 0:S.description,responses:p,callbacks:n.callbacks,id:r,depth:u,fillHeight:j,onFollowOperation:a,isOperationKnown:c})]})}function FS(e,t){const n=t.filter(r=>r.in==="query");return n.length===0?e:`${e}?${n.map(r=>`${r.name}={${r.name}}`).join("&")}`}function vu(e){var n;const t={};for(const r of e){const s=r.schema;t[r.name]={description:r.description,type:s==null?void 0:s.type,default:(s==null?void 0:s.default)!==void 0?String(s.default):void 0,enum:(n=s==null?void 0:s.enum)==null?void 0:n.map(String),examples:"example"in r&&r.example!==void 0?[String(r.example)]:void 0}}return t}function Ws({paths:e,security:t,securitySchemes:n,selectedKey:r=null,onSelectKey:s,showCopyMarkdown:o,columnLabel:i="Path",idPrefix:a="endpoint"}){var O;const c=T=>s==null?void 0:s(T),{document:u,deref:f}=Ve(),d=u,p=A.useMemo(()=>As(e),[e]),h=A.useMemo(()=>{var P,R,U;const T=new Map;for(const J of p){const Z=((U=(R=(P=e[J.path])==null?void 0:P[J.method])==null?void 0:R.tags)==null?void 0:U[0])||"Other",_=T.get(Z)??[];_.push(J),T.set(Z,_)}return Array.from(T,([J,Z])=>({label:J,items:Z}))},[p,e]),[m,g]=A.useState(()=>new Set),v=m.size===0;A.useEffect(()=>{if(!r)return;const T=h.find(({items:P})=>P.some(({key:R})=>R===r));T&&g(P=>{if(!P.has(T.label))return P;const R=new Set(P);return R.delete(T.label),R})},[h,r]);const j=A.useMemo(()=>{var P,R;const T=new Map;for(const{key:U,method:J,path:Z}of p){const _=(R=(P=e[Z])==null?void 0:P[J])==null?void 0:R.operationId;_&&T.set(_,U)}return T},[p,e]);if(p.length===0)return null;const y=r?p.find(T=>T.key===r):null,b=y?(O=e[y.path])==null?void 0:O[y.method]:null,S=({key:T,method:P,path:R},U)=>{var _;const J=r===T,Z=Cl(e[R],(_=e[R])==null?void 0:_[P]);return l.jsxs("tr",{id:`${a}-${T}`,onClick:()=>c(T),role:"button",tabIndex:U?0:-1,"aria-hidden":!U,"aria-label":`${P.toUpperCase()} ${R}`,"aria-current":J?"true":void 0,onKeyDown:M=>{M.key!=="Enter"&&M.key!==" "||(M.preventDefault(),c(T))},className:`group transition-[opacity,visibility] duration-300 ease-in-out ${U?`cursor-pointer opacity-100 visible ${J?"bg-neutral-50":""}`:"pointer-events-none invisible opacity-0"}`,children:[l.jsx("td",{className:`px-6 max-w-0 w-full group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${U?"py-2":"py-0"}`,children:l.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${U?"max-h-12":"max-h-0"}`,children:l.jsx(Xt,{address:R,parameters:vu(Z),truncate:!0,className:"text-xs"})})}),l.jsx("td",{className:`px-6 w-28 group-hover:bg-neutral-50 transition-[padding] duration-300 ease-in-out ${U?"py-2":"py-0"}`,children:l.jsx("div",{className:`overflow-hidden transition-[max-height] duration-300 ease-in-out ${U?"max-h-12":"max-h-0"}`,children:l.jsx(Qt,{method:P,className:"w-20"})})})]},T)},k=h.map(({label:T,items:P},R)=>{const U=!m.has(T),J=`${a}-group-${R}-${T.toLowerCase().replace(/[^a-z0-9]+/g,"-")}`;return l.jsxs(A.Fragment,{children:[l.jsx("tbody",{className:"border-y border-border first:border-t-0",children:l.jsx("tr",{className:"bg-neutral-50/70",children:l.jsx("th",{colSpan:2,scope:"rowgroup",className:"p-0 text-left",children:l.jsxs("button",{type:"button","aria-label":`${T} endpoints (${P.length})`,"aria-expanded":U,"aria-controls":J,onClick:()=>g(Z=>{const _=new Set(Z);return U?_.add(T):_.delete(T),_}),className:"group/header flex w-full items-center gap-3 px-6 py-3.5 text-left hover:bg-neutral-100/80 transition-colors",children:[l.jsx("span",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded-md border border-border bg-surface text-foreground-muted shadow-sm transition-colors group-hover/header:border-neutral-300 group-hover/header:text-foreground-secondary",children:U?l.jsx(Or,{className:"h-2.5 w-2.5"}):l.jsx(ud,{className:"h-2.5 w-2.5"})}),l.jsx("span",{className:"min-w-0 flex-1 truncate text-sm font-semibold tracking-wide text-foreground-secondary",children:T}),l.jsx("span",{className:"inline-flex min-w-6 items-center justify-center rounded-full bg-neutral-200/70 px-2 py-0.5 text-xs font-medium tabular-nums text-foreground-muted",children:P.length})]})})})}),l.jsx("tbody",{id:J,"aria-hidden":!U,className:`bg-surface ${U?"divide-y divide-border":""}`,children:P.map(Z=>S(Z,U))})]},T)}),w=Cl(y?e[y.path]:void 0,b),E=y?l.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[l.jsx(Qt,{method:y.method}),l.jsx("div",{className:"min-w-0 flex-1 overflow-hidden",children:l.jsx(Xt,{address:FS(y.path,w),parameters:vu(w),className:"text-xs"})})]}):r,C=l.jsxs("div",{children:[l.jsx("div",{className:"mb-3 flex justify-end",children:l.jsxs("label",{className:"flex cursor-pointer items-center gap-2 text-xs text-foreground-secondary",children:[l.jsx("input",{type:"checkbox",checked:v,onChange:T=>g(T.target.checked?new Set:new Set(h.map(({label:P})=>P))),onKeyDown:T=>{T.key==="Enter"&&(T.preventDefault(),g(v?new Set(h.map(({label:P})=>P)):new Set))},className:"h-3.5 w-3.5 cursor-pointer rounded border-border"}),l.jsx("span",{children:"Expand all"})]})}),l.jsx("div",{className:"bg-surface rounded-lg border border-border overflow-hidden",children:l.jsxs("table",{className:"w-full",children:[l.jsx("thead",{className:"bg-neutral-100 w-full",children:l.jsxs("tr",{children:[l.jsx("th",{className:"px-6 py-5 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:i}),l.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-foreground-muted uppercase tracking-wider",children:"Method"})]})}),k]})})]});return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex justify-center w-full",children:l.jsx(Gt,{content:C,stickySideContent:!1})}),l.jsx(md,{isOpen:!!y,side:"right",onClose:()=>c(null),title:E,headerActions:y&&b&&o?l.jsx(gd,{getMarkdown:()=>eg(d,y.method,y.path,f),label:"Copy endpoint for LLM"}):void 0,children:y&&b&&l.jsx(sp,{method:y.method,path:y.path,op:{...b,parameters:w},id:y.key,idPrefix:a,globalSecurity:t,securitySchemes:n,isOperationKnown:T=>j.has(T),onFollowOperation:T=>{const P=j.get(T);P&&c(P)}})})]})}const US=e=>e==="endpoints"||e==="webhooks"||e==="schemas";function HS({openapi:e,config:t}){var w,E,C,O;const n=t.show??{},r=e.webhooks??{},s=Object.keys(r).length>0,o=[...n.endpoints!==!1?[{id:"endpoints",name:"Endpoints",icon:Js}]:[],...s&&n.webhooks!==!1?[{id:"webhooks",name:"Webhooks",icon:sa}]:[],...n.schemas!==!1?[{id:"schemas",name:"Schemas",icon:na}]:[]],{query:i,setQuery:a,results:c}=ab(e,{threshold:.3,limit:20}),{effectiveTab:u,focusTab:f,navActiveSection:d,selected:p,setSelectedKey:h,selectedNavItem:m,handleSearchSelect:g,handleNavItemSelect:v,handleNavServerSelect:j,handleContentTabChange:y,schemaFocusTarget:b}=Vu({tabs:o,defaultTab:"endpoints",isTabKey:US,sections:[{id:"endpoints",visible:n.endpoints!==!1},{id:"webhooks",visible:s&&n.webhooks!==!1},{id:"schemas",visible:n.schemas!==!1},{id:"servers",visible:n.servers!==!1}],searchQuery:i}),S=(e.servers??[]).map(T=>T.url),k=u==="endpoints"?l.jsx(Ws,{paths:e.paths??{},security:e.security,securitySchemes:(w=e.components)==null?void 0:w.securitySchemes,selectedKey:p.endpoints,onSelectKey:T=>h("endpoints",T),showCopyMarkdown:n.copyMarkdown!==!1}):u==="webhooks"?l.jsx(Ws,{paths:r,security:e.security,securitySchemes:(E=e.components)==null?void 0:E.securitySchemes,selectedKey:p.webhooks,onSelectKey:T=>h("webhooks",T),columnLabel:"Webhook",idPrefix:"webhook",showCopyMarkdown:n.copyMarkdown!==!1}):u==="schemas"?l.jsx(no,{schemas:((C=e.components)==null?void 0:C.schemas)??{},selectedKey:p.schemas,focusTarget:b}):null;return l.jsx($a,{document:e,config:t,className:n.sidebar!==!1?"pt-14":"",children:l.jsxs("div",{className:"px-4",children:[n.search!==!1&&l.jsx(Pu,{query:i,onQueryChange:a,results:c,onSelectResult:g}),n.copyMarkdown!==!1&&l.jsx($u,{serialize:T=>Gm(e,T),leftOffset:n.search!==!1?60:12}),n.info!==!1&&l.jsx("div",{id:"info-panel",children:l.jsx(bd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs})}),n.servers!==!1&&S.length>0&&l.jsx("div",{id:p.servers??"server-0",children:l.jsx(vd,{servers:e.servers,selectedServer:p.servers,onSelectServer:T=>h("servers",T)})}),n.sidebar!==!1&&l.jsx(Oh,{paths:n.endpoints!==!1?e.paths:void 0,webhooks:s&&n.webhooks!==!1?r:void 0,schemas:n.schemas!==!1?(O=e.components)==null?void 0:O.schemas:void 0,servers:n.servers!==!1?S:void 0,hasInfo:n.info!==!1,activeTab:d,onTabChange:f,onItemSelect:v,onSelectServer:j,selectedItem:m}),l.jsx(ku,{tabs:o,current:u,onChange:y}),u&&l.jsx("div",{id:`panel-${u}`,role:"tabpanel","aria-labelledby":`tab-${u}`,children:k})]})})}const za=e=>l.jsx(Qi,{fallback:e.errorFallback,onError:e.onError,children:l.jsx(qS,{...e})}),qS=e=>{const t=e.openapi,n=A.useMemo(()=>Tr(t),[t]),r=e.kind;A.useEffect(()=>{r==="resolved"&&n!==t&&Xi(t)&&console.warn('[apiuikit] <OpenAPI kind="resolved"> received a document that still contains $ref nodes. They were resolved anyway; fix the upstream resolution or drop the kind prop.')},[r,t,n]);const s=e.config??zn;return l.jsx(HS,{openapi:n,config:s})};function op(e,t,n){e.registerSchemaParser(t);const r=e.parserRegistry,s=r.get.bind(r);r.get=o=>{const i=s(o);return i!==void 0?i:n(o)?t:void 0}}const zS=["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 WS(){return{validate:KS,parse:JS,getMimeTypes:()=>zS}}function VS(e){op(e,WS(),Nr)}function KS(e){return pa(e.data).map(t=>({message:t,path:e.path}))}function JS(e){var n,r;const t=pa(e.data);if(t.length>0)return{[Cs]:t[0]};try{const s=Ei(e.data),o=e.meta.message,i=(r=(n=o==null?void 0:o.bindings)==null?void 0:n.kafka)==null?void 0:r.key;return i&&o&&(o["x-parser-original-bindings-kafka-key"]=i,o.bindings.kafka.key=Ei(i)),s}catch(s){return{[Cs]:s instanceof Error?s.message:"Failed to convert Avro schema"}}}async function YS(){try{const e=await Promise.resolve().then(()=>require("./index-EeGvEXPN.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 ip(e){try{const t=await YS(),n=new t;VS(n);const{registerProtobufSchemaParser:r}=await Promise.resolve().then(()=>require("./protobufSchemaParser-7sU6XBEb.cjs"));r(n);const{document:s,diagnostics:o}=await n.parse(e);return{diagnostics:o,document:s?XS(s):null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function ZS(e,t){const{diagnostics:n,document:r}=await ip(e);return{diagnostics:n,view:r?l.jsx(Pa,{kind:"resolved",asyncapi:r,config:t}):null}}function XS(e){return e.json()}function QS({raw:e,config:t,onDiagnostics:n,errorFallback:r,onError:s}){const[o,i]=A.useState(null),a=A.useRef(n);return a.current=n,A.useEffect(()=>{let c=!0;return ip(e).then(({document:u,diagnostics:f})=>{var d;c&&(i(u),(d=a.current)==null||d.call(a,f))}),()=>{c=!1}},[e]),o?l.jsx(Pa,{kind:"resolved",asyncapi:o,config:t,errorFallback:r,onError:s}):null}async function GS(){try{return await Promise.resolve().then(()=>require("./index-B5IBIM-V.cjs"))}catch(e){throw console.error("[apiuikit] Failed to load '@scalar/openapi-parser':",e),new Error("[apiuikit] The parsed entry requires '@scalar/openapi-parser'. Install it (`npm i @scalar/openapi-parser`), or use the `OpenAPI` component with a pre-resolved document instead.")}}const ui=(e,t)=>({message:e.message,path:Array.isArray(e.path)?e.path:[],severity:t});async function ap(e){try{const{validate:t,dereference:n}=await GS(),r=await t(e);if(!r.valid)return{diagnostics:r.errors.map(a=>ui(a,0)),document:null};const s=(r.errors??[]).map(a=>ui(a,1)),{schema:o,errors:i}=n(e);return i!=null&&i.length&&s.push(...i.map(a=>ui(a,0))),{diagnostics:s,document:o??null}}catch(t){return{diagnostics:[{message:t instanceof Error?t.message:"Failed to parse document",path:[],severity:0}],document:null}}}async function ej(e,t){const{diagnostics:n,document:r}=await ap(e);return{diagnostics:n,view:r?l.jsx(za,{kind:"resolved",openapi:r,config:t}):null}}function tj({raw:e,config:t,onDiagnostics:n,errorFallback:r,onError:s}){const[o,i]=A.useState(null),a=A.useRef(n);return a.current=n,A.useEffect(()=>{let c=!0;return ap(e).then(({document:u,diagnostics:f})=>{var d;c&&(i(u),(d=a.current)==null||d.call(a,f))}),()=>{c=!1}},[e]),o?l.jsx(za,{kind:"resolved",openapi:o,config:t,errorFallback:r,onError:s}):null}function lp(e,t,n){return function({document:s,config:o,children:i}){const a=A.useContext(Vs),c=A.useMemo(()=>s?Tr(s):null,[s]),u=!!a&&a.specType!==n;if(A.useEffect(()=>{u&&console.warn(`[apiuikit] A ${t} section is rendered inside a ${a.specType} document provider, which cannot supply the document it needs. `+(c?"Using the section's own `document` prop instead.":`Wrap it in <${t}Provider> or pass it a \`document\` prop.`))},[a,u,c]),a&&!u)return l.jsx(l.Fragment,{children:i});if(!c){if(a)return l.jsx(l.Fragment,{children:i});throw new Error(`This ${t} section needs a \`document\` prop unless it is rendered inside <${t}Provider>.`)}return l.jsx(e,{document:c,config:o,children:i})}}function nj({document:e,config:t,children:n}){const r=A.useMemo(()=>Tr(e),[e]);return l.jsx(ea,{document:r,config:t,children:n})}const Fr=lp(ea,"AsyncAPI","asyncapi");function Ur(){const e=Ve();return e.specType==="asyncapi",e.document}function rj(){const e=Ur();return!e.servers||Object.keys(e.servers).length===0?null:l.jsx(hd,{servers:e.servers})}function sj(e){return l.jsx(Fr,{...e,children:l.jsx(rj,{})})}function oj(){const e=Ur(),[t,n]=A.useState(null);return l.jsx(xd,{operations:e.operations??{},selectedKey:t,onSelectKey:n})}function ij(e){return l.jsx(Fr,{...e,children:l.jsx(oj,{})})}function aj(){var t;const e=Ur();return l.jsx(id,{messages:((t=e.components)==null?void 0:t.messages)??{}})}function lj(e){return l.jsx(Fr,{...e,children:l.jsx(aj,{})})}function cj(){var t;const e=Ur();return l.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function uj(e){return l.jsx(Fr,{...e,children:l.jsx(cj,{})})}function fj(){const e=Ur();return e.info?l.jsx(If,{...e.info}):null}function dj(e){return l.jsx(Fr,{...e,children:l.jsx(fj,{})})}function pj({document:e,config:t,children:n}){const r=A.useMemo(()=>Tr(e),[e]);return l.jsx($a,{document:r,config:t,children:n})}const Hr=lp($a,"OpenAPI","openapi");function qr(){const e=Gi();return e.specType==="openapi",e.document}function hj(){const e=qr();return!e.servers||e.servers.length===0?null:l.jsx(vd,{servers:e.servers})}function mj(e){return l.jsx(Hr,{...e,children:l.jsx(hj,{})})}function gj(){var r;const e=qr(),[t,n]=A.useState(null);return l.jsx(Ws,{paths:e.paths??{},security:e.security,securitySchemes:(r=e.components)==null?void 0:r.securitySchemes,selectedKey:t,onSelectKey:n})}function yj(e){return l.jsx(Hr,{...e,children:l.jsx(gj,{})})}function xj(){var s;const e=qr(),[t,n]=A.useState(null),r=e.webhooks??{};return Object.keys(r).length===0?null:l.jsx(Ws,{paths:r,security:e.security,securitySchemes:(s=e.components)==null?void 0:s.securitySchemes,selectedKey:t,onSelectKey:n,columnLabel:"Webhook",idPrefix:"webhook"})}function bj(e){return l.jsx(Hr,{...e,children:l.jsx(xj,{})})}function vj(){var t;const e=qr();return l.jsx(no,{schemas:((t=e.components)==null?void 0:t.schemas)??{}})}function wj(e){return l.jsx(Hr,{...e,children:l.jsx(vj,{})})}function Sj(){const e=qr();return e.info?l.jsx(bd,{info:e.info,tags:e.tags,externalDocs:e.externalDocs}):null}function jj(e){return l.jsx(Hr,{...e,children:l.jsx(Sj,{})})}exports.AsyncAPI=Pa;exports.AsyncAPIProvider=nj;exports.AsyncAPIRenderer=QS;exports.ErrorBoundary=Qi;exports.Info=dj;exports.Messages=lj;exports.OpenAPI=za;exports.OpenAPIEndpoints=yj;exports.OpenAPIInfo=jj;exports.OpenAPIProvider=pj;exports.OpenAPIRenderer=tj;exports.OpenAPISchemas=wj;exports.OpenAPIServers=mj;exports.OpenAPIWebhooks=bj;exports.Operations=ij;exports.SchemaTabs=yn;exports.SchemaTree=Ra;exports.Schemas=uj;exports.Servers=sj;exports.X_LIB_CONVERSION_ERROR=Cs;exports.commonjsGlobal=wr;exports.defaultConfig=zn;exports.getDefaultExportFromCjs=Zs;exports.isProtobufSchemaFormat=Cr;exports.parseAndRender=ZS;exports.parseAndRender$1=ej;exports.registerSchemaParserWithFallback=op;exports.require$$0=kd;exports.useAsyncAPIDocument=Ve;
|