1import{r as ke}from"./EmptyState.vue-rwSZSXb9.js";import{u as pa}from"./ViewLayout.vue-Bpmjy0bF.js";import{x as ma}from"./ViewLayoutContent.vue-BUMUpRET.js";import{a6 as $,aT as c,U as S,bG as g,a2 as y,aJ as va,Z as ye,b3 as ae,bO as fa,aR as Be,aQ as Xe,bF as ba,W as T,K as b,e as D,b2 as Q,aN as ne,aL as O,bi as B,b1 as M,H as w,b0 as ha,bp as p,q as ga,V as C,as as Ye,S as ya,bt as xa,a1 as R,aC as I,bI as _e,aG as Ta,aK as ue,b9 as N,a3 as Sa,aH as Je,ad as ce,T as Ce,a5 as Z,k as Ha,bM as wa,_ as he,$ as Y,ag as ie,aw as j,bE as te,z as fe,P as Re,i as ee,b4 as ge,bJ as pe,R as Ue,y as ka,bf as Ua,b8 as de,bH as oe,aE as Pa,bB as re,c as Ba,bs as xe,bl as Ca,g as za,bD as Wa,aD as Ze,bm as $a,bv as ze,I as _a,n as Ra,M as Aa,v as Va,ah as qa,s as Ae,j as Ea,aA as Qe,u as Ma,aV as Da,bq as Oa,bk as Ve,aX as Fa,af as Na,bu as Ia,F as ea,aF as La,r as ja,m as Ka,av as Ga}from"./docs-jXQeJx-1.js";import{_ as aa}from"./ViewLayoutSection.vue-BAfFWFfw.js";import{n as Xa,k as Ya,e as ta,a as la}from"./mediaTypes-DrpB-HQV.js";import{b as Ja}from"./ScalarPopover.vue-BVvcwAgM.js";import{i as Za}from"./ScalarAsciiArt.vue-D-KTIUQB.js";import{b as Se}from"./ScalarHotkey.vue-CgFw5uSg.js";import"./index-D04aio-r.js";import"./index-Cgf0taMc.js";
1import"./CustomHead-B5FxR42g.js";const oa={100:{name:"Continue",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/100",color:"var(--scalar-color-blue)"},101:{name:"Switching Protocols",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/101",color:"var(--scalar-color-blue)"},102:{name:"Processing",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/102",color:"var(--scalar-color-blue)"},103:{name:"Early Hints",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/103",color:"var(--scalar-color-blue)"},200:{name:"OK",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/200",color:"var(--scalar-color-green)"},201:{name:"Created",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/201",color:"var(--scalar-color-green)"},202:{name:"Accepted",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202",color:"var(--scalar-color-green)"},203:{name:"Non-Authoritative Information",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/203",color:"var(--scalar-color-green)"},204:{name:"No Content",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/204",color:"var(--scalar-color-green)"},205:{name:"Reset Content",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/205",color:"var(--scalar-color-green)"},206:{name:"Partial Content",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/206",color:"var(--scalar-color-green)"},207:{name:"Multi-Status",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/207",color:"var(--scalar-color-green)"},208:{name:"Already Reported",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/208",color:"var(--scalar-color-green)"},226:{name:"IM Used",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/226",color:"var(--scalar-color-green)"},300:{name:"Multiple Choices",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/300",color:"var(--scalar-color-yellow)"},301:{name:"Moved Permanently",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/301",color:"var(--scalar-color-yellow)"},302:{name:"Found",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/302",color:"var(--scalar-color-yellow)"},303:{name:"See Other",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/303",color:"var(--scalar-color-yellow)"},304:{name:"Not Modified",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/304",color:"var(--scalar-color-yellow)"},305:{name:"Use Proxy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/305",color:"var(--scalar-color-yellow)"},306:{name:"(Unused)",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/306",color:"var(--scalar-color-yellow)"},307:{name:"Temporary Redirect",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/307",color:"var(--scalar-color-yellow)"},308:{name:"Permanent Redirect",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/308",color:"var(--scalar-color-yellow)"},400:{name:"Bad Request",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/400",color:"var(--scalar-color-red)"},401:{name:"Unauthorized",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401",color:"var(--scalar-color-red)"},402:{name:"Payment Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/402",color:"var(--scalar-color-red)"},403:{name:"Forbidden",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403",color:"var(--scalar-color-red)"},404:{name:"Not Found",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/404",color:"var(--scalar-color-red)"},405:{name:"Method Not Allowed",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405",color:"var(--scalar-color-red)"},406:{name:"Not Acceptable",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/406",color:"var(--scalar-color-red)"},407:{name:"Proxy Authentication Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407",color:"var(--scalar-color-red)"},408:{name:"Request Timeout",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408",color:"var(--scalar-color-red)"}
1,409:{name:"Conflict",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409",color:"var(--scalar-color-red)"},410:{name:"Gone",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/410",color:"var(--scalar-color-red)"},411:{name:"Length Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/411",color:"var(--scalar-color-red)"},412:{name:"Precondition Failed",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/412",color:"var(--scalar-color-red)"},413:{name:"Content Too Large",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413",color:"var(--scalar-color-red)"},414:{name:"URI Too Long",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/414",color:"var(--scalar-color-red)"},415:{name:"Unsupported Media Type",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/415",color:"var(--scalar-color-red)"},416:{name:"Range Not Satisfiable",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/416",color:"var(--scalar-color-red)"},417:{name:"Expectation Failed",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/417",color:"var(--scalar-color-red)"},418:{name:"I'm a teapot",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/418",color:"var(--scalar-color-red)"},421:{name:"Misdirected Request",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/421",color:"var(--scalar-color-red)"},422:{name:"Unprocessable Content",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/422",color:"var(--scalar-color-red)"},423:{name:"Locked",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/423",color:"var(--scalar-color-red)"},424:{name:"Failed Dependency",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/424",color:"var(--scalar-color-red)"},425:{name:"Too Early",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/425",color:"var(--scalar-color-red)"},426:{name:"Upgrade Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/426",color:"var(--scalar-color-red)"},428:{name:"Precondition Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/428",color:"var(--scalar-color-red)"},429:{name:"Too Many Requests",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429",color:"var(--scalar-color-red)"},431:{name:"Request Header Fields Too Large",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/431",color:"var(--scalar-color-red)"},451:{name:"Unavailable For Legal Reasons",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/451",color:"var(--scalar-color-red)"},500:{name:"Internal Server Error",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500",color:"var(--scalar-color-red)"},501:{name:"Not Implemented",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/501",color:"var(--scalar-color-red)"},502:{name:"Bad Gateway",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502",color:"var(--scalar-color-red)"},503:{name:"Service Unavailable",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503",color:"var(--scalar-color-red)"},504:{name:"Gateway Timeout",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504",color:"var(--scalar-color-red)"},505:{name:"HTTP Version Not Supported",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/505",color:"var(--scalar-color-red)"},506:{name:"Variant Also Negotiates",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/506",color:"var(--scalar-color-red)"},507:{name:"Insufficient Storage",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/507",color:"var(--scalar-color-red)"},508:{name:"Loop Detected",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/508",color:"var(--scalar-color-red)"},510:{name:"Not Extended",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/510",color:"var(--scalar-color-red)"},511:{name:"Network Authentication Required",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/511",color:"var(--scalar-color-red)"}},Qa=$({__name:"ScalarCombobox",props:{options:{},modelValue:{},placeholder:{},placement:{},offset:{},resize:{type:Boolean},target:{},middleware:{},teleport:{type:[Boolean,String]}},emits:["update:modelValue"],setup(e){return(a,t)=>(c(),S(fa,{middleware:a.middleware,offset:a.offset,placement:a.placement??"bottom-start",resize:a.resize,target:a.target,teleport:a.teleport},{default:g(({open:n})=>[ae(a.$slots,"default",{open:n})]),popover:g(({open:n,close:o})=>[y(va,{modelValue:a.modelValue?[a.modelValue]:[],open:n,options:a.options,placeholder:a.placeholder,"onUpdate:modelValue":i=>(o(),a.$emit("update:modelValue",i[0]))},ye({_:2},[a.$slots.before?{name:"before",fn:g(()=>[ae(a.$slots,"before",{open:n})]),key:"0"}:void 0,a.$slots.after?{name:"after",fn:g(()=>[ae(a.$slots,"after",{open:n})]),key:"1"}:void 0]),1032,["modelValue","open","options","placeholder","onUpdate:modelValue"])]),_:3},8,["middleware","offset","placement","resize","target","teleport"]))}}),et=$({__name:"ScalarVirtualText",props:{text:{},lineHeight:{default:20},containerClass:{default:""},contentClass:{default:""},lineClass:{default:""}},setup(e){const a=e,t=M(null),n=M(null),o=M(0),i=M(0),v=w(()=>a.text.split(` 2`)),u=w(()=>v.value.length*a.lineHeight),m=w(()=>Math.floor(o.value/a.lineHeight)),r=w(()=>Math.min(Math.ceil((o.value+i.value)/a.lineHeight),v.value.length)),d=w(()=>{const h=Math.max(0,m.value-10),k=Math.min(v.value.length,r.value+10);return v.value.slice(h,k)}),x=w(()=>({height:`${u.value}px`,transform:`translateY(${Math.max(0,m.value-10)*a.lineHeight}px)`})),s=()=>t.value&&(o.value=t.value.scrollTop),l=()=>t.value&&(i.value=t.value.clientHeight);return Be(()=>{l(),window.addEventListener("resize",l)}),Xe(()=>{window.removeEventListener("resize",l)}),ba(()=>{n.value&&(n.value.style.transform=`translateY(${Math.max(0,m.value-10)*a.lineHeight}px)`)}),(h,k)=>
2(c(),T("div",{ref_key:"containerRef",ref:t,class:O(["scalar-virtual-text overflow-auto",h.containerClass]),onScroll:s},[b("code",{ref_key:"contentRef",ref:n,class:O(["scalar-virtual-text-content",h.contentClass]),style:ne(x.value)},[(c(!0),T(D,null,Q(d.value,(H,A)=>(c(),T("div",{key:m.value+A,class:O(["scalar-virtual-text-line",h.lineClass]),style:ne({height:`${a.lineHeight}px`,lineHeight:`${a.lineHeight}px`})},B(H),7))),128))],6)],34))}});function qe({multiple:e,accept:a,onChange:t,onError:n}={}){const o=M(null);let i;typeof document<"u"&&(i=document.createElement("input"),i.type="file",i.onchange=u=>{const m=u.target;o.value=m.files,t?.(o.value)},i.onerror=()=>n?.(),i.multiple=e,i.accept=a);const v=()=>{if(!i)return n?.();i.click()};return{files:ha(o),open:v}}const at=e=>{try{return decodeURIComponent(e)}catch{return e}};function tt(e){var a,t;let n="";if(e){const o=((a=e.match(/filename\*=UTF-8''([^;]+)/))==null?void 0:a[1])??((t=e.match(/filename\s*=\s*"?([^";]+)"?/))==null?void 0:t[1]);o&&(n=at(o.trim()))}return n}function ra(e){const a=i=>i instanceof Blob,t=w(()=>{var i;const v=((i=e.headers.find(u=>u.name.toLowerCase()==="content-type"))==null?void 0:i.value)??"";return new Xa(v)}),n=w(()=>{var i;const v=((i=e.headers.find(u=>u.name.toLowerCase()==="content-disposition"))==null?void 0:i.value)??"";return tt(v)}),o=w(()=>a(e.data)?URL.createObjectURL(e.data):typeof e.data=="string"?URL.createObjectURL(new Blob([e.data],{type:t.value.toString()})):e.data instanceof Object&&Object.keys(e.data).length?URL.createObjectURL(new Blob([JSON.stringify(e.data)],{type:t.value.toString()})):"");return{mimeType:t,attachmentFilename:n,dataUrl:o}}const lt={key:0,class:"text-c-3 flex min-h-16 items-center justify-center px-4 text-sm"},ot=$({__name:"CodeSnippet",props:{target:{},client:{},operation:{},server:{},example:{},securitySchemes:{default:()=>[]}},setup(e){const a=w(()=>e.securitySchemes.flatMap(o=>o.type==="apiKey"?o.value:o?.type==="http"?[o.token,o.password,btoa(`${o.username}:${o.password}`)]:o.type==="oauth2"?Object.values(o.flows).map(i=>i?.token).filter(Ye):[])),t=w(()=>{const[o,i]=ya(e.target,e.client,{operation:e.operation,example:e.example,server:e.server,securitySchemes:e.securitySchemes});return{error:o,payload:i}}),n=w(()=>e.target==="shell"&&e.client==="curl"?"curl":e.target??"plaintext");return(o,i)=>t.value.error?(c(),T("div",lt,B(t.value.error.message),1)):t.value.payload?(c(),S(p(ga),{key:1,class:"w-full",content:t.value.payload,hideCredentials:a.value,lang:n.value,lineNumbers:""},null,8,["content","hideCredentials","lang"])):C("",!0)}}),rt=["aria-controls","aria-selected","tabindex"],nt=$({__name:"SectionFilterButton",props:{selected:{type:Boolean},controls:{}},setup(e){return(a,t)=>(c(),T("button",{"aria-controls":a.controls??"","aria-selected":!!a.selected,class:O(["hover:bg-b-2 flex w-fit cursor-pointer items-center whitespace-nowrap rounded p-1 px-2 text-center font-medium has-[:focus-visible]:outline",{"text-c-1 pointer-events-none":a.selected}]),role:"tab",tabindex:a.selected?0:-1,type:"button"},[ae(a.$slots,"default")],10,rt))}}),st={class:"request-section-content request-section-content-filter fade-request-section-content text-c-3 pointer-events-auto relative hidden w-full justify-end gap-[1.5px] rounded py-2 text-xs xl:flex"},it={class:"context-bar-group-hover:text-c-1 absolute -right-[30px] top-1/2 flex -translate-y-1/2 items-center"},dt={class:"context-bar-group-hover:hidden mr-1.5"},ct=$({__name:"SectionFilter",props:Ta({filters:{default:()=>[]},filterIds:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const a=xa(e,"modelValue"),t=M(),n=o=>{const i=o==="prev"?-1:1,v=a.value?e.filters.indexOf(a.value):0,u=e.filters.length,m=(v+i+u)%u;a.value=e.filters[m],ue(()=>{if(t.value){const r=t.value.querySelector('button[aria-selected="true"]');r&&r.focus()}})};return(o,i)=>(c(),T("div",{ref_key:"tablist",ref:t,class:"filter-hover context-bar-group ml-auto hidden lg:flex",role:"tablist",onKeydown:[i[0]||(i[0]=_e(v=>n("prev"),["left"])),i[1]||(i[1]=_e(v=>n("next"),["right"]))]},[b("div",st,[(c(!0),T(D,null,Q(o.filters,v=>{var u;return c(),S(nt,{key:v,class:"filter-hover-item",controls:(u=o.filterIds)==null?void 0:u[v],role:"tab",selected:a.value===v,onClick:m=>a.value=v},{default:g(()=>[R(B(v),1)]),_:2},1032,["controls","selected","onClick"])}),128)),b("div",it,[b("span",dt,B(a.value),1),y(p(I),{icon:"FilterList",size:"md",thickness:"2"})])])],544))}}),na=N(ct,[["__scopeId","data-v-a82399a9"]]),be=$({__name:"DataTableHeader",setup(e){const{cx:a}=Sa();return(t,n)=>(c(),S(ce,Je({is:"th"},p(a)("items-center font-medium px-2 min-w-0 -outline-offset-1")),{default:g(()=>[ae(t.$slots,"default")]),_:3},16))}}),Ee=e=>!!(e.description||e.type||e.default||e.format||e.minimum||e.maximum),Pe=e=>w(()=>
2{if(e.value===void 0||e.value==="")return!1;if(e.type){if(e.type==="integer"){const a=Number(e.value);if(isNaN(a)||!Number.isInteger(a))return"Value must be a whole number (e.g., 42)";if(e.minimum!==void 0&&a<e.minimum)return`Value must be ${e.minimum} or greater`;if(e.maximum!==void 0&&a>e.maximum)return`Value must be ${e.maximum} or less`}if(e.type==="number"){const a=Number(e.value);if(isNaN(a))return"Value must be a number (e.g., 42.5)";if(e.minimum!==void 0&&a<e.minimum)return`Value must be ${e.minimum} or greater`;if(e.maximum!==void 0&&a>e.maximum)return`Value must be ${e.maximum} or less`}if(e.type==="string"&&e.format){if(e.format==="date"&&!/^\d{4}-\d{2}-\d{2}$/.test(e.value))return"Please enter a valid date in YYYY-MM-DD format (e.g., 2024-03-20)";if(e.format==="date-time"&&!/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})$/.test(e.value))return"Please enter a valid date and time in RFC 3339 format (e.g., 2024-03-20T13:45:30Z)";if(e.format==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.value))return"Please enter a valid email address (e.g., [email protected])";if(e.format==="uri"&&!/^[a-zA-Z][a-zA-Z0-9+.-]*:.+$/.test(e.value))return"Please enter a valid URI (e.g., https://example.com)"}}return!1}),ut=["aria-label","role"],pt={class:"w-content bg-b-1 text-xxs text-c-1 pointer-events-none grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg"},mt={key:0,class:"text-error-1"},vt={key:1,class:"schema text-c-2 flex items-center"},ft={key:0},bt={key:1},ht={key:2},gt={key:3},yt={key:4},xt={key:2,class:"text-pretty text-sm leading-snug",style:{maxWidth:"16rem"}},Tt=$({__name:"RequestTableTooltip",props:{item:{}},setup(e){const a=w(()=>!!Pe(e.item).value);return(t,n)=>(c(),S(p(Ce),{align:"start",class:"w-full pr-px",delay:0,side:"left",triggerClass:"before:absolute before:content-[''] before:bg-gradient-to-r before:from-transparent before:to-b-1 group-[.alert]:before:to-b-alert group-[.error]:before:to-b-danger before:min-h-[calc(100%-4px)] before:pointer-events-none before:right-[23px] before:top-0.5 before:w-3 absolute h-full right-0 -outline-offset-1"},{trigger:g(()=>[b("div",{"aria-label":a.value?"Input is invalid":"More Information",class:"bg-b-1 mr-1 pl-1 pr-1.5 group-[.alert]:bg-transparent group-[.error]:bg-transparent",role:a.value?"alert":"none"},[y(p(I),{class:O(a.value?"text-orange brightness-[.9]":"text-c-3 group-hover/info:text-c-1"),icon:a.value?"Alert":"Info",size:"sm",thickness:"1.5"},null,8,["class","icon"])],8,ut)]),content:g(()=>[b("div",pt,[a.value?(c(),T("div",mt,B(p(Pe)(t.item).value),1)):t.item.type||t.item.format||t.item.minimum||t.item.maximum||t.item.default?(c(),T("div",vt,[t.item.type?(c(),T("span",ft,B(t.item.type),1)):C("",!0),t.item.format?(c(),T("span",bt,B(t.item.format),1)):C("",!0),t.item.minimum?(c(),T("span",ht,"min: "+B(t.item.minimum),1)):C("",!0),t.item.maximum?(c(),T("span",gt,"max: "+B(t.item.maximum),1)):C("",!0),t.item.default?(c(),T("span",yt,"default: "+B(t.item.default),1)):C("",!0)])):C("",!0),t.item.description&&!a.value?(c(),T("span",xt,B(t.item.description),1)):C("",!0)])]),_:1}))}}),St=N(Tt,[["__scopeId","data-v-ffeb58c7"]]),Ht={class:"contents"},wt={class:"sr-only"},kt={class:"text-c-2 filemask flex w-full max-w-[100%] items-end justify-end overflow-hidden p-1"},Ut=["onClick"],Pt={key:1,class:"p-0.5"},Bt=$({__name:"RequestTable",props:{items:{},hasCheckboxDisabled:{type:Boolean,default:!1},showUploadButton:{type:Boolean,default:!1},isGlobal:{type:Boolean,default:!1},isReadOnly:{type:Boolean,default:!1},environment:{},envVariables:{},workspace:{},invalidParams:{}},emits:["updateRow","toggleRow","addRow","deleteRow","inputFocus","inputBlur","uploadFile","removeFile"],setup(e,{emit:a}){const t=e,n=a,o=["","","36px"],i=(m,r,d)=>{n("updateRow",m,r,d)},v=m=>{n("uploadFile",m)},u=m=>Array.isArray(m.default)&&m.default.length===1?m.default[0]:m.default;return(m,r)=>(c(),S(ie,{class:"group/table flex-1",columns:o},{default:g(()=>[y(Z,{class:"sr-only !block"},{default:g(()=>[y(be,null,{default:g(()=>r[4]||(r[4]=[b("span",{class:"sr-only"},"Enabled",-1)])),_:1}),y(be,null,{default:g(()=>r[5]||(r[5]=[R("Key")])),_:1}),y(be,null,{default:g(()=>r[6]||(r[6]=[R("Value")])),_:1})]),_:1}),(c(!0),T(D,null,Q(m.items,(d,x)=>(c(),S(Z,{id:d.key,key:x,class:O({alert:p(Pe)(d).value,error:m.invalidParams&&m.invali
2dParams.has(d.key)})},{default:g(()=>[b("label",Ht,[m.isGlobal?(c(),S(p(Ha),{key:0,class:"!border-r-1/2 border-t-1/2 text-c-2 flex items-center justify-center",to:d.route??{}},{default:g(()=>[r[8]||(r[8]=b("span",{class:"sr-only"},"Global",-1)),y(p(Ce),{as:"div",side:"top"},{trigger:g(()=>[y(p(I),{class:"text-c-1",icon:"Globe",size:"xs"})]),content:g(()=>r[7]||(r[7]=[b("div",{class:"w-content bg-b-1 text-xxs text-c-1 z-100 pointer-events-none z-10 grid max-w-[320px] gap-1.5 rounded p-2 leading-5 shadow-lg"},[b("div",{class:"text-c-1 flex items-center"},[b("span",{class:"text-pretty"}," Global cookies are shared across the whole workspace. ")])],-1)])),_:1})]),_:2},1032,["to"])):(c(),T(D,{key:1},[b("span",wt," Row "+B(d.enabled?"Enabled":"Disabled"),1),y(wa,{class:"!border-r-1/2",disabled:t.hasCheckboxDisabled,modelValue:d.enabled,"onUpdate:modelValue":s=>n("toggleRow",x,s)},null,8,["disabled","modelValue","onUpdate:modelValue"])],64))]),y(ce,null,{default:g(()=>[y(he,{disableCloseBrackets:"",disabled:t.isReadOnly,disableEnter:"",disableTabIndent:"",envVariables:m.envVariables,environment:m.environment,modelValue:d.key,placeholder:"Key",required:!!d.required,workspace:m.workspace,onBlur:r[0]||(r[0]=s=>n("inputBlur")),onFocus:r[1]||(r[1]=s=>n("inputFocus")),onSelectVariable:s=>i(x,"key",s),"onUpdate:modelValue":s=>n("updateRow",x,"key",s)},null,8,["disabled","envVariables","environment","modelValue","required","workspace","onSelectVariable","onUpdate:modelValue"])]),_:2},1024),y(ce,null,{default:g(()=>[y(he,{class:O({"pr-6":p(Ee)(d)}),default:d.default,disableCloseBrackets:"",disabled:t.isReadOnly,disableEnter:"",disableTabIndent:"",enum:d.enum??[],envVariables:m.envVariables,environment:m.environment,examples:d.examples??[],max:d.maximum,min:d.minimum,modelValue:d.value,nullable:!!d.nullable,placeholder:"Value",type:d.type,workspace:m.workspace,onBlur:r[2]||(r[2]=s=>n("inputBlur")),onFocus:r[3]||(r[3]=s=>n("inputFocus")),onSelectVariable:s=>i(x,"value",s),"onUpdate:modelValue":s=>n("updateRow",x,"value",s)},{icon:g(()=>[p(Ee)(d)?(c(),S(St,{key:0,item:{...d,default:u(d)}},null,8,["item"])):C("",!0)]),_:2},1032,["class","default","disabled","enum","envVariables","environment","examples","max","min","modelValue","nullable","type","workspace","onSelectVariable","onUpdate:modelValue"])]),_:2},1024),m.showUploadButton?(c(),S(ce,{key:0,class:"group/upload flex items-center justify-center whitespace-nowrap"},{default:g(()=>{var s;return[d.file?(c(),T(D,{key:0},[b("div",kt,[b("span",null,B((s=d.file)==null?void 0:s.name),1)]),b("button",{class:"bg-b-2 centered-x centered-y absolute hidden w-[calc(100%_-_8px)] rounded p-0.5 text-center text-xs font-medium group-hover/upload:block",type:"button",onClick:l=>n("removeFile",x)}," Delete ",8,Ut)],64)):(c(),T("div",Pt,[y(p(Y),{class:"bg-b-2 hover:bg-b-3 text-c-2 h-fit border-0 py-px shadow-none",size:"sm",variant:"outlined",onClick:l=>v(x)},{default:g(()=>[r[9]||(r[9]=b("span",null,"Upload File",-1)),y(p(I),{class:"ml-1",icon:"UploadSimple",size:"xs",thickness:"2.5"})]),_:2},1032,["onClick"])]))]}),_:2},1024)):C("",!0)]),_:2},1032,["id","class"]))),128))]),_:1}))}}),me=N(Bt,[["__scopeId","data-v-5c4132b8"]]),Ct={key:0,class:"border-t-1/2 text-c-3 flex min-h-10 w-full items-center justify-center p-2 text-sm"},zt={key:1,class:"flex items-center justify-center overflow-hidden border-t p-1.5"},Wt={class:"text-c-2 w-full max-w-full overflow-hidden whitespace-nowrap rounded border px-1.5 py-1 text-xs"},$t=$({__name:"RequestBody",props:{example:{},operation:{},environment:{},envVariables:{},workspace:{},title:{}},setup(e){const{requestExampleMutators:a}=j(),t={json:"json",xml:"xml",yaml:"yaml",edn:"edn",other:"html"},n=Object.entries({multipartForm:"Multipart Form",formUrlEncoded:"Form URL Encoded",binaryFile:"Binary File",json:"JSON",xml:"XML",yaml:"YAML",edn:"EDN",other:"Other",none:"None"}).map(([f,P])=>({id:f,label:P})),o=w(()=>{var f;const{activeBody:P,formData:z,raw:W}=e.example.body;return P==="formData"?z?.encoding==="urlencoded"?"formUrlEncoded":"multipartForm":P==="binary"?"binaryFile":P==="raw"&&W!=null&&W.encoding?W.encoding==="html"?"other":W.encoding:Object.keys(((f=e.operation.requestBody)==null?void 0:f.content)||{})[0]||"none"}),i=w({get:()=>n.find(f=>f.id===o.value)??n[n.length-1]??n[0],set:f=>{f!=null&&f.id&&H(f.id)}}),v=M(null),u=w(()=>{var f;const P=(f=i.value)==null?void 0:f.id;return t[P]??"plaintext"});function m(){console.log("deleteRow")}const r=(f,P,z)=>{var W,E,F,V,K,X,ve;const Te=d.value;if(Te.length>f){const G=[...Te];G[f]={...G[f],value:((W=G[f])==null?void 0:W.value)||"",key:((E=G[f])==null?void 0:E.key)||"",enabled:((F=G[f])==null?void 0:F.enabled)??!1,[P]:z||""},(((V=G[f])==null?void 0:V.key)!==""||((K=G[f])==null?void 0:K.value)!=="")&&(G[f].enabled=!0),((X=G[f])==null?void 0:X.key)===""&&((ve=G[f])==null?void 0:ve.value)===""&&G.splice(f,1),a.edit(e.example.uid,"body.formData.value",G)}else{const G=[ge.parse({[P]:z})];a.edit(e.example.uid,"body.formData.value",G),ue(()=>{var $e;v.value&&(($e=v.value.querySelectorAll("input")[P==="key"?0:1])==null||$e.focus())})}f===Te.length-1&&s()},d=w(()=>{var f;return((f=e.example.body.formData)==null?void 0:f.value)??[]}),x=()=>{const f=d.value[d.value.length-1];(!f||f.key!==""||f.value!=="")&&s()},s=()=>{const f=ge.parse({enabled:!1}),P=[...d.value,f];e.example.body.formData?a.edit(e.example.uid,"body.formData.value",P):a.edit(e.example.uid,"body.formData",{value:P,encoding:"form-data"})},l=(f,P)=>{const z=d.value;if(z.length>f){const W=[...z];W[f]&&(W[f].enabled=P),a.edit(e.example.uid,"body.formData.value",W)}},h=f=>a.edit(e.example.uid,"body.raw.value",f),k=f=>f==="multipartForm"?{activeBody:"formData",encoding:"form-data",header:"multipart/form-data"}:f==="formUrlEncoded"?{activeBody:"formData",encoding:"urlencoded",header:"application/x-www-form-urlencoded"}:f==="binaryFile"?{activeBody:"binary",encoding:void 0,header:"application/octet-stream"}:f==="json"||f.endsWith("+json")?{activeBody:"raw",encoding:"json",header:f.endsWith("+json")?`application/${f}`:"application/json"}:f==="xml"?{activeBody:"raw",encoding:"xml",header:"application/xml"}:f==="yaml"?{activeBody:"raw",encoding:"yaml",header:"application/yaml"}:f==="edn"?{activeBody:"raw",encoding:"edn",header:"application/edn"}:f==="other"?{activeBody:"raw",encoding:"html",header:"application/html"}:{activeBody:"raw",encoding:void 0,header:void 0},H=f=>{var P,z;const{activeBody:W,encoding:E,header:F}=k(f);if(a.edit(e.example.uid,"body.activeBody",W),E&&W==="raw")a.edit(e.example.uid,"body.raw",{encoding:E,value:((P=e.example.body.raw)==null?void 0:P.value)??""});else if(E&&W==="formData")a.edit(e.example.uid,"body.formData",{encoding:E,value:((z=e.example.body.formData)==null?void 0:z.value)??[]});else if(!E&&W!=="binary"){const{raw:X,...ve}=e.example.body;a.edit(e.example.uid,"body",ve)}const V=[...e.example.parameters.headers],K=V.findIndex(X=>X.key.toLowerCase()==="content-type");if(K>=0)F&&V[K]?V[K].value=F:V[K]&&(W!=="raw"||f==="none")&&V.splice(K,1);else if(F){const X=V[V.length-1];X&&X.key===""&&X.value===""?V.splice(V.length-1,0,{key:"Content-Type",value:F,enabled:!0}):V.push({key:"Content-Type",value:F,enabled:!0})}a.edit(e.example.uid,"parameters.headers",V)},A=async f=>{const{open:P}=qe({onChange:async z=>{var W,E;const F=z?.[0];if(F){const V=[...d.value];V[f]={...V[f],file:F,value:((W=V[f])==null?void 0:W.value)||F.name,key:((E=V[f])==null?void 0:E.key)||F.name,enabled:!0},a.edit(e.example.uid,"body.formData.value",V),x()}},multiple:!1,accept:"*/*"});P()},_=()=>a.edit(e.example.uid,"body.binary",void 0);function L(f){const P=d.value,z=[...P],W=P[f],E=W?.file;P.length>1&&(!(W!=null&&W.key)&&!(W!=null&&W.value)||E&&W?.key===E.name&&W?.value===E.name)?z.splice(f,1):z[f]&&(z[f].file=void 0),a.edit(e.example.uid,"body.formData.value",z)}function U(){const{open:f}=qe({onChange:async P=>{const z=P?.[0];z&&a.edit(e.example.uid,"body.binary",z)},multiple:!1,accept:"*/*"});f()}te(i,f=>{["multipartForm","formUrlEncoded"].includes(f?.id||"")&&x()},{immediate:!0}),te(()=>e.example.uid,()=>{e.operation.method&&fe(e.operation.method)&&H(o.value),["multipartForm","formUrlEncoded"].includes(o.value)&&x()},{immediate:!0});const q=w(()=>{var f,P,z;const W=(f=i.value)==null?void 0:f.id,{header:E}=k(W),F=((P=e.operation.requestBody)==null?void 0:P.content)||{},V=E?((z=F[E])==null?void 0:z.examples)||{}:{};return Object.entries(V).map(([K,X])=>({id:K,label:K,value:X}))}),J=w({get:()=>{var f;const P=((f=e.example.body.raw)==null?void 0:f.value)??"{}
2",z=JSON.parse(P);return q.value.find(W=>{const E=W.value;return JSON.stringify(E.value)===JSON.stringify(z)})??q.value[0]},set:f=>{if(f!=null&&f.id){const P=q.value.find(z=>z.id===f.id);if(P){const z=P.value;h(JSON.stringify(z.value,null,2))}}}});return(f,P)=>(c(),S(ee,null,{title:g(()=>[R(B(f.title),1)]),default:g(()=>[y(ie,{columns:[""]},{default:g(()=>[y(Z,null,{default:g(()=>[y(be,{class:"relative col-span-full flex h-8 cursor-pointer items-center justify-between !p-0"},{default:g(()=>[y(p(Re),{modelValue:i.value,"onUpdate:modelValue":P[0]||(P[0]=z=>i.value=z),options:p(n),teleport:""},{default:g(()=>[y(p(Y),{class:"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-3 font-normal",fullWidth:"",variant:"ghost"},{default:g(()=>{var z;return[b("span",null,B((z=i.value)==null?void 0:z.label),1),y(p(I),{icon:"ChevronDown",size:"md"})]}),_:1})]),_:1},8,["modelValue","options"]),q.value.length>0?(c(),S(p(Re),{key:0,modelValue:J.value,"onUpdate:modelValue":P[1]||(P[1]=z=>J.value=z),options:q.value,side:"left",teleport:""},{default:g(()=>[y(p(Y),{class:"text-c-2 hover:text-c-1 flex h-full w-fit gap-1.5 px-2 font-normal",fullWidth:"",variant:"ghost"},{default:g(()=>{var z;return[b("span",null,B((z=J.value)==null?void 0:z.label),1),y(p(I),{icon:"ChevronDown",size:"md"})]}),_:1})]),_:1},8,["modelValue","options"])):C("",!0)]),_:1})]),_:1}),y(Z,null,{default:g(()=>{var z,W,E,F,V,K;return[((z=i.value)==null?void 0:z.id)==="none"?(c(),T("div",Ct,P[2]||(P[2]=[b("span",null,"No Body",-1)]))):((W=i.value)==null?void 0:W.id)==="binaryFile"?(c(),T("div",zt,[f.example.body.binary?(c(),T(D,{key:0},[b("span",Wt,B(f.example.body.binary.name),1),y(p(Y),{class:"bg-b-2 hover:bg-b-3 text-c-2 ml-1 border-0 shadow-none",size:"sm",variant:"outlined",onClick:_},{default:g(()=>P[3]||(P[3]=[R(" Delete ")])),_:1})],64)):(c(),S(p(Y),{key:1,class:"bg-b-2 hover:bg-b-3 text-c-2 border-0 shadow-none",size:"sm",variant:"outlined",onClick:U},{default:g(()=>[P[4]||(P[4]=b("span",null,"Upload File",-1)),y(p(I),{class:"ml-1",icon:"UploadSimple",size:"xs",thickness:"2.5"})]),_:1}))])):((E=i.value)==null?void 0:E.id)=="multipartForm"?(c(),S(me,{key:2,ref_key:"tableWrapperRef",ref:v,class:"!m-0 rounded-t-none border-b-0 border-l-0 border-r-0 border-t-0 shadow-none",columns:["32px","","","104px"],envVariables:f.envVariables,environment:f.environment,items:d.value,showUploadButton:"",workspace:f.workspace,onDeleteRow:m,onRemoveFile:L,onToggleRow:l,onUpdateRow:r,onUploadFile:A},null,8,["envVariables","environment","items","workspace"])):((F=i.value)==null?void 0:F.id)=="formUrlEncoded"?(c(),S(me,{key:3,ref_key:"tableWrapperRef",ref:v,class:"!m-0 rounded-t-none border-b-0 border-l-0 border-r-0 border-t-0 shadow-none",columns:["32px","","","104px"],envVariables:f.envVariables,environment:f.environment,items:d.value,showUploadButton:"",workspace:f.workspace,onDeleteRow:m,onRemoveFile:L,onToggleRow:l,onUpdateRow:r,onUploadFile:A},null,8,["envVariables","environment","items","workspace"])):(c(),S(he,{key:4,class:"border-t-1/2 px-1",content:"",envVariables:f.envVariables,environment:f.environment,language:u.value,lineNumbers:"",lint:"",modelValue:((K=(V=f.example.body)==null?void 0:V.raw)==null?void 0:K.value)??"",workspace:f.workspace,"onUpdate:modelValue":h},null,8,["envVariables","environment","language","modelValue","workspace"]))]}),_:1}),y(Z)]),_:1})]),_:1}))}}),_t=N($t,[["__scopeId","data-v-8bf1b90e"]]),Rt={class:"text-c-2 request-meta-buttons flex whitespace-nowrap opacity-0 group-hover/params:opacity-100 has-[:focus-visible]:opacity-100"},At={class:"sr-only"}
2,He=$({__name:"RequestParams",props:{example:{},environment:{},envVariables:{},workspace:{},title:{},paramKey:{},readOnlyEntries:{default:()=>[]},invalidParams:{}},setup(e){const{requestExampleMutators:a}=j(),t=w(()=>e.example.parameters[e.paramKey]??[]);Be(()=>m());const n=()=>{const s=ge.parse({enabled:!1}),l=[...t.value,s];a.edit(e.example.uid,`parameters.${e.paramKey}`,l)},o=M(null),i=(s,l,h)=>{const k=t.value;if(k.length>s){const H=[...k];if(!H[s])return;H[s]={...H[s],[l]:h},(H[s].key!==""||H[s].value!=="")&&(H[s].enabled=!0),H[s].key===""&&H[s].value===""&&H.splice(s,1),a.edit(e.example.uid,`parameters.${e.paramKey}`,H)}else{const H=[ge.parse({[l]:h})];a.edit(e.example.uid,`parameters.${e.paramKey}`,H),ue(()=>{var A;o.value&&((A=o.value.querySelectorAll("input")[l==="key"?0:1])==null||A.focus())})}s===k.length-1&&n()},v=(s,l)=>a.edit(e.example.uid,`parameters.${e.paramKey}.${s}.enabled`,l),u=()=>{const s=t.value.filter(l=>l.required);a.edit(e.example.uid,`parameters.${e.paramKey}`,s),ue(()=>n())};function m(){if(t.value.length===0)n();else if(t.value.length>=1){const s=t.value[t.value.length-1];s&&s.key!==""&&s.value!==""&&n()}}const r=w(()=>t.value.filter(s=>s.key||s.value).length),d=w(()=>t.value.length>1);te(()=>e.example,(s,l)=>{s!==l&&m()},{immediate:!0});const x=w(()=>(e.readOnlyEntries??[]).length>0);return(s,l)=>(c(),S(ee,{class:"group/params",itemCount:r.value},{title:g(()=>[R(B(s.title),1)]),actions:g(()=>[b("div",Rt,[d.value?(c(),S(p(Ce),{key:0,side:"left",sideOffset:6},{trigger:g(()=>[y(p(Y),{class:"pr-0.75 pl-1 transition-none",size:"sm",variant:"ghost",onClick:pe(u,["stop"])},{default:g(()=>[l[0]||(l[0]=R(" Clear ")),b("span",At,"All "+B(s.title),1)]),_:1})]),content:g(()=>l[1]||(l[1]=[b("div",{class:"w-content bg-b-1 text-xxs text-c-1 pointer-events-none z-10 grid min-w-48 gap-1.5 rounded p-2 leading-5 shadow-lg"},[b("div",{class:"text-c-2 flex items-center"},[b("span",null,"Clear optional parameters")])],-1)])),_:1})):C("",!0)])]),default:g(()=>[b("div",{ref_key:"tableWrapperRef",ref:o},[x.value?(c(),S(me,{key:0,class:O(["flex-1",{"bg-mix-transparent bg-mix-amount-95 bg-c-3":x.value}]),columns:["32px","",""],envVariables:s.envVariables,environment:s.environment,invalidParams:s.invalidParams,isGlobal:"",isReadOnly:"",items:s.readOnlyEntries,workspace:s.workspace},null,8,["class","envVariables","environment","invalidParams","items","workspace"])):C("",!0),y(me,{class:"flex-1",columns:["32px","",""],envVariables:s.envVariables,environment:s.environment,invalidParams:s.invalidParams,items:t.value,workspace:s.workspace,onToggleRow:v,onUpdateRow:i},null,8,["envVariables","environment","invalidParams","items","workspace"])],512)]),_:1},8,["itemCount"]))}}),Vt=$({__name:"RequestPathParams",props:{example:{},operation:{},paramKey:{},title:{},environment:{},envVariables:{},workspace:{},invalidParams:{}},setup(e){const{requestMutators:a,requestExampleMutators:t}=j(),n=w(()=>e.example.parameters[e.paramKey].map(u=>({...u,enum:u.enum}))),o=(u,m,r)=>{var d,x;const s=e.example.parameters[e.paramKey],l=(d=s[u])==null?void 0:d.key;if(l){if(m==="key"){if((x=s[u])!=null&&x.required)return;if(r){const h=encodeURIComponent(l),k=encodeURIComponent(r),H=new RegExp(`(?<=/):${h}(?=[/?#]|$)`,"g"),A=e.operation.path.replace(H,`:${k}`);a.edit(e.operation.uid,"path",A)}else{s.splice(u,1);const h=new RegExp(`/:${encodeURIComponent(l)}(?=[/?#]|$)`,"g"),k=e.operation.path.replace(h,"");a.edit(e.operation.uid,"path",k)}}t.edit(e.example.uid,`parameters.${e.paramKey}.${u}.${m}`,r)}},i=u=>{var m;const r=((m=u.match(Ue.PATH))==null?void 0:m.map(l=>l.slice(1,-1)))||[],d=e.example.parameters[e.paramKey],x=new Map(d.map(l=>[l.key,l])),s=r.map(l=>x.get(l)||{key:l,value:"",enabled:!0});d.forEach(l=>{!r.includes(l.key)&&(l.value||l.required)&&s.push(l)}),d.splice(0,d.length,...s),t.edit(e.example.uid,`parameters.${e.paramKey}`,d)},v=u=>{u&&i(u)};return te(()=>e.operation.path,u=>{u&&v(u)}),(u,m)=>(c(),S(ee,{itemCount:n.value.length},{title:g(()=>[R(B(u.title),1)]),default:g(()=>[n.value.length?(c(),S(me,{key:0,class:"flex-1",columns:["32px","",""],envVariables:u.envVariables,environment:u.environment,invali
2dParams:u.invalidParams,items:n.value,workspace:u.workspace,onUpdateRow:o},null,8,["envVariables","environment","invalidParams","items","workspace"])):C("",!0)]),_:1},8,["itemCount"]))}}),qt={class:"w-full"},Et={class:"-mx-1 flex flex-1"},Mt={class:"bg-b-1 flex items-center justify-center overflow-hidden border-t"},Dt=$({__name:"RequestCodeExample",props:{collection:{},example:{},operation:{},server:{},workspace:{}},setup(e){const{securitySchemes:a,workspaceMutators:t}=j(),n=w(()=>ka(e.operation.security||e.collection.security||[],e.operation.selectedSecuritySchemeUids||e.collection.selectedSecuritySchemeUids,a)),o=w(()=>{const r={};return{options:Ua().clients().map(d=>({label:d.title,options:d.clients.map(x=>(r[`${d.key},${x.client}`]=x.title,{id:`${d.key},${x.client}`,label:x.title}))})),dict:r}}),i=w(()=>{var r;const d=e.workspace.selectedHttpClient;if(!d)return((r=o.value.options[0])==null?void 0:r.options[0])??{id:"js,fetch",label:"Fetch"};const x=`${d.targetKey},${d.clientKey}`;return{id:x,label:o.value.dict[x]??"Unknown"}}),v=w(()=>{var r;return((r=e.workspace.selectedHttpClient)==null?void 0:r.targetKey)??"js"}),u=w(()=>{var r;return((r=e.workspace.selectedHttpClient)==null?void 0:r.clientKey)??"fetch"}),m=({id:r})=>{const[d,x]=r.split(",");!d||!x||t.edit(e.workspace.uid,"selectedHttpClient",{targetKey:d,clientKey:x})};return(r,d)=>(c(),T("div",qt,[y(ee,{class:"group/preview w-full border-b-0",defaultOpen:!1},{title:g(()=>d[0]||(d[0]=[R("Code Snippet")])),actions:g(()=>[b("div",Et,[y(p(Qa),{modelValue:i.value,options:o.value.options,placement:"bottom-end","onUpdate:modelValue":m},{default:g(()=>[y(p(Y),{class:"text-c-1 hover:bg-b-3 py-0.75 flex h-full w-fit gap-1.5 px-1.5 font-normal",fullWidth:"",variant:"ghost"},{default:g(()=>{var x;return[b("span",null,B((x=i.value)==null?void 0:x.label),1),y(p(I),{icon:"ChevronDown",size:"md"})]}),_:1})]),_:1},8,["modelValue","options"])])]),default:g(()=>[y(ie,{columns:[""]},{default:g(()=>[y(Z,null,{default:g(()=>[b("div",Mt,[y(p(ot),{class:"px-3 py-1.5",client:u.value,example:r.example,operation:r.operation,securitySchemes:n.value,server:r.server,target:v.value},null,8,["client","example","operation","securitySchemes","server","target"])])]),_:1})]),_:1})]),_:1})]))}}),Ot=N(Dt,[["__scopeId","data-v-6c928e79"]]),Ft={class:"group pointer-events-none flex flex-1 items-center gap-1 lg:pr-24"},Nt={key:0,class:"pointer-events-auto absolute left-0 top-0 h-full w-full cursor-text opacity-0",for:"requestname"},It=["placeholder","value"],Lt={key:2,class:"text-c-1 flex h-8 items-center"},jt=["id","role"],Kt=$({__name:"RequestSection",props:{collection:{},environment:{},envVariables:{},example:{},invalidParams:{},operation:{},selectedSecuritySchemeUids:{},server:{},workspace:{}},setup(e){const a=["Auth","Variables","Cookies","Headers","Query","Body"],{requestMutators:t,cookies:n,securitySchemes:o}=j(),{layout:i}=de(),v=w(()=>{const l=new Set(["All",...a]);return e.example.parameters.path.length||l.delete("Variables"),fe(e.operation.method??"get")||l.delete("Body"),m.value&&l.delete("Auth"),[...l]}),u=w(()=>Object.fromEntries(v.value.map(l=>[l,xe()]))),m=w(()=>{var l;return i==="modal"&&((l=e.operation.security)==null?void 0:l.length)===0}),r=M("All");te(()=>e.operation,l=>{r.value==="Body"&&l&&!fe(l.method)&&(r.value="All")});const d=l=>{const h=l.target;t.edit(e.operation.uid,"summary",h.value)},x=w(()=>(e.workspace.cookies??[]).map(l=>n[l]).filter(Ye).filter(l=>l.name).filter(l=>{var h;return Ya(((h=e.server)==null?void 0:h.url)||e.operation.path,l.domain)}).map(l=>({key:l.name,value:l.value,route:{name:"cookies",params:{cookies:l.uid}},enabled:!0}))),s=()=>e.operation.summary?e.operation.summary:e.operation.path.replace(Ue.PROTOCOL,"")?e.operation.path.replace(Ue.PROTOCOL,""):"Request Name";return(l,h)=>(c(),S(aa,{"aria-label":`Request: ${l.operation.summary}`},{title:g(()=>[b("div",Ft,[p(i)!=="modal"?(c(),T("label",Nt)):C("",!0),p(i)!=="modal"?(c(),T("input",{key:1,id:"requestname",class:"text-c-1 group-hover-input pl-1.25 md:-ml-1.25 pointer-events-auto relative z-10 -ml-0.5 h-8 w-full rounded has-[:focus-visible]:outline",placeholder:s(),value:l.operation.summary,onInput:d},null,40,It)):(c(),T("span",Lt,B(l.operation.summary),1))]),y(na,{modelValue:r.value,"onUpdate:modelValue":h[0]||(h[0]=k=>r.value=k),filterIds:u.value,filters:v.value},null,8,["modelValue","filterIds","filters"])]),default:g(()=>[b("div",{id:u.value.All,class:"request-section-content custom-scroll relative flex flex-1 flex-col divide-y",role:r.value==="All"?"tabpanel":"none"},[l.collection&&l.workspace&&(p(i)!=="modal"||Object.keys(p(o)??{}).length)?oe((c(),S(Pa,{key:0,class:"request-section-content-auth",id:u.value.Auth,collection:l.collection,envVariables:l.envVariables,environment:l.environment,layout:"client",operation:l.operation,role:r.value==="All"?"none":"tabpanel",selectedSecuritySchemeUids:l.selectedSecuritySchemeUids,server:l.server,title:"Authentication",workspace:l.workspace},null,8,["id","collection","envVariables","environment","operation","role","selectedSecuritySchemeUids","server","workspace"])),[[re,!m.value&&(r.value==="All"||r.value==="Auth")]]):C("",!0),oe(y(Vt,{class:"request-section-content-path-params",id:u.value.Variables,envVariables:l.envVariables,environment:l.environment,example:l.example,invali
2dParams:l.invalidParams,operation:l.operation,paramKey:"path",role:r.value==="All"?"none":"tabpanel",title:"Variables",workspace:l.workspace},null,8,["id","envVariables","environment","example","invalidParams","operation","role","workspace"]),[[re,(r.value==="All"||r.value==="Variables")&&l.example.parameters.path.length]]),oe(y(He,{class:"request-section-content-cookies",id:u.value.Cookies,envVariables:l.envVariables,environment:l.environment,example:l.example,invalidParams:l.invalidParams,operation:l.operation,paramKey:"cookies",readOnlyEntries:x.value,role:r.value==="All"?"none":"tabpanel",title:"Cookies",workspace:l.workspace,workspaceParamKey:"cookies"},null,8,["id","envVariables","environment","example","invalidParams","operation","readOnlyEntries","role","workspace"]),[[re,r.value==="All"||r.value==="Cookies"]]),oe(y(He,{class:"request-section-content-headers",id:u.value.Headers,envVariables:l.envVariables,environment:l.environment,example:l.example,invalidParams:l.invalidParams,operation:l.operation,paramKey:"headers",role:r.value==="All"?"none":"tabpanel",title:"Headers",workspace:l.workspace},null,8,["id","envVariables","environment","example","invalidParams","operation","role","workspace"]),[[re,r.value==="All"||r.value==="Headers"]]),oe(y(He,{class:"request-section-content-query",id:u.value.Query,envVariables:l.envVariables,environment:l.environment,example:l.example,invalidParams:l.invalidParams,operation:l.operation,paramKey:"query",role:r.value==="All"?"none":"tabpanel",title:"Query Parameters",workspace:l.workspace},null,8,["id","envVariables","environment","example","invalidParams","operation","role","workspace"]),[[re,r.value==="All"||r.value==="Query"]]),oe(y(_t,{class:"request-section-content-body",id:u.value.Body,envVariables:l.envVariables,environment:l.environment,example:l.example,operation:l.operation,role:r.value==="All"?"none":"tabpanel",title:"Body",workspace:l.workspace},null,8,["id","envVariables","environment","example","operation","role","workspace"]),[[re,l.operation.method&&(r.value==="All"||r.value==="Body")&&p(fe)(l.operation.method)]]),h[1]||(h[1]=b("div",{class:"-my-0.25 flex flex-grow"},null,-1)),y(p(Ba),null,{default:g(()=>[y(Ot,{class:"request-section-content-code-example",collection:l.collection,example:l.example,operation:l.operation,server:l.server,workspace:l.workspace},null,8,["collection","example","operation","server","workspace"])]),_:1})],8,jt)]),_:1},8,["aria-label"]))}}),Gt=N(Kt,[["__scopeId","data-v-6ea5cf36"]]),Xt=["aria-expanded"],Yt={class:"overflow-hidden text-ellipsis whitespace-nowrap"},Jt=["id"],Zt={key:0},Qt={class:"description text-c-3 px-3 py-1.5"},el=$({__name:"ServerDropdownItem",props:{collection:{},operation:{},server:{},serverOption:{},type:{}},emits:["update:variable"],setup(e,{emit:a}){const t=e,n=a,o=xe(),{collectionMutators:i,requestMutators:v,servers:u}=j(),m=(l,h)=>{var k,H,A,_;if(d(l)&&h?.stopPropagation(),r.value){(H=(k=t.operation)==null?void 0:k.servers)!=null&&H.length&&v.edit(t.operation.uid,"selectedServerUid",null),t.type==="collection"?i.edit(t.collection.uid,"selectedServerUid",void 0):t.type==="request"&&t.operation&&v.edit(t.operation.uid,"selectedServerUid",null);return}t.type==="collection"&&t.collection?((_=(A=t.operation)==null?void 0:A.servers)!=null&&_.length&&v.edit(t.operation.uid,"selectedServerUid",null),i.edit(t.collection.uid,"selectedServerUid",l)):t.type==="request"&&t.operation&&v.edit(t.operation.uid,"selectedServerUid",l)},r=w(()=>t.type==="collection"?t.collection.selectedServerUid===t.serverOption.id:t.type==="request"&&t.operation?t.operation.selectedServerUid===t.serverOption.id:!1),d=l=>{if(!l)return!1;const h=u[l];return Object.keys(h?.variables??{}).length>0},x=w(()=>{var l;return r.value&&d(((l=t.server)==null?void 0:l.uid)??"")}),s=(l,h)=>{n("update:variable",l,h)};return(l,h)=>{var k,H;return c(),T("div",{class:O(["group/item flex min-h-fit flex-col rounded border",{"border-transparent":!r.value}])},[b("button",Je(x.value?{"aria-controls":p(o)}:{},{"aria-expanded":x.value,class:["flex min-h-8 cursor-pointer items-center gap-1.5 rounded px-1.5",r.value?"text-c-1 bg-b-2":"hover:bg-b-2"],type:"button",onClick:h[0]||(h[0]=A=>m(l.serverOption.id,A))}),[y(p(Ca),{selected:r.value},null,8,["selected"]),b("span",Yt,B(l.serverOption.label),1)],16,Xt),x.value?(c(),T("div",{key:0,id:p(o),class:"bg-b-2 divide divide-y rounded-b border-t *:pl-4",onClick:h[1]||(h[1]=pe(()=>{},["stop"]))},[y(za,{variables:(k=l.server)==null?void 0:k.variables,"onUpdate:variable":s},null,8,["variables"]),(H=l.server)!=null&&H.description?(c(),T("div",Zt,[b("div",Qt,[y(p(Wa),{value:l.server.description},null,8,["value"])])])):C("",!0)],8,Jt)):C("",!0)],2)}}}),Me=N(el,[["__scopeId","data-v-bf29cdce"]]),al=["onClick"],tl={class:"flex h-4 w-4 items-center justify-center"},ll=$({__name:"ServerDropdown",props:{collection:{},operation:{},server:{},target:{}},setup(e){const{layout:a}=de(),{servers:t,collectionMutators:n,events:o,serverMutators:i}=j(),v=w(()=>{var s,l;return(l=(s=e.operation)==null?void 0:s.servers)==null?void 0:l.map(h=>{var k;return{id:h,label:((k=t[h])==null?void 0:k.url)??"Unknown server"}})}),u=w(()=>{var s,l;return(l=(s=e.collection)==null?void 0:s.servers)==null?void 0:l.filter(h=>{var k,H;return!((H=(k=e.operation)==null?void 0:k.servers)!=null&&H.includes(h))}).map(h=>{var k;return{id:h,label:((k=t[h])==null?void 0:k.url)??"Unknown server"}})}),m=w(()=>{var s,l;return((s=v.value)==null?void 0:s.length)&&((l=u.value)==null?void 0:l.length)});te([()=>e.collection,()=>e.operation],([s,l])=>{var h;if(!s||s.selectedServerUid||l!=null&&l.selectedServerUid)return;const k=(h=e.collection.servers)==null?void 0:h[0];k&&n.edit(e.collection.uid,"selectedServerUid",k)});const r=()=>o.commandPalette.emit({commandName:"Add Server"}),d=w(()=>{var s,l,h;return(l=(s=e.server)==null?void 0:s.url)!=null&&l.endsWith("/")?e.server.url.slice(0,-1):((h=e.server)==null?void 0:h.url)||""}),x=(s,l)=>{if(!e.server)return;const h=e.server.variables||{};h[s]={...h[s],default:l},i.edit(e.server.uid,"variables",h)};return(s,l)=>
2(c(),S(p(Ja),{class:"max-h-[inherit] p-0 text-sm",focus:"",offset:0,placement:"bottom-start",resize:"",target:s.target,teleport:`#${s.target}`},{popover:g(({close:h})=>[b("div",{class:"custom-scroll flex max-h-[inherit] flex-col gap-1 border-t p-1",onClick:h},[(c(!0),T(D,null,Q(v.value,k=>(c(),S(Me,{key:k.id,collection:s.collection,operation:s.operation,server:s.server,serverOption:k,type:"request","onUpdate:variable":x},null,8,["collection","operation","server","serverOption"]))),128)),m.value?(c(),T(D,{key:0},[y(p($a)),l[2]||(l[2]=b("div",{class:"text-xxs text-c-2 px-2.5 py-1"},"Collection",-1))],64)):C("",!0),(c(!0),T(D,null,Q(u.value,k=>(c(),S(Me,{key:k.id,collection:s.collection,operation:s.operation,server:s.server,serverOption:k,type:"collection","onUpdate:variable":x},null,8,["collection","operation","server","serverOption"]))),128)),p(a)!=="modal"?(c(),T("button",{key:1,class:"text-xxs p-1.75 hover:bg-b-2 flex cursor-pointer items-center gap-1.5 rounded",type:"button",onClick:r},[b("div",tl,[y(p(I),{icon:"Add",size:"sm"})]),l[3]||(l[3]=b("span",null,"Add Server",-1))])):C("",!0)],8,al)]),backdrop:g(()=>[y(p(Ze),{class:"-top-[--scalar-address-bar-height] rounded-lg"})]),default:g(()=>[y(p(Y),{class:"gap-0.75 z-context-plus h-6.5 hover:bg-b-2 font-code ml-0.75 text-c-2 whitespace-nowrap rounded border px-1.5 text-xs lg:text-sm",variant:"ghost"},{default:g(()=>{var h;return[(h=s.operation)!=null&&h.selectedServerUid||s.collection.selectedServerUid?(c(),T(D,{key:0},[l[0]||(l[0]=b("span",{class:"sr-only"},"Server:",-1)),R(" "+B(d.value),1)],64)):(c(),T(D,{key:1},[l[1]||(l[1]=b("span",{class:"sr-only"},"Add Server",-1)),y(p(I),{icon:"Add",size:"xs"})],64))]}),_:1})]),_:1},8,["target","teleport"]))}}),ol=(e,a=2)=>e>1e3?(e/1e3).toFixed(a)+"s":e+"ms",rl={100:{color:"text-yellow"},200:{color:"text-green"},202:{color:"text-green"},300:{color:"text-blue"},304:{color:"text-blue"},400:{color:"text-red"},401:{color:"text-orange"},422:{color:"text-yellow"},423:{color:"text-purple"},505:{color:"text-orange"}},nl=e=>rl[e]||{color:"text-grey"},sl={class:"min-w-0"},il={class:"text-c-1 min-w-0 truncate"},dl=$({__name:"AddressBarHistory",props:{operation:{},target:{}},setup(e){const{requestHistory:a,requestExampleMutators:t}=j(),n=ze(),o=w(()=>a.filter(v=>v.request.requestUid===e.operation.uid).slice().reverse());function i(v){const u=n.currentRoute.value.params.workspace;e.operation.uid!==v.request.requestUid&&n.push({name:"request",params:{[Ae.Workspace]:u,[Ae.Request]:v.request.requestUid}}),t.set({...v.request})}return(v,u)=>(c(),S(p(qa),{as:"div"},{default:g(({open:m})=>[y(p(_a),{offset:0,resize:"",target:v.target},ye({default:g(()=>{var r;return[(r=o.value)!=null&&r.length?(c(),S(p(Ra),{key:0,class:"address-bar-history-button z-context-plus text-c-3 focus:text-c-1 relative mr-1 rounded-lg p-1.5"},{default:g(()=>[y(p(I),{icon:"History",size:"sm",thickness:"2.25"}),u[0]||(u[0]=b("span",{class:"sr-only"},"Request History",-1))]),_:1})):C("",!0)]}),_:2},[m?{name:"floating",fn:g(({width:r})=>[y(p(Aa),{class:"custom-scroll p-0.75 grid max-h-[inherit] grid-cols-[44px,1fr,repeat(3,auto)] items-center border-t",static:"",style:ne({width:r})},{default:g(()=>[(c(!0),T(D,null,Q(o.value,(d,x)=>(c(),S(p(Va),{key:d.timestamp,as:"button",class:"font-code *:ui-active:bg-b-2 text-c-2 contents text-sm font-medium *:flex *:h-8 *:cursor-pointer *:items-center *:rounded-none *:px-1.5 first:*:rounded-l last:*:rounded-r",value:x,onClick:s=>i(d)},{default:g(()=>{var s;return[d.response.method?(c(),S(ta,{key:0,class:"text-[11px]",method:d.response.method},null,8,["method"])):C("",!0),b("div",sl,[b("div",il,B(d.response.path),1)]),b("div",null,B(p(ol)(d.response.duration)),1),b("div",{class:O([p(nl)(d.response.status).color])},B(d.response.status),3),b("div",null,B((s=p(oa)[d.response.status])==null?void 0:s.name),1)]}),_:2},1032,["value","onClick"]))),128))]),_:2},1032,["style"]),y(p(Ze),{class:"-top-[--scalar-address-bar-height] rounded-lg"})]),key:"0"}:void 0]),1032,["target"])]),_:1}))}}),cl=N(dl,[["__scopeId","data-v-50597ffd"]]),ul=["id"],pl={class:"m-auto flex flex-row items-center"},ml={class:"address-bar-bg-states text-xxs p-0.75 group relative order-last flex w-full max-w-[calc(100dvw-24px)] flex-1 flex-row items-stretch rounded-lg lg:order-none lg:min-w-[580px] lg:max-w-[580px] xl:min-w-[720px] xl:max-w-[720px]"},vl={class:"pointer-events-none absolute left-0 top-0 block h-full w-full overflow-hidden rounded-lg border"},fl={class:"z-context-plus flex gap-1"},bl={class:"scroll-timeline-x scroll-timeline-x-hidden z-context-plus relative flex w-full bg-blend-normal"},hl={"aria-hidden":"true",class:"inline-flex items-center gap-1"},gl={class:"sr-only"},yl=$({__name:"AddressBar",props:{collection:{},operation:{},server:{},environment:{},envVariables:{},workspace:{}},emits:["importCurl"],setup(e){const a=xe(),{requestMutators:t,events:n}=j(),{layout:o}=de(),i=M(null),v=M(null),u=U=>{e.operation.path!==U&&t.edit(e.operation.uid,"path",U)};te(()=>e.operation.path,U=>{U&&u(U)});const m=M(100),r=M(0),d=M(!1),x=M();function s(){d.value?m.value-=(m.value-15)/60:m.value-=r.value/20,m.value<=0&&(clearInterval(x.value),x.value=void 0,m.value=100,d.value=!1)}function l(){x.value||(d.value=!0,x.value=setInterval(s,20))}function h(){r.value=m.value,d.value=!1}function k(){clearInterval(x.value),x.value=void 0,m.value=100,d.value=!1}n.requestStatus.on(U=>{U==="start"&&l(),U==="stop"&&h(),U==="abort"&&k()}),n.focusAddressBar.on(()=>{var U,q,J;o==="modal"?(q=(U=v.value)==null?void 0:U.$el)==null||q.focus():(J=i.value)==null||J.focus()});function H(U){t.edit(e.operation.uid,"method",U)}function A(){const{method:U}=e.operation;return Ea[U].backgroundColor}function _(){d.value||(d.value=!0,n.executeRequest.emit({requestUid:e.operation.uid}))}
2n.hotKeys.on(U=>{var q;U!=null&&U.focusAddressBar&&((q=i.value)==null||q.focus()),U!=null&&U.executeRequest&&_()});function L(U){t.edit(e.operation.uid,"path",U)}return(U,q)=>{var J;return c(),T("div",{id:p(a),class:"scalar-address-bar order-last h-[--scalar-address-bar-height] w-full [--scalar-address-bar-height:32px] lg:order-none lg:w-auto"},[b("div",pl,[b("div",ml,[b("div",vl,[b("div",{class:O(["bg-mix-transparent bg-mix-amount-90 absolute left-0 top-0 z-[1002] h-full w-full",A()]),style:ne({transform:`translate3d(-${m.value}%,0,0)`})},null,6)]),b("div",fl,[y(ta,{isEditable:p(o)!=="modal",isSquare:"",method:U.operation.method,teleport:"",onChange:H},null,8,["isEditable","method"])]),b("div",bl,[U.collection.servers.length?(c(),S(p(ll),{key:0,collection:U.collection,layout:"client",operation:U.operation,server:U.server,target:p(a)},null,8,["collection","operation","server","target"])):C("",!0),q[1]||(q[1]=b("div",{class:"fade-left"},null,-1)),y(he,{ref_key:"addressBarRef",ref:i,"aria-label":"Path",class:"min-w-fit outline-none",disableCloseBrackets:"",disabled:p(o)==="modal",disableEnter:"",disableTabIndent:"",emitOnBlur:!1,envVariables:U.envVariables,environment:U.environment,importCurl:"",modelValue:U.operation.path,placeholder:(J=U.server)!=null&&J.uid&&U.collection.servers.includes(U.server.uid)?"":"Enter a URL or cURL command",server:"",workspace:U.workspace,onCurl:q[0]||(q[0]=f=>U.$emit("importCurl",f)),onSubmit:_,"onUpdate:modelValue":L},null,8,["disabled","envVariables","environment","modelValue","placeholder","workspace"]),q[2]||(q[2]=b("div",{class:"fade-right"},null,-1))]),y(cl,{operation:U.operation,target:p(a)},null,8,["operation","target"]),y(p(Y),{ref_key:"sendButtonRef",ref:v,class:"z-context-plus relative h-auto shrink-0 overflow-hidden py-1 pl-2 pr-2.5 font-bold",disabled:d.value,onClick:_},{default:g(()=>{var f;return[b("span",hl,[y(p(I),{class:"relative shrink-0 fill-current",icon:"Play",size:"xs"}),q[3]||(q[3]=b("span",{class:"text-xxs hidden lg:flex"},"Send",-1))]),b("span",gl," Send "+B(U.operation.method)+" request to "+B(((f=U.server)==null?void 0:f.url)??"")+B(U.operation.path),1)]}),_:1},8,["disabled"])])])],8,ul)}}}),xl=N(yl,[["__scopeId","data-v-37854d17"]]);var sa="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",De=new RegExp("^"+sa+"$"),Oe="|&;()<> \\t",Tl='"((\\\\"|[^"])*?)"',Sl="'((\\\\'|[^'])*?)'",Hl=/^#$/,Fe="'",Ne='"',we="$",le="",wl=4294967296;for(var Ie=0;Ie<4;Ie++)le+=(wl*Math.random()).toString(16);var kl=new RegExp("^"+le);function Ul(e,a){for(var t=a.lastIndex,n=[],o;o=a.exec(e);)n.push(o),a.lastIndex===o.index&&(a.lastIndex+=1);return a.lastIndex=t,n}function Pl(e,a,t){var n=typeof e=="function"?e(t):e[t];return typeof n>"u"&&t!=""?n="":typeof n>"u"&&(n="$"),typeof n=="object"?a+le+JSON.stringify(n)+le:a+n}function Bl(e,a,t){t||(t={});var n=t.escape||"\\",o="(\\"+n+`['"`+Oe+`]|[^\\s'"`+Oe+"])+",i=new RegExp(["("+sa+")","("+o+"|"+Tl+"|"+Sl+")+"].join("|"),"g"),v=Ul(e,i);if(v.length===0)return[];a||(a={});var u=!1;return v.map(function(m){var r=m[0];if(!r||u)return;if(De.test(r))return{op:r};var d=!1,x=!1,s="",l=!1,h;function k(){h+=1;var _,L,U=r.charAt(h);if(U==="{"){if(h+=1,r.charAt(h)==="}")throw new Error("Bad substitution: "+r.slice(h-2,h+1));if(_=r.indexOf("}",h),_<0)throw new Error("Bad substitution: "+r.slice(h));L=r.slice(h,_),h=_}else if(/[*@#?$!_-]/.test(U))L=U,h+=1;else{var q=r.slice(h);_=q.match(/[^\w\d_]/),_?(L=q.slice(0,_.index),h+=_.index-1):(L=q,h=r.length)}return Pl(a,"",L)}for(h=0;h<r.length;h++){var H=r.charAt(h);if(l=l||!d&&(H==="*"||H==="?"),x)s+=H,x=!1;else if(d)H===d?d=!1:d==Fe?s+=H:H===n?(h+=1,H=r.charAt(h),H===Ne||H===n||H===we?s+=H:s+=n+H):H===we?s+=k():s+=H;else if(H===Ne||H===Fe)d=H;else{if(De.test(H))return{op:r};if(Hl.test(H)){u=!0;var A={comment:e.slice(m.index+h+1)};return s.length?[s,A]:[A]}else H===n?x=!0:H===we?s+=k():s+=H}}return l?{op:"glob",pattern:s}:s}).reduce(function(m,r){return typeof r>"u"?m:m.concat(r)},[])}var Cl=function(a,t,n){var o=Bl(a,t,n);return typeof t!="function"?o:o.reduce(function(i,v){if(typeof v=="object")return i.concat(v);var u=v.split(RegExp("("+le+".*?"+le+")","g"));return u.length===1?i.concat(u[0]):i.concat(u.filter(Boolean).map(function(m){return kl.test(m)?JSON.parse(m.split(le)[1]):m}))},[])},zl=Cl;function Wl(e){const a=zl(e).map(i=>typeof i=="object"&&"op"in i&&i.op==="glob"?i.pattern.trim():typeof i=="string"?i.trim():i).filter(i=>i!==""),t={url:""},n=a[Symbol.iterator]();let o=n.next().value;for(;o;)o==="-X"||o==="--request"?$l(n,t):o==="--url"?Le(n,t):o==="-H"||o==="--header"?_l(n,t):o==="--data"||o==="-d"||o==="--data-raw"||o==="--data-urlencode"||o==="--data-binary"||o==="--data-ascii"?El(n,t,e):typeof o=="str
2ing"&&!t.url&&(o.startsWith("http")||o.startsWith("www."))?Le([o][Symbol.iterator](),t):o==="-P"?Rl(n,t):typeof o=="string"&&o.toLowerCase().includes("content-type")?Al(o,t):o==="-u"||o==="--user"?Vl(n,t):(o==="-b"||o==="--cookie")&&ql(n,t),o=n.next().value;return t}function $l(e,a){a.method=e.next().value.toLowerCase()}function Le(e,a){const t=new URL(e.next().value.replace(/['"]/g,""));a.servers=[t.origin],a.path=t.pathname!=="/"?t.pathname:"",a.url=a.servers[0]+a.path;const n=ia(t.search);a.queryParameters=a.queryParameters?[...a.queryParameters,...n]:n}function _l(e,a){const t=e.next().value.split(/:(.*)/);a.headers=a.headers||{},t[1]!==void 0?a.headers[t[0].trim()]=t[1].trim():a.headers[t[0].trim()]=""}function Rl(e,a){const t=e.next().value.replace(/['"]/g,"").split("=");a.pathVariables=a.pathVariables||{},t[1]!==void 0?a.pathVariables[t[0].trim()]=t[1].trim():a.pathVariables[t[0].trim()]=""}function ia(e){const a=[];return new URL(e,"http://example.com").searchParams.forEach((t,n)=>{a.push({key:n,value:t})}),a}function Al(e,a){const t=e.replace(/['"]/g,"").split(/:(.+)/);a.headers=a.headers||{},t[0]&&(t[1]!==void 0?a.headers[t[0].trim()]=t[1].trim():a.headers[t[0].trim()]="")}function Vl(e,a){const t=e.next().value;try{const n=btoa(t);a.headers=a.headers||{},a.headers.Authorization=`Basic ${n}`}catch(n){console.warn("Could not base64 encode these HTTP basic auth credentials:",t,n)}}function ql(e,a){const t=e.next().value;a.headers=a.headers||{},a.headers.Cookie?a.headers.Cookie+=`; ${t}`:a.headers.Cookie=t.replace(/;$/,"")}function El(e,a,t){const n=e.next().value;if(typeof n=="string"&&(n.startsWith("@")?a.body="":a.body=n,!a.url||t.includes("-G"))){const o=ia(`?${a.body}`);a.queryParameters=a.queryParameters?[...a.queryParameters,...o]:o}}function Ml(e){try{return JSON.parse(e)}catch{const a={};return e.split("&").forEach(t=>{const[n,o]=t.split("=");n&&o&&(a[decodeURIComponent(n)]=decodeURIComponent(o))}),a}}function Dl(e){const a=Wl(e),{method:t="get",url:n,body:o="",headers:i={},servers:v,queryParameters:u=[]}=a,m=new URL(n).pathname,r=o!=null&&o.includes("=")&&!o.startsWith("{")?"application/x-www-form-urlencoded":i["Content-Type"]||"",d=o?Ml(o):{},x=[...Array.isArray(u)?u.map(({key:s,value:l})=>({name:s,in:"query",schema:{type:typeof l,examples:[l]}})):[],...Object.entries(i||{}).map(([s,l])=>({name:s,in:"header",schema:{type:typeof l},example:l}))];return{method:t,url:n,path:m,headers:i,servers:v??[],...Object.keys(d).length>0&&{requestBody:{content:{[r]:{schema:{type:"object",properties:Object.fromEntries(Object.entries(d).map(([s,l])=>[s,{type:typeof l}]))},example:d}}}},parameters:x}}const Ol={class:"lg:min-h-client-header t-app__top-container border-b-1/2 flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1"},Fl={class:"mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1"},Nl={class:"mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5"},Il=$({__name:"RequestSubpageHeader",props:{collection:{},operation:{},server:{},environment:{},envVariables:{},workspace:{}},emits:["hideModal","importCurl"],setup(e){const{hideClientButton:a,showSidebar:t,integration:n}=j(),{isSidebarOpen:o}=Qe(),{layout:i}=de(),{currentRoute:v}=ze();return(u,m)=>(c(),T("div",Ol,[b("div",Fl,[p(t)?(c(),T("div",{key:0,class:O(["size-8",{hidden:p(i)==="modal"&&!p(o)}])},null,2)):C("",!0)]),y(xl,{collection:u.collection,envVariables:u.envVariables,environment:u.environment,operation:u.operation,server:u.server,workspace:u.workspace,onImportCurl:m[0]||(m[0]=r=>u.$emit("importCurl",r))},null,8,["collection","envVariables","environment","operation","server","workspace"]),b("div",Nl,[p(i)==="modal"&&u.collection.documentUrl&&!p(a)?(c(),S(p(Ma),{key:0,buttonSource:"modal",class:"!w-fit lg:-mr-1",integration:p(n)??u.collection.integration??null,source:p(v).query.source==="gitbook"?"gitbook":"api-reference",url:u.collection.documentUrl},null,8,["integration","source","url"])):C("",!0),p(i)==="modal"?(c(),T("button",{key:1,class:"app-exit-button gitbook-hidden zoomed:static zoomed:p-1 fixed right-2 top-2 rounded-full p-2",type:"button",onClick:m[1]||(m[1]=r=>u.$emit("hideModal"))},[y(p(I),{icon:"Close",size:"lg",thickness:"2"}),m[3]||(m[3]=b("span",{class:"sr-only"},"Close Client",-1))])):C("",!0),p(i)==="modal"?(c(),T("button",{key:2,class:"text-c-1 hover:bg-b-2 active:text-c-1 gitbook-show -mr-1.5 rounded p-2",type:"button",onClick:m[2]||(m[2]=r=>u.$emit("hideModal"))},[y(p(I),{icon:"Close",size:"md",thickness:"1.75"}),m[4]||(m[4]=b("span",{class:"sr-only"},"Close Client",-1))])):C("",!0)])]))}}),Ll=N(Il,[["__scopeId","data-v-ad3dcf8d"]]),jl={class:"flex-1 whitespace-nowrap px-2 py-1.5"},se=$({__name:"DataTableText",props:{text:{}},setup(e){return(a,t)=>(c(),S(ce,{class:"relative flex"},{default:g(()=>[b("span",jl,[ae(a.$slots,"default",{},()=>[R(B(a.text),1)])])]),_:3}))}}),Kl=["href"],We=$({__name:"HelpfulLink",props:{href:{}},setup(e){return(a,t)=>(c(),T("a",{class:"decoration-c-3 cursor-help underline underline-offset-2",href:a.href,rel:"noopener noreferrer",target:"_blank"},[ae(a.$slots,"default")],8,Kl))}}),da=[{name:"Accept",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept"},{name:"Accept-CH",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-CH"},{name:"Accept-CH-Lifetime",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-CH-Lifetime"},{name:"Accept-Charset",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Charset"},{name:"Accept-Encoding",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding"},{name:"Accept-Language",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Language"},{name:"Accept-Patch",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Patch"},{name:"Accept-Post",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Post"},{name:"Accept-Ranges",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Ranges"}
2,{name:"Access-Control-Allow-Credentials",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Credentials"},{name:"Access-Control-Allow-Headers",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers"},{name:"Access-Control-Allow-Methods",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Methods"},{name:"Access-Control-Allow-Origin",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Origin"},{name:"Access-Control-Expose-Headers",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Expose-Headers"},{name:"Access-Control-Max-Age",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Max-Age"},{name:"Access-Control-Request-Headers",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Headers"},{name:"Access-Control-Request-Method",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Request-Method"},{name:"Age",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Age"},{name:"Allow",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow"},{name:"Alt-Svc",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc"},{name:"Alt-Used",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Used"},{name:"Authorization",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Authorization"},{name:"Cache-Control",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control"},{name:"Clear-Site-Data",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Clear-Site-Data"},{name:"Connection",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection"},{name:"Content-Disposition",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Disposition"},{name:"Content-DPR",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-DPR"},{name:"Content-Encoding",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding"},{name:"Content-Language",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Language"},{name:"Content-Length",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Length"},{name:"Content-Location",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Location"},{name:"Content-Range",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range"},{name:"Content-Security-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy"},{name:"Content-Security-Policy-Report-Only",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only"},{name:"Content-Type",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type"},{name:"Cookie",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cookie"},{name:"Critical-CH",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Critical-CH"},{name:"Cross-Origin-Embedder-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy"},{name:"Cross-Origin-Opener-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Opener-Policy"},{name:"Cross-Origin-Resource-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Resource-Policy"},{name:"Date",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date"},{name:"Device-Memory",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Device-Memory"},{name:"Digest",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Digest"},{name:"DNT",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DNT"},{name:"Downlink",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Downlink"},{name:"DPR",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/DPR"},{name:"Early-Data",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Early-Data"},{name:"ECT",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ECT"},{name:"ETag",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"},{name:"Expect",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect"},{name:"Expect-CT",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expect-CT"},{name:"Expires",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires"},{name:"Forwarded",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Forwarded"},{name:"From",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/From"},{name:"Host",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host"},{name:"If-Match",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match"},{name:"If-Modified-Since",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since"},{name:"If-None-Match",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match"},{name:"If-Range",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Range"},{name:"If-Unmodified-Since",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Unmodified-Since"},{name:"Keep-Alive",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive"},{name:"Large-Allocation",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Large-Allocation"},{name:"Last-Modified",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Last-Modified"},{name:"Link",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Link"},{name:"Location",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Location"},{name:"Max-Forwards",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Max-Forwards"},{name:"NEL",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/NEL"},{name:"Origin",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin"},{name:"Permissions-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Permissions-Policy"},{name:"Pragma",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Pragma"},{name:"Proxy-Authenticate",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authenticate"},{name:"Proxy-Authorization",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Proxy-Authorization"},{name:"Range",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range"},{name:"Referer",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referer"},{name:"Referrer-Policy",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy"},{name:"Retry-After",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After"},{name:"RTT",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/RTT"},{name:"Save-Data",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Save-Data"},{name:"Sec-CH-Prefers-Reduced-Motion",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion"},{name:"Sec-CH-Prefers-Reduced-Transparency",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Transparency"},{name:"Sec-CH-UA",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA"},{name:"Sec-CH-UA-Arch",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Arch"},{name:"Sec-CH-UA-Bitness",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Bitness"},{name:"Sec-CH-UA-Full-Version",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version"},{name:"Sec-CH-UA-Full-Version-List",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Full-Version-List"},{name:"Sec-CH-UA-Mobile",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Mobile"},{name:"Sec-CH-UA-Model",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Model"},{name:"Sec-CH-UA-Platform",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform"},{name:"Sec-CH-UA-Platform-Version",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-UA-Platform-Version"},{name:"Sec-Fetch-Dest",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Dest"},{name:"Sec-Fetch-Mode",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Mode"},{name:"Sec-Fetch-Site",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-Site"},{name:"Sec-Fetch-User",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Fetch-User"},{name:"Sec-GPC",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-GPC"},{name:"Sec-Purpose",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-Purpose"},{name:"Sec-WebSocket-Accept",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-WebSocket-Accept"},{name:"Server",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server"},{name:"Server-Timing",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing"},{name:"Service-Worker-Navigation-Preload",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Service-Worker-Navigation-Preload"},{name:"Set-Cookie",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie"},{name:"SourceMap",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/SourceMap"},{name:"Strict-Transport-Security",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security"},{name:"TE",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/TE"},{name:"Timing-Allow-Origin",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin"},{name:"Tk",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Tk"},{name:"Trailer",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer"},{name:"Transfer-Encoding",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Transfer-Encoding"},{name:"Upgrade",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade"},{name:"Upgrade-Insecure-Requests",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Upgrade-Insecure-Requests"},{name:"User-Agent",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent"},{name:"Vary",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Vary"},{name:"Via",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Via"},{name:"Viewport-Width",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Viewport-Width"},{name:"Want-Digest",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Want-Digest"},{name:"Warning",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning"},{name:"Width",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Width"},{name:"WWW-Authenticate",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/WWW-Authenticate"},{name:"X-Content-Type-Options",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options"},{name:"X-DNS-Prefetch-Control",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-DNS-Prefetch-Control"},{name:"Non-standard",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Non-standard"},{name:"X-Forwarded-For",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For"},{name:"Non-standard",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Non-standard"},{name:"X-Forwarded-Host",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host"},{name:"Non-standard",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Non-standard"},{name:"X-Forwarded-Proto",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Proto"},{name:"Non-standard",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Non-standard"},{name:"X-Frame-Options",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options"},{name:"X-XSS-Protection",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-XSS-Protection"},{name:"Cf-Cache-Status",url:"https://developers.cloudflare.com/cache/concepts/default-cache-behavior/#cloudflare-cache-responses"},{name:"Cf-Ray",url:"https://developers.cloudflare.com/fundamentals/get
2-started/reference/http-request-headers/#cf-ray"},{name:"Report-To",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/report-to"},{name:"X-Cloud-Trace-Context",url:"https://cloud.google.com/trace/docs/trace-context#legacy-http-header"},{name:"Speculation-Rules",url:"https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Speculation-Rules"}],Gl={key:0,class:"max-h-[calc(100%-32px)] overflow-y-auto border-t"},Xl={key:1,class:"text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"},Yl=$({__name:"RequestHeaders",props:{headers:{}},setup(e){const a=t=>da.find(n=>n.name.toLowerCase()===t.toLowerCase());return(t,n)=>(c(),S(ee,{class:"overflow-auto",defaultOpen:!1,itemCount:t.headers.length},{title:g(()=>n[0]||(n[0]=[R("Request Headers")])),default:g(()=>[t.headers.length?(c(),T("div",Gl,[y(ie,{columns:["minmax(auto, min-content)","minmax(50%, 1fr)"],scroll:""},{default:g(()=>[(c(!0),T(D,null,Q(t.headers,o=>(c(),S(Z,{key:o.name,class:"group/row text-c-1"},{default:g(()=>[y(se,{class:"z-1 bg-b-1 sticky left-0 max-w-48 group-first/row:border-t-0"},{default:g(()=>{var i;return[typeof((i=a(o.name))==null?void 0:i.url)=="string"?(c(),S(We,{key:0,class:"decoration-c-3",href:a(o.name).url},{default:g(()=>[R(B(o.name),1)]),_:2},1032,["href"])):(c(),T(D,{key:1},[R(B(o.name),1)],64))]}),_:2},1024),y(se,{class:"z-0 group-first/row:border-t-0",text:o.value},null,8,["text"])]),_:2},1024))),128))]),_:1})])):(c(),T("div",Xl," No Headers "))]),_:1},8,["itemCount"]))}}),Jl=["download","href"],ca=$({__name:"ResponseBodyDownload",props:{href:{},type:{},filename:{}},setup(e){const a=e,t=w(()=>{var n;const o=((n=la[a.type??""])==null?void 0:n.extension)??".unknown";return a.filename?a.filename:`response${o}`});return(n,o)=>(c(),T("a",{class:"text-c-3 text-xxs hover:bg-b-3 no-underlin flex items-center gap-1 rounded px-1.5 py-0.5",download:`${t.value}`,href:n.href,onClick:o[0]||(o[0]=pe(()=>{},["stop"]))},[y(p(I),{icon:"Download",size:"xs"}),o[1]||(o[1]=b("span",null,[b("span",null,"Download"),b("span",{class:"sr-only"},"Response Body")],-1))],8,Jl))}}),Zl={},Ql={class:"flex justify-center px-2 py-3"},eo={class:"text-c-3 p-2 text-sm"};function ao(e,a){return c(),T("div",Ql,[b("div",eo,[ae(e.$slots,"default")])])}const ua=N(Zl,[["render",ao]]),to=["src"],lo=["src","type"],oo=["src","type"],ro=["data","type"],no=$({__name:"ResponseBodyPreview",props:{src:{},type:{},mode:{},alpha:{type:Boolean,default:!1}},setup(e){const a=M(!1);return te(()=>e.src,()=>a.value=!1),(t,n)=>!a.value&&t.src?(c(),T("div",{key:0,class:O(["flex justify-center overflow-auto rounded-b",{"bg-preview p-2":t.alpha}])},[t.mode==="image"?(c(),T("img",{key:0,class:O(["h-full max-w-full",{rounded:t.alpha}]),src:t.src,onError:n[0]||(n[0]=o=>a.value=!0)},null,42,to)):t.mode==="video"?(c(),T("video",{key:1,autoplay:"",controls:"",width:"100%",onError:n[1]||(n[1]=o=>a.value=!0)},[b("source",{src:t.src,type:t.type},null,8,lo)],32)):t.mode==="audio"?(c(),T("audio",{key:2,class:"my-12",controls:"",onError:n[2]||(n[2]=o=>a.value=!0)},[b("source",{src:t.src,type:t.type},null,8,oo)],32)):(c(),T("object",{key:3,class:"aspect-[4/3] w-full",data:t.src,type:t.type,onError:n[3]||(n[3]=o=>a.value=!0)},null,40,ro))],2)):(c(),S(ua,{key:1},{default:g(()=>n[4]||(n[4]=[R("Preview unavailable")])),_:1}))}}),so=N(no,[["__scopeId","data-v-0956ad2d"]]),io={class:"body-raw grid min-h-0 overflow-hidden p-px outline-none has-[:focus-visible]:outline"},co={key:0,class:"scalar-code-copy"},uo={class:"body-raw-scroller custom-scroll relative overflow-x-auto overscroll-contain",tabindex:"0"},po=$({__name:"ResponseBodyRaw",props:{content:{},language:{}},setup(e){const a=e,t=M(null),{copyToClipboard:n}=Da(),{codeMirror:o}=Oa({codeMirrorRef:t,readOnly:!0,lineNumbers:!0,content:Ve(()=>Fa(a.content)),language:Ve(()=>a.language),forceFoldGutter:!0}),i=()=>{var v;return((v=o.value)==null?void 0:v.state.doc.toString())||""};return(v,u)=>(c(),T("div",io,[i()?(c(),T("div",co,[b("button",{class:"copy-button",type:"button",onClick:u[0]||(u[0]=m=>p(n)(i()))},[u[1]||(u[1]=b("span",{class:"sr-only"},"Copy content",-1)),y(p(I),{icon:"Clipboard",size:"md"})])])):C("",!0),b("div",uo,[b("div",{ref_key:"codeMirrorRef",ref:t},null,512)])]))}}),mo=N(po,[["__scopeId","data-v-96fbecd5"]]),vo={class:"text-c-3 text-xxs -my-1 flex justify-center gap-0.5 rounded p-0.5"},fo=$({__name:"ResponseBodyToggle",props:{modelValue:{type:Boolean}},emits:["update:modelValue"],setup(e){return(a,t)=>(c(),T("div",vo,[b("button",{class:O(["hover:bg-b-3 rounded px-1",{"bg-b-3 text-c-1 cursor-default":a.modelValue}]),type:"button",onClick:t[0]||(t[0]=pe(n=>a.$emit("update:modelValue",!0),["stop"]))}," Preview ",2),b("button",{class:O(["hover:bg-b-3 rounded px-1",{"bg-b-3 text-c-1 cursor-default":!a.modelValue}]),type:"button",onClick:t[1]||(t[1]=pe(n=>a.$emit("update:modelValue",!1),["stop"]))}," Raw ",2)]))}}),bo={key:0,class:"bg-b-1 flex max-h-[calc(100%-32px)] flex-col overflow-hidden"},ho={class:"flex items-center justify-between border-b px-3 py-1.5"},go={class:"text-xxs font-code leading-3"},yo=$({__name:"ResponseBody",props:{title:{},data:{},headers:{}},setup(e){const a=e,t=M(!0),n=w(()=>{var d;return!!((d=r.value)!=null&&d.raw&&r.value.preview)}),o=w(()=>t.value||!n.value),i=w(()=>!t.value||!n.value),{mimeType:v,attachmentFilename:u,dataUrl:m}=ra({data:a.data,headers:a.headers}),r=w(()=>la[v.value.essence]);return(d,x)=>(c(),S(ee,{class:"max-h-content overflow-y-hidden"},ye({title:g(()=>[R(B(d.title),1)]),default:g(()=>{var s,l,h,k;return[d.data?(c(),T("div",bo,[b("div",ho,[b("span",go,B(p(v).essence),1),n.value?(c(),S(fo,{key:0,modelValue:t.value,"onUpdate:modelValue":x[0]||(x[0]=H=>t.value=H)},null,8,["modelValue"])):C("",!0)]),(s=r.value)!=null&&s.raw&&i.value?(c(),S(mo,{key:p(m),content:d.data,language:r.value.language},null,8,["content","language"])):C("",!0),(l=r.value)!=null&&l.preview&&o.value?(c(),S(so,{key:p(m),alpha:r.value.alpha,mode:r.value.preview,src:p(m),type:p(v).essence},null,8,["alpha","mode","src","type"])):C("",!0),!((h=r.value)!=null&&h.raw)&&!((k=r.value)!=null&&k.preview)?(c(),S(ua,{key:2},{default:g(()=>
2x[1]||(x[1]=[R(" Binary file ")])),_:1})):C("",!0)])):C("",!0)]}),_:2},[d.data&&p(m)?{name:"actions",fn:g(()=>[y(ca,{filename:p(u),href:p(m),type:p(v).essence},null,8,["filename","href","type"])]),key:"0"}:void 0]),1024))}}),xo=N(yo,[["__scopeId","data-v-9bbb0b3d"]]),To=$({__name:"ResponseBodyVirtual",props:{content:{},data:{},headers:{}},setup(e){const a=e,t=w(()=>Na(a.content)),{mimeType:n,attachmentFilename:o,dataUrl:i}=ra({data:a.data,headers:a.headers});return(v,u)=>(c(),S(ee,{class:"!max-h-100% response-body-virtual overflow-x-auto"},ye({title:g(()=>[u[0]||(u[0]=R("Body"))]),default:g(()=>[u[1]||(u[1]=b("div",{class:"font-code text-xxs border-1/2 rounded-t border-b-0 px-2.5 py-1.5"}," This response body is massive! Syntax highlighting wonât work here. ",-1)),y(p(et),{containerClass:"custom-scroll scalar-code-block border-1/2 rounded-b flex flex-1 max-h-screen",contentClass:"language-plaintext whitespace-pre font-code text-base",lineHeight:20,text:t.value},null,8,["text"])]),_:2},[p(i)?{name:"actions",fn:g(()=>[y(ca,{filename:p(o),href:p(i),type:p(n).essence},null,8,["filename","href","type"])]),key:"0"}:void 0]),1024))}}),So={key:1,class:"text-c-3 border-t-1/2 bg-b-1 flex min-h-[65px] items-center justify-center px-4 text-sm"},Ho=$({__name:"ResponseCookies",props:{cookies:{}},setup(e){return(a,t)=>(c(),S(ee,{defaultOpen:!1},{title:g(()=>t[0]||(t[0]=[R("Cookies")])),default:g(()=>[(c(),T(D,{key:0},[a.cookies.length?(c(),S(ie,{key:0,class:"flex-1",columns:["",""]},{default:g(()=>[(c(!0),T(D,null,Q(a.cookies,n=>(c(),S(Z,{key:n.name},{default:g(()=>[y(se,{text:n.name},null,8,["text"]),y(se,{text:n.value},null,8,["text"])]),_:2},1024))),128))]),_:1})):(c(),T("div",So," No cookies "))],64))]),_:1}))}}),wo=` .,,uod8B8bou,,. 3 ..,uod8BBBBBBBBBBBBBBBBRPFT?l!i:. 4 ||||||||||||||!?TFPRBBBBBBBBBBBBBBB8m=, 5 |||| '""^^!!||||||||||TFPRBBBVT!:...! 6 |||| '""^^!!|||||?!:.......! 7 |||| ||||.........! 8 |||| ||||.........! 9 |||| ||||.........! 10 |||| ||||.........! 11 |||| ||||.........! 12 |||| ||||.........! 13 ||||, ||||.........\` 14 |||||!!-._ ||||.......;. 15 ':!|||||||||!!-._ ||||.....bBBBBWdou,. 16 bBBBBB86foi!|||||||!!-..:|||!..bBBBBBBBBBBBBBBY! 17 ::!?TFPRBBBBBB86foi!||||||||!!bBBBBBBBBBBBBBBY..! 18 :::::::::!?TFPRBBBBBB86ftiaabBBBBBBBBBBBBBBY....! 19 :::;\`"^!:;::::::!?TFPRBBBBBBBBBBBBBBBBBBBY......! 20 ;::::::...''^::::::::::!?TFPRBBBBBBBBBBY........! 21 .ob86foi;::::::::::::::::::::::::!?TFPRBY..........\` 22 .b888888888886foi;:::::::::::::::::::::::..........\` 23 .b888888888888888888886foi;::::::::::::::::.......... 24.b888888888888888888888888888886foi;:::::::::......\` 25!Tf998888888888888888888888888888888886foi;:::....\`
26 '"^!|Tf9988888888888888888888888888888888!::..\` 27 '"^!|Tf998888888888888888888888889!! '\` 28 '"^!|Tf9988888888888888888!!\` iBBbo. 29 '"^!|Tf998888888889!\` WBBBBbo. 30 '"^!|Tf9989!\` YBBBP^' 31 '"^!\` \` 32`,ko={class:"col-1 flex-center relative gap-6 p-2 capitalize"},Uo={key:0,class:"scalar-version-number"},Po={class:"text-c-3 right-4 mt-auto flex w-full flex-col items-end gap-2 text-sm"},Bo=$({__name:"ResponseEmpty",props:{numWorkspaceRequests:{}},setup(e){const{events:a,requestMutators:t}=j(),n=Ia(),o=ze(),{layout:i}=de(),{activeWorkspace:v,activeCollection:u,activeRequest:m}=ea(),r=()=>{var s,l,h,k,H;if(!((s=u.value)!=null&&s.uid))return;const A=(h=(l=m.value)==null?void 0:l.tags)!=null&&h.length?{tags:m.value.tags[0]?[m.value.tags[0]]:[]}:{},_=t.add(A,(k=u.value)==null?void 0:k.uid);_&&(o.push({name:"request",params:{workspace:(H=v.value)==null?void 0:H.uid,request:_.uid}}),ue(()=>{a.hotKeys.emit({focusAddressBar:new KeyboardEvent("keydown",{key:"l"})})}))},d=s=>{s!=null&&s.createNew&&n.name==="request"&&r()},x="2.3.11";return Be(()=>a.hotKeys.on(d)),Xe(()=>a.hotKeys.off(d)),(s,l)=>(c(),T("div",ko,[b("div",{class:O(["flex h-[calc(100%_-_50px)] flex-col items-center justify-center",{"hidden opacity-0":s.numWorkspaceRequests<=1&&p(i)!=="modal"}])},[p(i)!=="modal"?(c(),T("div",Uo,[R(" Scalar App V"+B(p(x))+" Beta ",1),l[3]||(l[3]=b("div",{class:"mt-2"},[b("a",{href:"https://github.com/scalar/scalar/issues/2669",target:"_blank"}," Roadmap ")],-1))])):C("",!0),l[4]||(l[4]=b("a",{class:"gitbook-show scalar-version-number",href:"https://www.scalar.com",target:"_blank"}," Powered By Scalar.com ",-1)),y(Za,{art:p(wo),class:"text-c-3"},null,8,["art"])],2),p(i)!=="modal"?(c(),T("div",{key:0,class:O(["hidden h-[calc(100%_-_50px)] items-center justify-center pb-5",{"!flex opacity-100":s.numWorkspaceRequests==1}])},[y(ke)],2)):C("",!0),b("div",Po,[p(i)!=="modal"?(c(),T("button",{key:0,class:"flex items-center gap-1.5",type:"button",onClick:l[0]||(l[0]=h=>p(a).commandPalette.emit())},[l[5]||(l[5]=R(" Get Started ")),y(Se,{hotkey:"k"})])):C("",!0),p(i)==="desktop"?(c(),T("button",{key:1,class:"flex items-center gap-1.5",type:"button",onClick:l[1]||(l[1]=h=>r())},[l[6]||(l[6]=R(" New Request ")),y(Se,{hotkey:"N"})])):C("",!0),b("button",{class:"flex items-center gap-1.5",type:"button",onClick:l[2]||(l[2]=h=>p(a).executeRequest.emit())},[l[7]||(l[7]=R(" Send Request ")),y(Se,{hotkey:"âµ"})])])]))}}),Co=N(Bo,[["__scopeId","data-v-1cab2af3"]]),zo={key:0,class:"max-h-[calc(100%-32px)] overflow-y-auto border-t"},Wo={key:1,class:"text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-sm"},$o=$({__name:"ResponseHeaders",props:{headers:{}},setup(e){const a=t=>da.find(n=>n.name.toLowerCase()===t.toLowerCase());return(t,n)=>(c(),S(ee,{class:"overflow-auto",defaultOpen:!1,itemCount:t.headers.length},{title:g(()=>n[0]||(n[0]=[R("Response Headers")])),default:g(()=>[t.headers.length?(c(),T("div",zo,[y(ie,{columns:["minmax(auto, min-content)","minmax(50%, 1fr)"],scroll:""},{default:g(()=>[(c(!0),T(D,null,Q(t.headers,o=>(c(),S(Z,{key:o.name,class:"group/row text-c-1"},{default:g(()=>[y(se,{class:"z-1 bg-b-1 sticky left-0 max-w-48 group-first/row:border-t-0"},{default:g(()=>{var i;return[typeof((i=a(o.name))==null?void 0:i.url)=="string"?(c(),S(We,{key:0,class:"decoration-c-3",href:a(o.name).url},{default:g(()=>[R(B(o.name),1)]),_:2},1032,["href"])):(c(),T(D,{key:1},[R(B(o.name),1)],64))]}),_:2},1024),y(se,{class:"z-0 group-first/row:border-t-0",text:o.value},null,8,["text"])]),_:2},1024))),128))]),_:1})])):(c(),T("div",Wo," No Headers "))]),_:1},8,["itemCount"]))}}),_o={key:0,class:"bg-b-1 absolute inset-0 flex flex-col items-center justify-center gap-6"},Ro=$({__name:"ResponseLoadingOverlay",setup(e){const{events:a}=j(),t=Ka(),n=M();return a.requestStatus.on(o=>{o==="start"?n.value=setTimeout(()=>t.startLoading(),1e3):(clearTimeout(n.value),n.value=void 0,t.stopLoading())}),(o,i)=>(c(),S(ja,null,{default:g(()=>[p(t).isLoading?(c(),T("div",_o,[y(p(La),{class:"text-c-3",loadingState:p(t),size:"3xl"},null,8,["loadingState"]),y(p(Y),{variant:"ghost",onClick:i[0]||(i[0]=v=>p(a).cancelRequest.emit())},{default:g(()=>i[1]||(i[1]=[R(" Cancel ")])),_:1})])):C("",!0)]),_:1}))}}),Ao=N(Ro,[["__scopeId","data-v-50928a7c"]]),Vo=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],qo=["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],Eo=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],Mo=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],je=(e,a,t)=>{let n=e;
32return typeof a=="string"||Array.isArray(a)?n=e.toLocaleString(a,t):(a===!0||t!==void 0)&&(n=e.toLocaleString(void 0,t)),n};function Do(e,a){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);a={bits:!1,binary:!1,space:!0,...a};const t=a.bits?a.binary?Mo:Eo:a.binary?qo:Vo,n=a.space?" ":"";if(a.signed&&e===0)return` 0${n}${t[0]}`;const o=e<0,i=o?"-":a.signed?"+":"";o&&(e=-e);let v;if(a.minimumFractionDigits!==void 0&&(v={minimumFractionDigits:a.minimumFractionDigits}),a.maximumFractionDigits!==void 0&&(v={maximumFractionDigits:a.maximumFractionDigits,...v}),e<1){const d=je(e,a.locale,v);return i+d+n+t[0]}const u=Math.min(Math.floor(a.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),t.length-1);e/=(a.binary?1024:1e3)**u,v||(e=e.toPrecision(3));const m=je(Number(e),a.locale,v),r=t[u];return i+m+n+r}function Oo(e){if(typeof e!="number")throw new TypeError("Expected a number");const a=e>0?Math.floor:Math.ceil;return{days:a(e/864e5),hours:a(e/36e5)%24,minutes:a(e/6e4)%60,seconds:a(e/1e3)%60,milliseconds:a(e)%1e3,microseconds:a(e*1e3)%1e3,nanoseconds:a(e*1e6)%1e3}}const Fo=(e,a)=>a===1?e:`${e}s`,No=1e-7;function Ke(e,a={}){if(!Number.isFinite(e))throw new TypeError("Expected a finite number");a.colonNotation&&(a.compact=!1,a.formatSubMilliseconds=!1,a.separateMilliseconds=!1,a.verbose=!1),a.compact&&(a.secondsDecimalDigits=0,a.millisecondsDecimalDigits=0);const t=[],n=(v,u)=>{const m=Math.floor(v*10**u+No);return(Math.round(m)/10**u).toFixed(u)},o=(v,u,m,r)=>{if((t.length===0||!a.colonNotation)&&v===0&&!(a.colonNotation&&m==="m"))return;r=(r||v||"0").toString();let d,x;if(a.colonNotation){d=t.length>0?":":"",x="";const s=r.includes(".")?r.split(".")[0].length:r.length,l=t.length>0?2:1;r="0".repeat(Math.max(0,l-s))+r}else d="",x=a.verbose?" "+Fo(u,v):m;t.push(d+r+x)},i=Oo(e);if(o(Math.trunc(i.days/365),"year","y"),o(i.days%365,"day","d"),o(i.hours,"hour","h"),o(i.minutes,"minute","m"),a.separateMilliseconds||a.formatSubMilliseconds||!a.colonNotation&&e<1e3)if(o(i.seconds,"second","s"),a.formatSubMilliseconds)o(i.milliseconds,"millisecond","ms"),o(i.microseconds,"microsecond","µs"),o(i.nanoseconds,"nanosecond","ns");else{const v=i.milliseconds+i.microseconds/1e3+i.nanoseconds/1e6,u=typeof a.millisecondsDecimalDigits=="number"?a.millisecondsDecimalDigits:0,m=v>=1?Math.round(v):Math.ceil(v),r=u?v.toFixed(u):m;o(Number.parseFloat(r),"millisecond","ms",r)}else{const v=e/1e3%60,u=typeof a.secondsDecimalDigits=="number"?a.secondsDecimalDigits:1,m=n(v,u),r=a.keepDecimalsOnWholeSeconds?m:m.replace(/\.0+$/,"");o(Number.parseFloat(r),"second","s",r)}if(t.length===0)return"0"+(a.verbose?" milliseconds":"ms");if(a.compact)return t[0];if(typeof a.unitCount=="number"){const v=a.colonNotation?"":" ";return t.slice(0,Math.max(a.unitCount,1)).join(v)}return a.colonNotation?t.join(""):t.join(" ")}const Io={class:"text-c-1 flex gap-1.5"},Lo={key:0},jo={key:0},Ko={key:1},Go=$({__name:"ResponseMetaInformation",props:{response:{}},setup(e){const a=e,{events:t}=j(),n=M(),o=M(0);t.requestStatus.on(u=>{u==="start"?n.value=setInterval(()=>o.value+=1e3,1e3):(clearInterval(n.value),n.value=void 0,o.value=0)});const i=u=>{var m,r;const d=Number.parseInt(((m=u.headers)==null?void 0:m["Content-Length"])||((r=u.headers)==null?void 0:r["content-length"])||"0",10);return d?Do(d):void 0},v=w(()=>{const u=a.response.status;if(u)return oa[u]??void 0});return(u,m)=>(c(),T("div",Io,[n.value&&o.value?(c(),T("span",Lo,B(p(Ke)(o.value)),1)):(c(),T(D,{key:1},[b("span",null,[m[0]||(m[0]=b("span",{class:"sr-only"},"Response Information, Duration:",-1)),R(" "+B(p(Ke)(u.response.duration)),1)]),i(u.response)?(c(),T("span",jo,[m[1]||(m[1]=b("span",{class:"sr-only"},", Size:",-1)),R(" "+B(i(u.response)),1)])):C("",!0),v.value?(c(),T(D,{key:1},[m[2]||(m[2]=b("span",{class:"sr-only"},", Status:",-1)),v.value.url?(c(),S(We,{key:0,class:"flex items-center gap-1.5",href:v.value.url},{default:g(()=>[R(B(u.response.status)+" "+B(v.value.name)+" ",1),b("span",{class:"block h-1.5 w-1.5 rounded-full",style:ne({backgroundColor:v.value.color})},null,4)]),_:1},8,["href"])):(c(),T("span",Ko,[R(B(u.response.status)+" "+B(v.value.name)+" ",1),b("span",{class:"block h-1.5 w-1.5 rounded-full",style:ne({backgroundColor:v.value.color})},null,4)]))],64)):C("",!0)],64))]))}}),Xo={class:"flex h-8 flex-1 items-center"},Yo=["id","role"],Ge=2e5,Jo=$({__name:"ResponseSection",props:{numWorkspaceRequests:{},response:{},requestResult:{}},setup(e){const a=w(()=>{var r;const d=(r=e.response)==null?void 0:r.headers;return d?Object.keys(d).map(x=>({name:x,value:d[x]??"",required:!1})):[]}),t=w(()=>{var r;return((r=e.response)==null?void 0:r.cookieHeaderKeys.flatMap(d=>{var x,s;const l=(s=(x=e.response)==null?void 0:x.headers)==null?void 0:s[d];return l?{name:d,value:l,required:!1}:[]}))??[]}),n=["Cookies","Headers","Body"],o=M("All"),i=w(()=>["All",...n]),v=w(()=>Object.fromEntries(i.value.map(r=>[r,xe()]))),u=w(()=>{var r,d;if(!e.response)return!1;const x=((r=e.response.headers)==null?void 0:r["content-type"])||((d=e.response.headers)==null?void 0:d["Content-Type"]);return!x||(e.response.size??0)<=Ge||x.includes("text/html")?!1:["text/","application/json","application/ld+json","application/problem+json","application/vnd.api+json","application/xml","application/atom+xml","application/rss+xml","application/problem+xml","application/javascript","application/ecmascript","application/x-yaml","application/yaml","application/x-httpd-php","application/x-sh","application/x-perl","application/x-python","application/x-ruby","application/x-java-source","application/x-www-form-urlencoded"].some(s=>x.includes(s))&&(e.response.size??0)>Ge}),m=w(()=>{var r;return((r=e.requestResult)==null?void 0:r.request.parameters.headers.filter(d=>d.enabled).map(d=>({name:d.key,value:d.value,required:!0})))??[]});return(r,d)=>(c(),S(aa,{"aria-label":"Response"},{title:g(()=>
32[b("div",Xo,[b("div",{"aria-live":"polite",class:O(["flex items-center",{"animate-response-heading":r.response}])},[d[1]||(d[1]=b("span",{class:"response-heading pointer-events-none absolute"}," Response ",-1)),r.response?(c(),S(Go,{key:0,class:"animate-response-children",response:r.response},null,8,["response"])):C("",!0)],2),y(na,{modelValue:o.value,"onUpdate:modelValue":d[0]||(d[0]=x=>o.value=x),filterIds:v.value,filters:i.value},null,8,["modelValue","filterIds","filters"])])]),default:g(()=>{var x,s,l;return[b("div",{id:v.value.All,class:O(["custom-scroll response-section-content relative grid h-full justify-stretch",{"content-start":r.response}]),role:o.value==="All"&&r.response?"tabpanel":"none"},[r.response?(c(),T(D,{key:1},[o.value==="All"||o.value==="Cookies"?(c(),S(Ho,{key:0,class:"response-section-content-cookies",id:v.value.Cookies,cookies:t.value,role:o.value==="All"?"none":"tabpanel"},null,8,["id","cookies","role"])):C("",!0),o.value==="All"||o.value==="Headers"?(c(),S(Yl,{key:1,class:"response-section-content-headers",id:v.value.Headers,headers:m.value,role:o.value==="All"?"none":"tabpanel"},null,8,["id","headers","role"])):C("",!0),o.value==="All"||o.value==="Headers"?(c(),S($o,{key:2,class:"response-section-content-headers",id:v.value.Headers,headers:a.value,role:o.value==="All"?"none":"tabpanel"},null,8,["id","headers","role"])):C("",!0),o.value==="All"||o.value==="Body"?(c(),T(D,{key:3},[u.value&&typeof((x=r.response)==null?void 0:x.data)=="string"?(c(),S(To,{key:0,id:v.value.Body,content:r.response.data,data:(s=r.response)==null?void 0:s.data,headers:a.value,role:o.value==="All"?"none":"tabpanel"},null,8,["id","content","data","headers","role"])):(c(),S(xo,{key:1,class:"response-section-content-body",id:v.value.Body,active:!0,data:(l=r.response)==null?void 0:l.data,headers:a.value,role:o.value==="All"?"none":"tabpanel",title:"Body"},null,8,["id","data","headers","role"]))],64)):C("",!0)],64)):(c(),S(Co,{key:0,numWorkspaceRequests:r.numWorkspaceRequests},null,8,["numWorkspaceRequests"])),y(Ao)],10,Yo)]}),_:1}))}}),Zo=N(Jo,[["__scopeId","data-v-fc4ef6e9"]]),Qo={class:"flex h-full"},er={key:0,class:"flex h-full flex-1 flex-col"},ar=$({__name:"Request",props:{invalidParams:{},selectedSecuritySchemeUids:{},requestResult:{}},emits:["newTab"],setup(e){const{events:a}=j(),{isSidebarOpen:t}=Qe(),n=j(),{layout:o}=de(),{activeCollection:i,activeExample:v,activeRequest:u,activeWorkspace:m,activeServer:r,activeEnvVariables:d,activeEnvironment:x,activeWorkspaceRequests:s}=ea(),{modalState:l,requestHistory:h}=n,k=w(()=>h.findLast(A=>{var _;return A.request.uid===((_=v.value)==null?void 0:_.uid)}));function H(A){var _;a.commandPalette.emit({commandName:"Import from cURL",metaData:{parsedCurl:Dl(A),collectionUid:(_=i.value)==null?void 0:_.uid}})}return(A,_)=>p(i)&&p(m)?(c(),T("div",{key:0,class:O(["bg-b-1 relative z-0 flex h-full flex-1 flex-col overflow-hidden pt-0",{"!mb-0 !mr-0 !border-0":p(o)==="modal"}])},[b("div",Qo,[p(u)?(c(),T("div",er,[y(Ll,{modelValue:p(t),"onUpdate:modelValue":_[0]||(_[0]=L=>Ga(t)?t.value=L:null),collection:p(i),envVariables:p(d),environment:p(x),operation:p(u),server:p(r),workspace:p(m),onHideModal:_[1]||(_[1]=()=>p(l).hide()),onImportCurl:H},null,8,["modelValue","collection","envVariables","environment","operation","server","workspace"]),y(pa,null,{default:g(()=>[p(v)?(c(),S(ma,{key:0,class:O(["flex-1",[p(t)?"sidebar-active-hide-layout":""]])},{default:g(()=>{var L;return[y(Gt,{collection:p(i),envVariables:p(d),environment:p(x),example:p(v),invalidParams:A.invalidParams,operation:p(u),selectedSecuritySchemeUids:A.selectedSecuritySchemeUids,server:p(r),workspace:p(m)},null,8,["collection","envVariables","environment","example","invalidParams","operation","selectedSecuritySchemeUids","server","workspace"]),y(Zo,{requestResult:A.requestResult,numWorkspaceRequests:p(s).length,response:(L=k.value)==null?void 0:L.response},null,8,["requestResult","numWorkspaceRequests","response"])]}),_:1},8,["class"])):C("",!0)]),_:1})])):(c(),S(ke,{key:1}))])],2)):(c(),S(ke,{key:1}))}}),vr=N(ar,[["__scopeId","data-v-10fa3cd5"]]);export{vr as default}; 33//# sourceMappingURL=Request.vue-DGIgFDcP.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.