File size: 32,965 Bytes
6e08da8
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{33471:function(){},93038:function(e,t,a){Promise.resolve().then(a.bind(a,90530))},90530:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return eB}});var s=a(57437),r=a(2265),n=a(16463),l=a(76780),o=a(12218),i=a(44839),d=a(96164),c=a(2882),m=a.n(c);function u(){for(var e=arguments.length,t=Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,d.m6)((0,i.W)(t))}async function f(e){try{return await m().dereference(e,{dereference:{circular:"ignore"}})}catch(e){throw Error("Failed to fetch or parse API specification")}}function x(e){let t=[];for(let[a,s]of Object.entries(e.paths))for(let[e,r]of Object.entries(s))"parameters"!==e&&t.push({path:a,method:e.toUpperCase(),operation:r});return t}function p(e){return e.schema?"type"in e.schema?"enum"in e.schema?"enum":e.schema.type||"string":"reference":"string"}function h(e){switch(e.type){case"object":return function(e){let t={};if(e.properties)for(let[a,s]of Object.entries(e.properties))t[a]=h(s);return t}(e);case"array":return"array"===e.type&&e.items?[h(e.items)]:[];case"string":return e.example||e.default||"string";case"number":case"integer":return e.example||e.default||0;case"boolean":return e.example||e.default||!1;default:return e.example||e.default||null}}let g=(0,o.j)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),b=r.forwardRef((e,t)=>{let{className:a,variant:r,...n}=e;return(0,s.jsx)("div",{ref:t,role:"alert",className:u(g({variant:r}),a),...n})});b.displayName="Alert";let j=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("h5",{ref:t,className:u("mb-1 font-medium leading-none tracking-tight",a),...r})});j.displayName="AlertTitle";let v=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:u("text-sm [&_p]:leading-relaxed",a),...r})});v.displayName="AlertDescription";let y=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:u("rounded-xl border bg-card text-card-foreground shadow",a),...r})});y.displayName="Card";let N=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:u("flex flex-col space-y-1.5 p-6",a),...r})});N.displayName="CardHeader",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("h3",{ref:t,className:u("font-semibold leading-none tracking-tight",a),...r})}).displayName="CardTitle",r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("p",{ref:t,className:u("text-sm text-muted-foreground",a),...r})}).displayName="CardDescription";let w=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:u("p-6 pt-0",a),...r})});w.displayName="CardContent";let k=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:u("flex items-center p-6 pt-0",a),...r})});k.displayName="CardFooter";var C=a(71538);let R=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),S=r.forwardRef((e,t)=>{let{className:a,variant:r,size:n,asChild:l=!1,...o}=e,i=l?C.g7:"button";return(0,s.jsx)(i,{className:u(R({variant:r,size:n,className:a})),ref:t,...o})});S.displayName="Button";let z=r.forwardRef((e,t)=>{let{className:a,type:r,...n}=e;return(0,s.jsx)("input",{type:r,className:u("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...n})});z.displayName="Input";var Z=a(4867),E=a(48297);let T=E.fC;E.ZA;let _=E.B4,O=r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(E.xz,{ref:t,className:u("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...n,children:[r,(0,s.jsx)(E.JO,{asChild:!0,children:(0,s.jsx)(Z.jnn,{className:"h-4 w-4 opacity-50"})})]})});O.displayName=E.xz.displayName;let q=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(E.u_,{ref:t,className:u("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(Z.g8U,{})})});q.displayName=E.u_.displayName;let V=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(E.$G,{ref:t,className:u("flex cursor-default items-center justify-center py-1",a),...r,children:(0,s.jsx)(Z.v4q,{})})});V.displayName=E.$G.displayName;let A=r.forwardRef((e,t)=>{let{className:a,children:r,position:n="popper",...l}=e;return(0,s.jsx)(E.h_,{children:(0,s.jsxs)(E.VY,{ref:t,className:u("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...l,children:[(0,s.jsx)(q,{}),(0,s.jsx)(E.l_,{className:u("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),(0,s.jsx)(V,{})]})})});A.displayName=E.VY.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(E.__,{ref:t,className:u("px-2 py-1.5 text-sm font-semibold",a),...r})}).displayName=E.__.displayName;let B=r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(E.ck,{ref:t,className:u("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,s.jsx)("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(E.wU,{children:(0,s.jsx)(Z.nQG,{className:"h-4 w-4"})})}),(0,s.jsx)(E.eT,{children:r})]})});B.displayName=E.ck.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(E.Z0,{ref:t,className:u("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=E.Z0.displayName;var D=a(14392),U=a(42421),P=a(30690),Y=a(27071);let L=Y.zt,F=Y.fC,H=Y.xz,M=r.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,...n}=e;return(0,s.jsx)(Y.VY,{ref:t,sideOffset:r,className:u("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...n})});function G(e){let{parameters:t,onParamChange:a,queryParams:r,isExpanded:n,onToggleExpand:l}=e;return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("button",{onClick:l,className:"w-full p-4 rounded-lg flex justify-between items-center hover:bg-accent transition-colors duration-200 border border-border",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Query Parameters"}),n?(0,s.jsx)(D.Z,{className:"h-5 w-5"}):(0,s.jsx)(U.Z,{className:"h-5 w-5"})]}),n&&(0,s.jsx)("div",{className:"p-4 border border-border rounded-lg space-y-4",children:t.filter(e=>"query"===e.in).map((e,t)=>{var n;return(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-sm font-medium flex items-center",children:[e.name,e.required&&(0,s.jsx)("span",{className:"text-red-500 dark:text-red-400 ml-1 leading-none",children:"*"})]}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:p(e)})]}),(0,s.jsxs)("div",{className:"relative",children:["enum"===p(e)&&(n=e.schema)&&"enum"in n&&Array.isArray(n.enum)?(0,s.jsxs)(T,{onValueChange:t=>a(e.name,t),value:r[e.name]||"",children:[(0,s.jsx)(O,{className:"w-full",children:(0,s.jsx)(_,{placeholder:"Select ".concat(e.name)})}),(0,s.jsx)(A,{children:e.schema.enum.map(e=>(0,s.jsx)(B,{value:e,children:e},e))})]}):(0,s.jsx)(z,{placeholder:"Enter ".concat(e.name),className:"w-full pr-10",value:r[e.name]||"",onChange:t=>a(e.name,t.target.value)}),(0,s.jsx)(L,{children:(0,s.jsxs)(F,{children:[(0,s.jsx)(H,{className:"absolute right-3 top-1/2 transform -translate-y-1/2",children:(0,s.jsx)(P.Z,{className:"h-4 w-4 text-muted-foreground hover:text-foreground transition-colors duration-200"})}),(0,s.jsx)(M,{side:"left",className:"max-w-xs",children:(0,s.jsxs)("div",{className:"text-sm space-y-1",children:[(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Type:"})," ",p(e)]}),e.description&&(0,s.jsxs)("p",{children:[(0,s.jsx)("strong",{children:"Description:"})," ",e.description]})]})})]})})]})]},t)})})]})}M.displayName=Y.VY.displayName;var J=a(23787),I=a(22468),Q=a(6884),X=a(3274),$=a(98094),K=a(48484);let W=r.forwardRef((e,t)=>{let{className:a,orientation:r="horizontal",decorative:n=!0,...l}=e;return(0,s.jsx)(K.f,{ref:t,decorative:n,orientation:r,className:u("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",a),...l})});W.displayName=K.f.displayName;let ee=(0,o.j)("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function et(e){let{className:t,variant:a,...r}=e;return(0,s.jsx)("div",{className:u(ee({variant:a}),t),...r})}var ea=a(44025),es=a(87347),er=a(40933);function en(e){let{statusCode:t,contentType:a,responseBody:n,duration:l,path:o,method:i}=e,[d,c]=(0,r.useState)(!1),m=JSON.stringify(n,null,2),u=t<400,f=l<1e3?"".concat(l.toFixed(2),"ms"):"".concat((l/1e3).toFixed(2),"s");return(0,s.jsxs)(y,{children:[(0,s.jsx)(N,{className:"py-2",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(et,{className:"".concat(u?"bg-green-500":"bg-red-500"," font-semibold"),children:t}),(0,s.jsx)(et,{variant:"outline",className:"font-medium",children:i.toUpperCase()}),(0,s.jsx)("span",{className:"text-sm font-mono",children:o})]}),(0,s.jsx)(S,{variant:"ghost",size:"sm",onClick:function(){navigator.clipboard.writeText(m),c(!0),setTimeout(()=>c(!1),2e3)},children:d?(0,s.jsx)(I.Z,{className:"h-4 w-4 text-green-600 dark:text-green-400"}):(0,s.jsx)(Q.Z,{className:"h-4 w-4"})})]})}),(0,s.jsx)(w,{className:"p-0",children:(0,s.jsx)("div",{className:"overflow-hidden",children:(0,s.jsx)(ea.Z,{language:"json",style:es.Z,customStyle:{maxHeight:"32rem",overflowY:"auto",margin:0,padding:"1.5rem",borderRadius:"0",fontSize:"0.75rem",lineHeight:"1.5"},children:m})})}),(0,s.jsxs)(k,{className:"py-2 px-4 flex justify-between items-center",children:[(0,s.jsx)(et,{variant:"secondary",className:"font-medium text-xs",children:a}),(0,s.jsxs)("div",{className:"flex items-center space-x-1",children:[(0,s.jsx)(er.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"text-xs",children:f})]})]})]})}var el=a(11838),eo=a.n(el);function ei(e){var t;let{responses:a,endpointKey:n,path:l}=e,o=(0,r.useMemo)(()=>Object.entries(a).sort((e,t)=>{let[a]=e,[s]=t;return"200"===a?-1:"200"===s?1:a.localeCompare(s)}),[a]),[i,d]=(0,r.useState)((null===(t=o[0])||void 0===t?void 0:t[0])||""),[c,m]=(0,r.useState)(""),[u,f]=(0,r.useState)([]),[x,p]=(0,r.useState)("");(0,r.useEffect)(()=>{var e;d((null===(e=o[0])||void 0===e?void 0:e[0])||""),m(""),f([]),p("")},[n,o]),(0,r.useEffect)(()=>{let e=a[i];if(!ed(e)||!e.content){m("");return}let t=Object.keys(e.content)[0],s=e.content[t];if(s.examples){let e=Object.keys(s.examples);f(e),p(e[0])}else s.example?m(JSON.stringify(s.example,null,2)):s.schema?m(JSON.stringify(h(s.schema),null,2)):m("No example or schema available")},[i,a]),(0,r.useEffect)(()=>{let e=a[i];if(!ed(e)||!e.content){m("");return}let t=Object.keys(e.content)[0],s=e.content[t];if(s.examples){let e=s.examples[x];void 0!==e&&void 0!==e.value?m(JSON.stringify(e.value,null,2)):m("No example available")}},[x,i,a]);let g=(0,r.useMemo)(()=>{let e=a[i];return ed(e)?ec(e.description):ec("No description available")},[a,i]);if(!c)return null;function b(e,t,a,r){var n;return(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)(T,{value:t,onValueChange:a,children:[(0,s.jsx)(O,{id:e.toLowerCase(),className:"w-full text-xs h-8",children:(0,s.jsx)(_,{placeholder:"Select ".concat(e.toLowerCase()),children:(0,s.jsx)("span",{className:"truncate block max-w-[100px]",children:(null===(n=r.find(e=>e.value===t))||void 0===n?void 0:n.label)||"Select ".concat(e.toLowerCase())})})}),(0,s.jsx)(A,{children:r.map(e=>{let{value:t,label:a}=e;return(0,s.jsx)(B,{value:t,className:"text-xs",children:(0,s.jsx)("span",{className:"block truncate",children:a})},t)})})]})})}return(0,s.jsxs)(y,{children:[(0,s.jsx)(N,{className:"py-2",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(et,{className:"".concat(400>parseInt(i)?"bg-green-500":500>parseInt(i)?"bg-orange-500":"bg-red-500"," font-semibold"),children:i}),(0,s.jsx)("span",{className:"text-sm font-mono",children:l})]}),(0,s.jsxs)("div",{className:"flex space-x-2",children:[b("Status Code",i,d,o.map(e=>{let[t]=e;return{value:t,label:t}})),u.length>0&&b("Example Name",x,p,u.map(e=>({value:e,label:e})))]})]})}),(0,s.jsx)(w,{className:"p-0",children:(0,s.jsx)(ea.Z,{language:"json",style:es.Z,customStyle:{maxHeight:"32rem",overflowY:"auto",margin:0,padding:"1.5rem",borderRadius:"0",fontSize:"0.75rem",lineHeight:"1.5"},children:c})}),(0,s.jsx)(k,{className:"py-2 px-4",children:(0,s.jsx)("div",{className:"text-xs prose prose-sm dark:prose-invert max-w-none",dangerouslySetInnerHTML:g})})]})}function ed(e){return void 0!==e&&void 0!==e.description}function ec(e){return{__html:eo().sanitize(e,{ADD_ATTR:["target"]})}}function em(e){let{exampleRequest:t}=e,[a,n]=(0,r.useState)(!1);return(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("button",{onClick:()=>n(!a),className:"w-full p-4 rounded-lg flex justify-between items-center hover:bg-accent transition-colors duration-200 border border-border",children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:"Request Body"}),a?(0,s.jsx)(D.Z,{className:"h-5 w-5"}):(0,s.jsx)(U.Z,{className:"h-5 w-5"})]}),a&&t&&(0,s.jsx)("div",{className:"p-2 rounded-lg space-y-4",children:(0,s.jsx)(ea.Z,{language:"json",style:es.Z,customStyle:{maxHeight:"32rem",overflowY:"auto",margin:0,padding:"1rem",borderRadius:"0.5rem",fontSize:"0.75rem",lineHeight:"1.5"},children:t})})]})}var eu=a(27776),ef=a(87138);function ex(e){let{endpoint:t,baseUrl:a}=e,{path:n,method:l,operation:o}=t,[i,d]=(0,r.useState)(!1),[c,m]=(0,r.useState)({}),[u,f]=(0,r.useState)(!1),[x,g]=(0,r.useState)(null),[b,j]=(0,r.useState)(!1),v="GET"===l,k=(0,r.useMemo)(()=>{var e;return(null===(e=o.parameters)||void 0===e?void 0:e.filter(e=>"in"in e&&"query"===e.in))||[]},[o.parameters]),C=k.length>0;function R(e){return!!e&&"content"in e}console.log(t);let z=(0,r.useMemo)(()=>{if(!R(o.requestBody))return!1;let e=o.requestBody.content["application/json"];return!!e&&"schema"in e},[o.requestBody]),Z=(0,r.useMemo)(()=>"".concat(l,"-").concat(n),[l,n]),E=(0,r.useMemo)(()=>{var e;if(!z||!R(o.requestBody))return null;let t=null===(e=o.requestBody.content["application/json"])||void 0===e?void 0:e.schema;return t&&"type"in t?JSON.stringify(h(t),null,2):null},[o.requestBody,z]);(0,r.useEffect)(()=>{d(!1),m({}),f(!1),g(null)},[t]);let T=(0,r.useCallback)(()=>{let e="".concat(a).concat(n);navigator.clipboard.writeText(e),d(!0),setTimeout(()=>d(!1),2e3)},[a,n]),_=(0,r.useCallback)(async()=>{j(!0);let e=new URL("".concat(a).concat(n));for(let[t,a]of Object.entries(c))a&&e.searchParams.append(t,a);let t=performance.now();try{let a=await fetch(e.toString(),{method:l,headers:{"Content-Type":"application/json"}}),s=a.headers.get("Content-Type")||"application/json",r=s.includes("application/json")?await a.json():await a.text();g({statusCode:a.status,contentType:s,responseBody:r,duration:performance.now()-t})}catch(e){console.error("Error:",e),g({statusCode:500,contentType:"application/json",responseBody:{error:"An error occurred while fetching the data"},duration:performance.now()-t}),eu.Am.error("Request failed")}finally{j(!1)}},[a,l,n,c]),O=(0,r.useCallback)((e,t)=>{m(a=>({...a,[e]:t}))},[]),q=(0,r.useCallback)(()=>f(e=>!e),[]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eu.x7,{}),(0,s.jsxs)("div",{className:"w-full max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"max-w-xl",children:[(0,s.jsx)("h1",{className:"text-2xl sm:text-3xl tracking-tight font-extrabold mb-4 text-foreground break-words",children:o.summary}),(0,s.jsxs)("p",{className:"mb-6 text-base sm:text-md mt-2 text-foreground/80",children:[o.description,o.externalDocs&&(0,s.jsx)(ef.default,{href:o.externalDocs.url,target:"_blank",rel:"noopener noreferrer",className:"ml-2 inline-flex items-center",children:(0,s.jsxs)(et,{variant:"secondary",className:"gap-1 font-thin",children:[(0,s.jsx)(J.Z,{className:"h-3 w-3"}),"Docs"]})})]})]}),(0,s.jsxs)("div",{className:"flex flex-col lg:flex-row gap-8",children:[(0,s.jsxs)("div",{className:"w-full lg:w-[55%]",children:[(0,s.jsxs)(y,{className:"border-border shadow-sm bg-card text-card-foreground",children:[(0,s.jsx)(N,{children:(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 w-full outline outline-1 outline-border rounded-md p-2",children:[(0,s.jsx)("span",{className:"px-3 py-1 text-sm font-bold rounded-md ".concat(v?"bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400":"bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100"),children:l}),(0,s.jsxs)("div",{className:"flex-grow flex items-center gap-2 min-w-0",children:[(0,s.jsx)("button",{className:"text-base font-mono flex-grow text-left hover:underline focus:outline-none truncate text-foreground",onClick:T,children:n}),i?(0,s.jsx)(I.Z,{className:"h-5 w-5 flex-shrink-0 text-green-600 dark:text-green-400"}):(0,s.jsx)(Q.Z,{className:"h-5 w-5 flex-shrink-0 text-muted-foreground hover:text-foreground cursor-pointer",onClick:T}),!!a&&(0,s.jsx)(S,{variant:"outline",size:"icon",className:"flex-shrink-0 bg-green-400/20 text-green-700 dark:bg-green-400/20 dark:text-green-400 hover:bg-green-400/30 dark:hover:bg-green-400/30",onClick:_,disabled:b,children:b?(0,s.jsx)(X.Z,{className:"h-4 w-4 animate-spin"}):(0,s.jsx)($.Z,{className:"h-4 w-4"})})]})]})}),C&&(0,s.jsx)(w,{className:"mt-4",children:(0,s.jsx)(G,{parameters:k,onParamChange:O,queryParams:c,isExpanded:u,onToggleExpand:q})}),z&&(0,s.jsx)(w,{className:"mt-4",children:(0,s.jsx)(em,{exampleRequest:E})})]}),x&&(0,s.jsx)("div",{className:"mt-8",children:(0,s.jsx)(en,{statusCode:x.statusCode,contentType:x.contentType,responseBody:x.responseBody,duration:x.duration,path:n,method:l})}),C&&(0,s.jsxs)("div",{className:"mt-16",children:[(0,s.jsx)("h2",{className:"text-lg font-bold mb-2 text-foreground",children:"Query Parameters"}),(0,s.jsx)(W,{className:"my-4"}),k.map((e,t)=>(0,s.jsxs)("div",{className:"mb-8",children:[(0,s.jsxs)("div",{className:"flex items-center gap-6 mb-1",children:[(0,s.jsx)("span",{className:"font-semibold text-sm text-orange-600 dark:text-orange-400",children:e.name}),(0,s.jsx)(et,{variant:"secondary",children:p(e)}),e.required&&(0,s.jsx)(et,{variant:"destructive",className:"text-xs",children:"required"})]}),(0,s.jsx)("p",{className:"text-sm mt-4 text-muted-foreground",children:e.description})]},t))]})]}),(0,s.jsx)("div",{className:"w-full lg:w-[45%]",children:(0,s.jsx)(ei,{path:n,responses:o.responses,endpointKey:Z})})]})]})]})}var ep=a(9646);let eh=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(ep.fC,{className:u("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...r,ref:t,children:(0,s.jsx)(ep.bU,{className:u("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})});function eg(e){let{endpoints:t,selectedEndpoint:a,onSelectEndpoint:n,className:l=""}=e,[o,i]=(0,r.useState)(!1);return(0,s.jsxs)("nav",{className:"flex h-full flex-col ".concat(l),children:[(0,s.jsxs)("ul",{className:"flex-grow space-y-1 overflow-y-auto",children:[(0,s.jsx)("li",{children:(0,s.jsx)("h2",{className:"font-bold text-lg mb-2 px-2 dark:text-gray-200",children:"Endpoints"})}),t.map(e=>{let{path:t,method:r,operation:l}=e;return(0,s.jsx)("li",{children:(0,s.jsx)(ef.default,{href:"#".concat(r,"-").concat(t),className:"block p-2 hover:bg-gray-100 dark:hover:bg-green-900/20 rounded-xl transition-all duration-200 group hover:scale-[1.02] ".concat(a&&a.path===t&&a.method===r?"bg-gray-100 dark:bg-green-900/20":""),onClick:()=>n({path:t,method:r,operation:l}),title:o&&l.summary||t,children:(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(eb,{method:r}),(0,s.jsx)("span",{className:"text-sm font-medium",children:o&&l.summary||t})]})})},"".concat(r,"-").concat(t))})]}),(0,s.jsxs)("div",{className:"flex mt-4 items-center justify-between p-2 border-t dark:border-gray-700",children:[(0,s.jsx)("span",{className:"text-xs",children:"Show Summaries"}),(0,s.jsx)(eh,{checked:o,onCheckedChange:i})]})]})}function eb(e){let{method:t}=e,a={GET:"bg-green-200 text-green-800 dark:bg-green-800 dark:text-green-200 hover:bg-green-300 dark:hover:bg-green-700",POST:"bg-blue-200 text-blue-800 dark:bg-blue-800 dark:text-blue-200 hover:bg-blue-300 dark:hover:bg-blue-700",PUT:"bg-yellow-200 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-200 hover:bg-yellow-300 dark:hover:bg-yellow-700",DELETE:"bg-red-200 text-red-800 dark:bg-red-800 dark:text-red-200 hover:bg-red-300 dark:hover:bg-red-700"}[t]||"bg-gray-200 text-gray-800 dark:bg-gray-700 dark:text-gray-200 hover:bg-gray-300 dark:hover:bg-gray-600";return(0,s.jsx)(et,{className:"px-2 py-1 text-xs font-semibold ".concat(a),children:t})}eh.displayName=ep.fC.displayName;var ej=a(38296),ev=a(92699),ey=a(79512),eN=a(21220);let ew=eN.fC,ek=eN.xz;eN.ZA,eN.Uv,eN.Tr,eN.Ee,r.forwardRef((e,t)=>{let{className:a,inset:r,children:n,...l}=e;return(0,s.jsxs)(eN.fF,{ref:t,className:u("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",r&&"pl-8",a),...l,children:[n,(0,s.jsx)(Z.XCv,{className:"ml-auto h-4 w-4"})]})}).displayName=eN.fF.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(eN.tu,{ref:t,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...r})}).displayName=eN.tu.displayName;let eC=r.forwardRef((e,t)=>{let{className:a,sideOffset:r=4,...n}=e;return(0,s.jsx)(eN.Uv,{children:(0,s.jsx)(eN.VY,{ref:t,sideOffset:r,className:u("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md","data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a),...n})})});eC.displayName=eN.VY.displayName;let eR=r.forwardRef((e,t)=>{let{className:a,inset:r,...n}=e;return(0,s.jsx)(eN.ck,{ref:t,className:u("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r&&"pl-8",a),...n})});function eS(){let{setTheme:e}=(0,ey.F)();return(0,s.jsxs)(ew,{children:[(0,s.jsx)(ek,{asChild:!0,children:(0,s.jsxs)(S,{variant:"outline",size:"icon",children:[(0,s.jsx)(ej.Z,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,s.jsx)(ev.Z,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,s.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,s.jsxs)(eC,{align:"end",children:[(0,s.jsx)(eR,{onClick:()=>e("light"),children:"Light"}),(0,s.jsx)(eR,{onClick:()=>e("dark"),children:"Dark"}),(0,s.jsx)(eR,{onClick:()=>e("system"),children:"System"})]})]})}eR.displayName=eN.ck.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,checked:n,...l}=e;return(0,s.jsxs)(eN.oC,{ref:t,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),checked:n,...l,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(eN.wU,{children:(0,s.jsx)(Z.nQG,{className:"h-4 w-4"})})}),r]})}).displayName=eN.oC.displayName,r.forwardRef((e,t)=>{let{className:a,children:r,...n}=e;return(0,s.jsxs)(eN.Rk,{ref:t,className:u("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(eN.wU,{children:(0,s.jsx)(Z.jXb,{className:"h-4 w-4 fill-current"})})}),r]})}).displayName=eN.Rk.displayName,r.forwardRef((e,t)=>{let{className:a,inset:r,...n}=e;return(0,s.jsx)(eN.__,{ref:t,className:u("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",a),...n})}).displayName=eN.__.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(eN.Z0,{ref:t,className:u("-mx-1 my-1 h-px bg-muted",a),...r})}).displayName=eN.Z0.displayName;var ez=a(42873),eZ=a(13304);let eE=eZ.fC,eT=eZ.xz;eZ.x8;let e_=eZ.h_,eO=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(eZ.aV,{className:u("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r,ref:t})});eO.displayName=eZ.aV.displayName;let eq=(0,o.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),eV=r.forwardRef((e,t)=>{let{side:a="right",className:r,children:n,...l}=e;return(0,s.jsxs)(e_,{children:[(0,s.jsx)(eO,{}),(0,s.jsxs)(eZ.VY,{ref:t,className:u(eq({side:a}),r),...l,children:[(0,s.jsxs)(eZ.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(Z.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]}),n]})]})});function eA(){var e,t;let a=(0,n.useSearchParams)(),[l,o]=(0,r.useState)(null),[i,d]=(0,r.useState)(!0),[c,m]=(0,r.useState)(null),[u,p]=(0,r.useState)(null),[h,g]=(0,r.useState)(!1);if((0,r.useEffect)(()=>{(async function(){try{let e=a.get("url")||"https://raw.githubusercontent.com/huggingface/dataset-viewer/main/docs/source/openapi.json",t=await f(e);o(t);let s=x(t),r=window.location.hash.slice(1),n=r?s.find(e=>"".concat(e.method,"-").concat(e.path)===r):s[0];p(n||null)}catch(e){m(e instanceof Error?e.message:"An error occurred")}finally{d(!1)}})()},[a]),(0,r.useEffect)(()=>{u&&window.history.pushState(null,"","#".concat(u.method,"-").concat(u.path))},[u]),i)return(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:"Loading..."});if(c)return(0,s.jsx)(eD,{message:c});let b=l?x(l):[],j=(null==l?void 0:null===(t=l.servers)||void 0===t?void 0:null===(e=t[0])||void 0===e?void 0:e.url)||"";return(0,s.jsxs)("div",{className:"relative min-h-screen bg-background text-foreground",children:[(0,s.jsxs)("header",{className:"fixed top-0 left-0 right-0 z-10 flex justify-between items-center p-4 bg-background/80 backdrop-blur-sm",children:[(0,s.jsx)("div",{className:"flex items-center",children:(0,s.jsxs)(eE,{open:h,onOpenChange:g,children:[(0,s.jsx)(eT,{asChild:!0,children:(0,s.jsx)(S,{variant:"outline",size:"icon",className:"lg:hidden mr-4",children:(0,s.jsx)(ez.Z,{className:"h-4 w-4"})})}),(0,s.jsx)(eV,{side:"left",className:"p-4",children:(0,s.jsx)(eg,{endpoints:b,selectedEndpoint:u,onSelectEndpoint:e=>{p(e),g(!1)},className:"h-full"})})]})}),(0,s.jsx)(eS,{})]}),(0,s.jsxs)("div",{className:"flex pt-16",children:[(0,s.jsx)("aside",{className:"hidden lg:block w-64 lg:w-80 shrink-0 h-[calc(100vh-4rem)] overflow-y-auto",children:(0,s.jsx)(eg,{endpoints:b,selectedEndpoint:u,onSelectEndpoint:p,className:"px-4"})}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto p-4 md:p-6 lg:p-8",children:u&&(0,s.jsx)(ex,{endpoint:u,baseUrl:j})})]})]})}function eB(){return(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)("div",{className:"flex items-center justify-center h-screen",children:"Loading..."}),children:(0,s.jsx)(eA,{})})}function eD(e){let{message:t}=e;return(0,s.jsxs)(b,{variant:"destructive",className:"m-4",children:[(0,s.jsx)(l.Z,{className:"h-4 w-4"}),(0,s.jsx)(j,{children:"Error"}),(0,s.jsx)(v,{children:t})]})}eV.displayName=eZ.VY.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(eZ.Dx,{ref:t,className:u("text-lg font-semibold text-foreground",a),...r})}).displayName=eZ.Dx.displayName,r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(eZ.dk,{ref:t,className:u("text-sm text-muted-foreground",a),...r})}).displayName=eZ.dk.displayName}},function(e){e.O(0,[598,310,218,971,23,744],function(){return e(e.s=93038)}),_N_E=e.O()}]);