1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8225],{8225:(e,t,l)=>{l.d(t,{A:()=>ef});var a=l(83443),o=l(65488),r=l(13438),s=Object.entries({apiKeyCookie:{label:"API Key in Cookies",payload:{type:"apiKey",in:"cookie",nameKey:"apiKeyCookie"}},apiKeyHeader:{label:"API Key in Headers",payload:{type:"apiKey",in:"header",nameKey:"apiKeyHeader"}},apiKeyQuery:{label:"API Key in Query Params",payload:{type:"apiKey",in:"query",nameKey:"apiKeyQuery"}},httpBasic:{label:"HTTP Basic",payload:{type:"http",scheme:"basic",nameKey:"httpBasic"}},httpBearer:{label:"HTTP Bearer",payload:{type:"http",scheme:"bearer",nameKey:"httpBearer"}},oauth2Implicit:{label:"Oauth2 Implicit Flow",payload:{type:"oauth2",nameKey:"oauth2Implicit",flows:{implicit:{type:"implicit"}}}},oauth2Password:{label:"Oauth2 Password Flow",payload:{type:"oauth2",nameKey:"oauth2Password",flows:{password:{type:"password"}}}},oauth2ClientCredentials:{label:"Oauth2 Client Credentials",payload:{type:"oauth2",nameKey:"oauth2ClientCredentials",flows:{clientCredentials:{type:"clientCredentials"}}}},oauth2AuthorizationFlow:{label:"Oauth2 Authorization Code",payload:{type:"oauth2",nameKey:"oauth2AuthorizationFlow",flows:{authorizationCode:{type:"authorizationCode"}}}}}).map(([e,t])=>({id:e,isDeletable:!1,...t})),n=l(69372),i=e=>({id:e.uid,label:"openIdConnect"===e.type?`${e.nameKey} (coming soon)`:e.nameKey}),u=(e,t)=>i(e.reduce((e,l,a)=>{let o=t[l];return o&&(e.nameKey+=`${a>0?" & ":""}${o.nameKey}`,e.uid=`${e.uid}${a>0?",":""}${o.uid}`),e},{type:"complex",nameKey:"",uid:""})),c=l(63277),d=l(48301),p=l(90613),m=l(52619),f={class:"text-c-2 mb-4 text-sm leading-normal"},y={class:"flex justify-between gap-2"},h=(0,c.pM)({__name:"DeleteRequestAuthModal",props:{state:{},scheme:{}},emits:["close","delete"],setup(e,{emit:t}){let{securitySchemeMutators:l}=(0,o.hA)(),a=()=>{e.scheme?.id&&l.delete(e.scheme.id),t("delete")};return(l,o)=>((0,c.uX)(),(0,c.Wv)((0,d.R1)(m.uT),{size:"xxs",state:e.state,title:"Delete Security Scheme"},{default:(0,c.k6)(()=>[(0,c.Lk)("p",f," This cannot be undone. You're about to delete the "+(0,p.v_)(e.scheme?.label)+" security scheme from the collection. ",1),(0,c.Lk)("div",y,[(0,c.bF)((0,d.R1)(m.RO),{class:"flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",type:"button",variant:"outlined",onClick:o[0]||(o[0]=e=>t("close"))},{default:(0,c.k6)(()=>[...o[1]||(o[1]=[(0,c.eW)(" Cancel ",-1)])]),_:1}),(0,c.bF)((0,d.R1)(m.RO),{class:"flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",type:"submit",onClick:a},{default:(0,c.k6)(()=>[(0,c.eW)(" Delete "+(0,p.v_)(e.scheme?.label),1)]),_:1})])]),_:1},8,["state"]))}}),v=l(35764),b=l(83183),k=l(35333),w=l(86285),x=(e,t,l,{securitySchemeMutators:a,securitySchemes:o},r=!1)=>{if(a.edit(e,t,l),r)try{let a=JSON.parse((0,w.Ar)().getItem(w.tN.AUTH)??"{}"),r=o[e];a&&r?.nameKey&&((a[r.nameKey]||={})[t]=l,(0,w.Ar)().setItem(w.tN.AUTH,JSON.stringify(a)))}catch(e){console.error(e)}},g=l(68404),_=l(80193),C=["for"],R=(0,c.pM)({__name:"RequestAuthDataTableInput",props:{type:{},containerClass:{},required:{type:Boolean,default:!1},modelValue:{},readOnly:{type:Boolean,default:!1},environment:{},envVariables:{},workspace:{}},emits:["update:modelValue","inputFocus","inputBlur","selectVariable"],setup(e,{emit:t}){let l=(0,c.Bi)();return(a,o)=>((0,c.uX)(),(0,c.Wv)(_.A,(0,c.v6)({id:(0,d.R1)(l),canAddCustomEnumValue:!e.readOnly,containerClass:e.containerClass},a.$attrs,{envVariables:e.envVariables,environment:e.environment,lineWrapping:"",modelValue:e.modelValue,readOnly:e.readOnly,required:e.required,type:e.type,workspace:e.workspace,onInputBlur:o[0]||(o[0]=e=>t("inputBlur")),onInputFocus:o[1]||(o[1]=e=>t("inputFocus")),onSelectVariable:o[2]||(o[2]=e=>t("selectVariable",e)),"onUpdate:modelValue":o[3]||(o[3]=e=>t("update:modelValue",e))}),{default:(0,c.k6)(()=>[(0,c.Lk)("label",{for:(0,d.R1)(l)},[(0,c.RG)(a.$slots,"default")],8,C)]),icon:(0,c.k6)(()=>[(0,c.RG)(a.$slots,"icon")]),_:3},16,["id","canAddCustomEnumValue","containerClass","envVariables","environment","modelValue","readOnly","required","type","workspace"]))}}),V=l(7144),A=l(60451),S=l(25454),F=l(75345),E=l(93644),O=e=>{if(!e?.url)return;let t=Object.entries(e.variables??{}).reduce((e,[t,l])=>{let a=l.value||l.default;return a&&(e[t]=a),e},{});return(0,S.qk)(e.url,t)},W=e=>{let t=O(e);return t?(0,F.K)(t)?"u"<typeof window?{}:{basePath:t}:{baseUrl:t}:{}},U=async(e,t)=>{if("plain"===t)return e;if("function"!=typeof crypto?.subtle?.digest)return console.warn("SHA-256 is only supported when using https, using a plain text code challenge instead."),e;let l=new TextEncoder().encode(e),a=await crypto.subtle.digest("SHA-256",l);return(0,V.SM)(new Uint8Array(a),!0)},$=async(e,t,l)=>{try{if(!e)return[Error("Flow not found"),null];let a=e.selectedScopes.join(" ");if("clientCredentials"===e.type||"password"===e.type)return K(e,a,{proxyUrl:l},t);let o=(Math.random()+1).toString(36).substring(2,10),r=(0,E.r)(e.authorizationUrl,W(t)),s=new URL(r),n=null;if("implicit"===e.type)s.searchParams.set("response_type","token");else if("authorizationCode"===e.type&&(s.searchParams.set("response_type","code"),"no"!==e["x-usePkce"])){let t,l=(t=new Uint8Array(32),crypto.getRandomValues(t),(0,V.SM)(t,!0)),a=await U(l,e["x-usePkce"]);n={codeVerifier:l,codeChallenge:a,codeChallengeMethod:"SHA-256"===e["x-usePkce"]?"S256":"plain"}
1,s.searchParams.set("code_challenge",a),s.searchParams.set("code_challenge_method",n.codeChallengeMethod)}if(e["x-scalar-redirect-uri"].startsWith("/")){let l=O(t)||window.location.origin+window.location.pathname,a=(0,E.r)(e["x-scalar-redirect-uri"],{baseUrl:l});s.searchParams.set("redirect_uri",a)}else s.searchParams.set("redirect_uri",e["x-scalar-redirect-uri"]);e["x-scalar-security-query"]&&Object.keys(e["x-scalar-security-query"]).forEach(t=>{let l=e["x-scalar-security-query"]?.[t];l&&s.searchParams.set(t,l)}),s.searchParams.set("client_id",e["x-scalar-client-id"]),s.searchParams.set("state",o),a&&s.searchParams.set("scope",a);let i=window.open(s,"openAuth2Window","left=100,top=100,width=800,height=600");if(i)return new Promise(r=>{let s=setInterval(()=>{let u=null,c=null,d=null,p=null;try{let t=new URL(i.location.href).searchParams,l=e["x-tokenName"]||"access_token";u=t.get(l),c=t.get("code"),d=t.get("error"),p=t.get("error_description");let a=new URLSearchParams(i.location.href.split("#")[1]);u||=a.get(l),c||=a.get("code"),d||=a.get("error"),p||=a.get("error_description")}catch(e){}(i.closed||u||c||d)&&(clearInterval(s),i.close(),d?r([Error(`OAuth error: ${d}${p?` (${p})`:""}`),null]):u?i.location.href.match(/state=([^&]*)/)?.[1]===o?r([null,u]):r([Error("State mismatch"),null]):c?new URL(i.location.href).searchParams.get("state")===o?K(e,a,{code:c,pkce:n,proxyUrl:l},t).then(r):r([Error("State mismatch"),null]):(clearInterval(s),r([Error("Window was closed without granting authorization"),null])))},200)});return[Error("Failed to open auth window"),null]}catch(e){return[Error("Failed to authorize oauth2 flow"),null]}},K=async(e,t,{code:l,pkce:a,proxyUrl:o}={},r)=>{if(!e)return[Error("OAuth2 flow was not defined"),null];let s=new URLSearchParams;s.set("client_id",e["x-scalar-client-id"]),t&&("clientCredentials"===e.type||"password"===e.type)&&s.set("scope",t),e.clientSecret&&(!e["x-scalar-credentials-location"]||"body"===e["x-scalar-credentials-location"])&&s.set("client_secret",e.clientSecret),"x-scalar-redirect-uri"in e&&e["x-scalar-redirect-uri"]&&s.set("redirect_uri",e["x-scalar-redirect-uri"]),l?(s.set("co
1de",l),s.set("grant_type","authorization_code"),a&&s.set("code_verifier",a.codeVerifier)):"password"===e.type?(s.set("grant_type","password"),s.set("username",e.username),s.set("password",e.password)):s.set("grant_type","client_credentials"),e["x-scalar-security-body"]&&Object.entries(e["x-scalar-security-body"]).forEach(([e,t])=>{t&&s.set(e,t)});try{let t={"Content-Type":"application/x-www-form-urlencoded"};e.clientSecret&&(!e["x-scalar-credentials-location"]||"header"===e["x-scalar-credentials-location"])&&(t.Authorization=`Basic ${(0,V.lF)(`${e["x-scalar-client-id"]}:${e.clientSecret}`)}`);let l=(0,E.r)(e.tokenUrl,W(r)),a=(0,A.p)(o,l)?`${o}?${new URLSearchParams([["scalar_url",l]]).toString()}`:l;return[null,(await (await fetch(a,{method:"POST",headers:t,body:s})).json())[e["x-tokenName"]||"access_token"]]}catch{return[Error("Failed to get an access token. Please check your credentials."),null]}},X=l(49559),I=l(88279),P=l(73926),z={class:"flex h-fit w-full"},L={class:"flex-1"},B={class:"flex items-center gap-1.75"},Q={class:"grid auto-rows-auto",style:{gridTemplateColumns:"1fr auto"}},T={key:0},j={class:"font-code text-xs"},q=(0,c.pM)({__name:"OAuthScopesInput",props:{flow:{},updateScheme:{type:Function}},setup(e){let t=(0,c.EW)(()=>Object.entries(e.flow?.scopes??{}).map(([e,t])=>({id:e,label:e,description:t}))),l=(0,c.EW)(()=>e.flow?.selectedScopes||[]),a=(0,c.EW)(()=>e.flow?.selectedScopes?.length===Object.keys(e.flow?.scopes??{}).length),o=()=>{e.updateScheme(`flows.${e.flow.type}.selectedScopes`,Object.keys(e.flow?.scopes??{}))},r=()=>{e.updateScheme(`flows.${e.flow.type}.selectedScopes`,[])};return(s,n)=>((0,c.uX)(),(0,c.Wv)((0,d.R1)(b.A),{class:"h-auto !max-h-[initial] min-h-8 items-center"},{default:(0,c.k6)(()=>[(0,c.Lk)("div",z,[n[2]||(n[2]=(0,c.Lk)("div",{class:"text-c-1 h-full items-center"},null,-1)),(0,c.bF)((0,d.R1)(P.EN),{as:"div",class:"bl flex w-full flex-col"},{default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(P._q),{class:(0,p.C4)(["group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left",(e.flow?.selectedScopes?.length||0)>0?"text-c-1":"text-c-3"])},{default:(0,c.k6)(({open:t})=>[(0,c.Lk)("div",L," Scopes Selected "+(0,p.v_)(e.flow?.selectedScopes?.length||0)+" / "+(0,p.v_)(Object.keys(e.flow?.scopes??{}).length||0),1),(0,c.Lk)("div",B,[a.value?((0,c.uX)(),(0,c.Wv)((0,d.R1)(m.RO),{key:0,class:"pr-0.75 pl-1 transition-none",size:"sm",variant:"ghost",onClick:(0,I.D$)(r,["stop"])},{default:(0,c.k6)(()=>[...n[0]||(n[0]=[(0,c.eW)(" Deselect All ",-1)])]),_:1})):(0,c.Q3)("",!0),a.value?(0,c.Q3)("",!0):((0,c.uX)(),(0,c.Wv)((0,d.R1)(m.RO),{key:1,class:"pr-0.75 pl-1 transition-none",size:"sm",variant:"ghost",onClick:(0,I.D$)(o,["stop"])},{default:(0,c.k6)(()=>[...n[1]||(n[1]=[(0,c.eW)(" Select All ",-1)])]),_:1})),(0,c.bF)((0,d.R1)(m.kv),{class:"text-c-3 group-hover/scopes-accordion:text-c-2",icon:t?"ChevronDown":"ChevronRight",size:"md"},null,8,["icon"])])]),_:1},8,["class"]),(0,c.bF)((0,d.R1)(P.kS),{as:"template"},{default:(0,c.k6)(()=>[(0,c.Lk)("table",Q,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(t.value,({id:t,label:a,description:o})=>((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:t,class:"text-c-2",onClick:a=>{!l.value.includes(t)?e.updateScheme(`flows.${e.flow.type}.selectedScopes`,[...l.value,t]):e.updateScheme(`flows.${e.flow.type}.selectedScopes`,l.value.filter(e=>e!==t))}},{default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(b.A),{class:"hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5"},{default:(0,c.k6)(()=>[o?((0,c.uX)(),(0,c.CE)("div",T,[(0,c.Lk)("span",j,(0,p.v_)(a),1),(0,c.eW)(" â "+(0,p.v_)(o),1)])):(0,c.Q3)("",!0)]),_:2},1024),(0,c.bF)((0,d.R1)(X.A),{modelValue:l.value.includes(t),"onUpdate:modelValue":()=>{}},null,8,["modelValue"])]),_:2},1032,["onClick"]))),128))])]),_:1})]),_:1})])]),_:1}))}}),M=l(90125),N=l(29728),D={class:"flex h-8 items-center justify-end border-t"},H={class:"flex h-8 w-full items-center justify-end border-t"},G=(0,c.pM)({__name:"OAuth2",props:{collection:{},environment:{},envVariables:{},flow:{},persistAuth:{type:Boolean,default:!1},scheme:{},server:{},workspace:{}},emits:["authorized"],setup(e,{emit:t}){let l=(0,m.R2)(),{toast:a}=(0,M.Yf)(),r=(0,o.hA)(),s=(t,l)=>x(e.scheme.uid,t,l,r,e.persistAuth),n=async()=>
1{if(l.isActive||!e.collection?.uid)return;if(!e.server)return void a("No server selected","error");l.start();let[o,r]=await $(e.flow,e.server,e.workspace?.proxyUrl);await l.clear(),r?(s(`flows.${e.flow.type}.token`,r),t("authorized")):(console.error(o),a(o?.message??"Failed to authorize","error"))},i={environment:e.environment,envVariables:e.envVariables,workspace:e.workspace};return(t,a)=>((0,c.uX)(),(0,c.CE)(c.FK,null,[e.flow.token?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{class:"border-r-transparent",modelValue:e.flow.token,placeholder:"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",type:"password","onUpdate:modelValue":a[0]||(a[0]=t=>s(`flows.${e.flow.type}.token`,t))}),{default:(0,c.k6)(()=>[...a[10]||(a[10]=[(0,c.eW)(" Access Token ",-1)])]),_:1},16,["modelValue"])]),_:1}),(0,c.bF)((0,d.R1)(k.A),{class:"min-w-full"},{default:(0,c.k6)(()=>[(0,c.Lk)("div",D,[(0,c.bF)((0,d.R1)(m.RO),{class:"mr-1 p-0 px-2 py-0.5",loader:(0,d.R1)(l),size:"sm",variant:"outlined",onClick:a[1]||(a[1]=t=>s(`flows.${e.flow.type}.token`,""))},{default:(0,c.k6)(()=>[...a[11]||(a[11]=[(0,c.eW)(" Clear ",-1)])]),_:1},8,["loader"]),(0,c.RG)(t.$slots,"oauth-actions")])]),_:3})],64)):((0,c.uX)(),(0,c.CE)(c.FK,{key:1},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>["authorizationUrl"in e.flow?((0,c.uX)(),(0,c.Wv)(R,(0,c.v6)({key:0},i,{containerClass:"border-r-0",modelValue:e.flow.authorizationUrl,placeholder:"https://galaxy.scalar.com/authorize","onUpdate:modelValue":a[2]||(a[2]=t=>s(`flows.${e.flow.type}.authorizationUrl`,t))}),{default:(0,c.k6)(()=>[...a[12]||(a[12]=[(0,c.eW)(" Auth URL ",-1)])]),_:1},16,["modelValue"])):(0,c.Q3)("",!0),"tokenUrl"in e.flow?((0,c.uX)(),(0,c.Wv)(R,(0,c.v6)({key:1},i,{modelValue:e.flow.tokenUrl,placeholder:"https://galaxy.scalar.com/token","onUpdate:modelValue":a[3]||(a[3]=t=>s(`flows.${e.flow.type}.tokenUrl`,t))}),{default:(0,c.k6)(()=>[...a[13]||(a[13]=[(0,c.eW)(" Token URL ",-1)])]),_:1},16,["modelValue"])):(0,c.Q3)("",!0)]),_:1}),"x-scalar-redirect-uri"in e.flow?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:0},{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{modelValue:e.flow["x-scalar-redirect-uri"],placeholder:"https://galaxy.scalar.com/callback","onUpdate:modelValue":a[4]||(a[4]=t=>s(`flows.${e.flow.type}.x-scalar-redirect-uri`,t))}),{default:(0,c.k6)(()=>[...a[14]||(a[14]=[(0,c.eW)(" Redirect URL ",-1)])]),_:1},16,["modelValue"])]),_:1})):(0,c.Q3)("",!0),"password"===e.flow.type?((0,c.uX)(),(0,c.CE)(c.FK,{key:1},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{class:"text-c-2",modelValue:e.flow.username,placeholder:"janedoe","onUpdate:modelValue":a[5]||(a[5]=t=>s(`flows.${e.flow.type}.username`,t))}),{default:(0,c.k6)(()=>[...a[15]||(a[15]=[(0,c.eW)(" Username ",-1)])]),_:1},16,["modelValue"])]),_:1}),(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{modelValue:e.flow.password,placeholder:"********",type:"password","onUpdate:modelValue":a[6]||(a[6]=t=>s(`flows.${e.flow.type}.password`,t))}),{default:(0,c.k6)(()=>[...a[16]||(a[16]=[(0,c.eW)(" Password ",-1)])]),_:1},16,["modelValue"])]),_:1})],64)):(0,c.Q3)("",!0),(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{modelValue:e.flow["x-scalar-client-id"],placeholder:"12345","onUpdate:modelValue":a[7]||(a[7]=t=>s(`flows.${e.flow.type}.x-scalar-client-id`,t))}),{default:(0,c.k6)(()=>[...a[17]||(a[17]=[(0,c.eW)(" Client ID ",-1)])]),_:1},16,["modelValue"])]),_:1}),"clientSecret"in e.flow?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:2},{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{modelValue:e.flow.clientSecret,placeholder:"XYZ123",type:"password","onUpdate:modelValue":a[8]||(a[8]=t=>s(`flows.${e.flow.type}.clientSecret`,t))}),{default:(0,c.k6)(()=>[...a[18]||(a[18]=[(0,c.eW)(" Client Secret ",-1)])]),_:1},16,["modelValue"])]),_:1})):(0,c.Q3)("",!0),"x-usePkce"in e.flow?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:3},{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)(i,{enum:(0,d.R1)(N.I4),modelValue:e.flow["x-usePkce"],readOnly:"","onUpdate:modelValue":a[9]||(a[9]=t=>s(`flows.${e.flow.type}.x-usePkce`,t))}),{default:(0,c.k6)(()=>[...a[19]||(a[19]=[(0,c.eW)(" Use PKCE ",-1)])]),_:1},16,["enum","modelValue"])]),_:1})):(0,c.Q3)("",!0),Object.keys(e.flow.scopes??{}).length?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:4},{default:(0,c.k6)(()=>[(0,c.bF)(q,{flow:e.flow,updateScheme:s},null,8,["flow"])]),_:1})):(0,c.Q3)("",!0)],64)),e.flow.token?(0,c.Q3)("",!0):((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:2,class:"min-w-full"},{default:(0,c.k6)(()=>[(0,c.Lk)("div",H,[(0,c.bF)((0,d.R1)(m.RO),{class:"mr-0.75 p-0 px-2 py-0.5",loader:(0,d.R1)(l),size:"sm",variant:"outlined",onClick:n},{default:(0,c.k6)(()=>[...a[20]||(a[20]=[(0,c.eW)(" Authorize ",-1)])]),_:1},8,["loader"])])]),_:1}))],64))}}),J={class:"bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none"},Y={key:0,class:"flex min-h-8 border-t text-base"},Z={class:"flex h-8 max-w-full gap-2.5 overflow-x-auto px-3"},ee=["onClick"],et={class:"relative z-10"},el=(0,c.pM)({__name:"RequestAuthTab",props:{collection:{},environment:{},envVariables:{},layout:{},persistAuth:{type:Boolean,default:!1},securitySchemeUids:{},server:{},workspace:{}},emits:["authorized"],setup(e,{emit:t}){let l=(0,o.hA)(),{securitySchemes:a}=l,r=(0,c.EW)(()=>e.securitySchemeUids.map(e=>({scheme:a[e]}))),s=(0,d.KR)(""),n=e=>{let t=e.description?`: ${e.description}`:"",l=`${(0,p.ZH)(e.nameKey)}${t||`: ${e.type}`}`;if("apiKey"===e.type)return`${(0,p.ZH)(e.nameKey)}${t||`: ${e.in}`}`;if("oauth2"===e.type){let l=Object.values(e.flows??{})[0];return`${(0,p.ZH)(e.nameKey)}: ${s.value?s.value:l?.type??""}${t}`}return"http"===e.type?`${(0,p.ZH)(e.nameKey)}: ${e.scheme}${t}`:`${l}${t}`},i=(t,a,o)=>{x(t,a,o,l,e.persistAuth)};(0,c.sV)(()=>{e.persistAuth&&((e,t)=>{try{let{collectionMutators:l,securitySchemes:a,securitySchemeMutators:o}=e,r=JSON.parse((0,w.Ar)().getItem(w.tN.AUTH)??"{}"),s=Object.keys(a).reduce((e,t)=>
1{let l=a[t];return l&&(e[l.nameKey]=l.uid),e},{});Object.entries(r).forEach(([e,t])=>{let l=s[e];l&&Object.entries(t).forEach(([e,t])=>{o.edit(l,e,t)})});let n=JSON.parse((0,w.Ar)().getItem(w.tN.SELECTED_SECURITY_SCHEMES)??"[]").map(e=>Array.isArray(e)?e.map(e=>s[e]).filter(g.O):s[e]).filter(g.O);l.edit(t,"selectedSecuritySchemeUids",n)}catch(e){console.error(e)}})(l,e.collection.uid)});let u={environment:e.environment,envVariables:e.envVariables,workspace:e.workspace};return(l,a)=>((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(r.value,({scheme:o})=>((0,c.uX)(),(0,c.CE)(c.FK,{key:o?.uid},[r.value.length>1&&o?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:0},{default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(b.A),{"aria-label":n(o),class:"text-c-2 group/auth flex items-center leading-[22px] whitespace-nowrap outline-none hover:whitespace-normal"},{default:(0,c.k6)(()=>[(0,c.Lk)("p",J,(0,p.v_)(n(o)),1)]),_:2},1032,["aria-label"])]),_:2},1024)):(0,c.Q3)("",!0),o?.description&&r.value.length<=1?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:1},{default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(b.A),{"aria-label":o.description,class:"max-h-[auto]"},{default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(m.IR),{class:"auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",value:o.description},null,8,["value"])]),_:2},1032,["aria-label"])]),_:2},1024)):(0,c.Q3)("",!0),o?.type==="http"?((0,c.uX)(),(0,c.CE)(c.FK,{key:2},["bearer"===o.scheme?((0,c.uX)(),(0,c.Wv)((0,d.R1)(k.A),{key:0},{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)({ref_for:!0},u,{containerClass:"reference"===e.layout&&"border-t",modelValue:o.token,placeholder:"Token",type:"password","onUpdate:modelValue":e=>i(o.uid,"token",e)}),{default:(0,c.k6)(()=>[...a[1]||(a[1]=[(0,c.eW)(" Bearer Token ",-1)])]),_:1},16,["containerClass","modelValue","onUpdate:modelValue"])]),_:2},1024)):o?.scheme==="basic"?((0,c.uX)(),(0,c.CE)(c.FK,{key:1},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)({ref_for:!0},u,{class:"text-c-2",modelValue:o.username,placeholder:"janedoe",required:"","onUpdate:modelValue":e=>i(o.uid,"username",e)}),{default:(0,c.k6)(()=>[...a[2]||(a[2]=[(0,c.eW)(" Username ",-1)])]),_:1},16,["modelValue","onUpdate:modelValue"])]),_:2},1024),(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)({ref_for:!0},u,{modelValue:o.password,placeholder:"********",type:"password","onUpdate:modelValue":e=>i(o.uid,"password",e)}),{default:(0,c.k6)(()=>[...a[3]||(a[3]=[(0,c.eW)(" Password ",-1)])]),_:1},16,["modelValue","onUpdate:modelValue"])]),_:2},1024)],64)):(0,c.Q3)("",!0)],64)):o?.type==="apiKey"?((0,c.uX)(),(0,c.CE)(c.FK,{key:3},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)({ref_for:!0},u,{containerClass:"reference"===e.layout&&"border-t",modelValue:o.name,placeholder:"api-key","onUpdate:modelValue":e=>i(o.uid,"name",e)}),{default:(0,c.k6)(()=>[...a[4]||(a[4]=[(0,c.eW)(" Name ",-1)])]),_:1},16,["containerClass","modelValue","onUpdate:modelValue"])]),_:2},1024),(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[(0,c.bF)(R,(0,c.v6)({ref_for:!0},u,{modelValue:o.value,placeholder:"QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",type:"password","onUpdate:modelValue":e=>i(o.uid,"value",e)}),{default:(0,c.k6)(()=>[...a[5]||(a[5]=[(0,c.eW)(" Value ",-1)])]),_:1},16,["modelValue","onUpdate:modelValue"])]),_:2},1024)],64)):o?.type==="oauth2"?((0,c.uX)(),(0,c.CE)(c.FK,{key:4},[(0,c.bF)((0,d.R1)(k.A),null,{default:(0,c.k6)(()=>[Object.keys(o.flows).length>1?((0,c.uX)(),(0,c.CE)("div",Y,[(0,c.Lk)("div",Z,[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(o?.flows,(t,l,a)=>((0,c.uX)(),(0,c.CE)("button",{key:l,class:(0,p.C4)(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-base font-medium",{"!text-c-1 !rounded-none border-b-[1px] !border-current":"reference"!==e.layout&&(s.value===l||0===a&&!s.value),"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100":"reference"===e.layout&&(s.value===l||0===a&&!s.value)}]),type:"button",onClick:e=>s.value=l},[(0,c.Lk)("span",et,(0,p.v_)(l),1)],10,ee))),128))])])):(0,c.Q3)("",!0)]),_:2},1024),((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(o?.flows,(r,n,i)=>((0,c.uX)(),(0,c.CE)(c.FK,{key:n},[s.value!==n&&(0!==i||s.value)?(0,c.Q3)("",!0):((0,c.uX)(),(0,c.Wv)(G,(0,c.v6)({key:0,ref_for:!0},u,{collection:e.collection,flow:r,persistAuth:e.persistAuth,scheme:o,server:e.server,w
1orkspace:e.workspace,onAuthorized:a[0]||(a[0]=e=>t("authorized"))}),{"oauth-actions":(0,c.k6)(()=>[(0,c.RG)(l.$slots,"oauth-actions")]),_:3},16,["collection","flow","persistAuth","scheme","server","workspace"]))],64))),128))],64)):o?.type==="openIdConnect"?((0,c.uX)(),(0,c.CE)("div",{key:5,class:(0,p.C4)(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t border-b-0 px-4 text-base",{"rounded-b-lg":"reference"===e.layout}])}," Coming soon ",2)):(0,c.Q3)("",!0)],64))),128))}}),ea=["onClick"],eo={class:"relative z-10 font-medium whitespace-nowrap"},er={key:0,class:"absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"},es=(0,c.pM)({__name:"RequestAuthDataTable",props:{collection:{},environment:{},envVariables:{},layout:{default:"client"},persistAuth:{type:Boolean,default:!1},selectedSchemeOptions:{default:()=>[]},server:{},workspace:{}},emits:["authorized","activeSchemes"],setup(e,{emit:t}){let{securitySchemes:l}=(0,o.hA)(),a=(0,m.hS)(),r=(0,d.KR)(null),s=(0,d.KR)(0),n=(0,c.EW)(()=>{if(!e.selectedSchemeOptions||0===e.selectedSchemeOptions.length)return[];let t=e.selectedSchemeOptions[s.value];if(!t)return[];let l=t.id.split(",").filter(Boolean);return l.length>1?l:[t.id]});(0,c.wB)(n,e=>{t("activeSchemes",e.map(e=>l[e]).filter(g.O))},{immediate:!0});let i=(0,c.EW)(()=>n.value.length>0);return(0,c.wB)(()=>e.selectedSchemeOptions,e=>{e&&e[s.value]||(s.value=Math.max(0,s.value-1))}),(l,o)=>((0,c.uX)(),(0,c.CE)("form",{onSubmit:o[2]||(o[2]=(0,I.D$)(()=>{},["prevent"]))},[e.selectedSchemeOptions.length>1?((0,c.uX)(),(0,c.CE)("div",{key:0,class:(0,p.C4)(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3","client"===e.layout&&"border-x-0"])},[((0,c.uX)(!0),(0,c.CE)(c.FK,null,(0,c.pI)(e.selectedSchemeOptions,(e,t)=>((0,c.uX)(),(0,c.CE)("div",{key:e.id,class:(0,p.C4)(["relative z-1 -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer",[s.value===t?"text-c-1":"text-c-3"]])},[(0,c.Lk)("button",{class:"floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",type:"button",onClick:e=>s.value=t},[(0,c.Lk)("span",eo,(0,p.v_)(e.label),1)],8,ea),s.value===t?((0,c.uX)(),(0,c.CE)("div",er)):(0,c.Q3)("",!0)],2))),128))],2)):(0,c.Q3)("",!0),i.value?((0,c.uX)(),(0,c.Wv)((0,d.R1)(v.A),{key:1,class:(0,p.C4)(["flex-1","reference"===e.layout&&"bg-b-1 rounded-b-lg border border-t-0"]),columns:[""],presentational:""},{default:(0,c.k6)(()=>[(0,c.bF)(el,{collection:e.collection,envVariables:e.envVariables,environment:e.environment,layout:e.layout,persistAuth:e.persistAuth,securitySchemeUids:n.value,server:e.server,workspace:e.workspace,onAuthorized:o[0]||(o[0]=e=>t("authorized"))},{"oauth-actions":(0,c.k6)(()=>[(0,c.RG)(l.$slots,"oauth-actions",{},void 0,!0)]),_:3},8,["collection","envVariables","environment","layout","persistAuth","securitySchemeUids","server","workspace"])]),_:3},8,["class"])):((0,c.uX)(),(0,c.CE)("div",{key:2,class:(0,p.C4)(["text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm","reference"===e.layout&&"min-h-[calc(4rem+0.5px)] rounded-b-lg border"])}," No authentication selected ",2)),(0,c.bF)(h,{scheme:r.value,state:(0,d.R1)(a),onClose:o[1]||(o[1]=e=>(0,d.R1)(a).hide())},null,8,["scheme","state"])],32))}}),en=(0,a.A)(es,[["__scopeId","data-v-0bb98074"]]),ei=l(602),eu=l(81835),ec=["id"],ed={class:"flex flex-1"},ep={class:"min-w-0 flex-1 truncate"},em=(0,c.pM)({__name:"RequestAuth",props:{collection:{},isReadOnly:{type:Boolean,default:!1},environment:{},envVariables:{},layout:{},operation:{},persistAuth:{type:Boolean,default:!1},selectedSecuritySchemeUids:{},server:{},title:{},workspace:{}},emits:["authorized","activeSchemes"],setup(e,{emit:t}){let{securitySchemes:l,securitySchemeMutators:a,requestMutators:f,collectionMutators:y}=(0,o.hA)(),v=(0,c.Bi)(),b=(0,d.KR)(null),k=(0,m.hS)(),x=(0,d.KR)(null),g=(0,d.KR)(!1),_=(0,c.EW)(()=>{var t,l;let a=(t=e.operation,l=e.collection,"[{}]"===JSON.stringify(t?.security)&&l?.security?.length?l?.security.find(e=>"{}"===JSON.stringify(e))?l.security:[...l.security,{}]:t?.security??l?.security??[]);return{filteredRequirements:a.filter(e=>Object.keys(e).length),requirements:a}}),C=(0,c.EW)(()=>{let{filteredRequirements:e,requirements:t}=_.value;if(!t.length)return null;let l=!t.some(e=>Object.keys(e).length>1)&&e.length<t.length;return{icon:l?"Unlock":"Lock",text:l?"Optional":"Required"}}),R=(0,c.EW)(()=>e.selectedSecuritySchemeUids.map(e=>{if(Array.isArray(e))return u(e,l);let t=l[e??""];if(t)return i(t)}).filter(n.O9));function V(t){let l=t.find(e=>e.payload),o=t.filter(e=>!e.payload).map(({id:e})=>{let t=e.split(",");return t.length>1?t:e});if(l?.payload){let t=a.add(l.payload,e.collection?.uid);t&&o.push(t.uid)}A(o)}let A=t=>{if(e.collection.useCollectionSecurity){if(y.edit(e.collection.uid,"selectedSecuritySchemeUids",t),!e.persistAuth)return;let a=t.map(e=>Array.isArray(e)?e.map(e=>l[e]?.nameKey):l[e]?.nameKey);(0,w.Ar)().setItem(w.tN.SELECTED_SECURITY_SCHEMES,JSON.stringify(a))}else e.operation?.uid&&f.edit(e.operation.uid,"selectedSecuritySchemeUids",t)};function S({id:e,label:t}){x.value={id:e,label:t},k.show()}let F=(0,c.EW)(()=>((e,t,l,a=!1)=>{{let o=t.reduce((e,t)=>
1{let a=l[t];return a&&(e[a.nameKey]=a),e},{}),r=e.flatMap(e=>{let t=Object.keys(e);if(t.length>1)return u(t.map(e=>o[e]?.uid).filter(n.O9),l);if(t[0]){let e=o[t[0]];if(e)return i(e)}return[]}),c=t.filter(e=>!r.some(t=>t.id===e)).map(e=>{let t=l[e];return t?i(t):null}).filter(n.O9),d=[{label:"Required authentication",options:r},{label:"Available authentication",options:c}];return a?r.length?d:c:(d.push({label:"Add new authentication",options:s}),d)}})(_.value.filteredRequirements,e.collection?.securitySchemes??[],l,e.isReadOnly)),E=e=>{g.value&&e.stopPropagation(),b.value?.$el.click()};return(l,a)=>((0,c.uX)(),(0,c.Wv)(r.A,{class:"group/params relative",itemCount:R.value.length,layout:e.layout,"onUpdate:modelValue":a[4]||(a[4]=e=>g.value=e)},{title:(0,c.k6)(()=>[(0,c.Lk)("div",{id:(0,d.R1)(v),class:"inline-flex items-center gap-0.5 leading-[20px]"},[(0,c.Lk)("span",null,(0,p.v_)(e.title),1),C.value?((0,c.uX)(),(0,c.CE)("span",{key:0,class:(0,p.C4)(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]",{"text-c-1":"Required"===C.value.text}]),onClick:E},(0,p.v_)(C.value.text),3)):(0,c.Q3)("",!0)],8,ec)]),actions:(0,c.k6)(()=>[(0,c.Lk)("div",ed,[(0,c.bF)((0,d.R1)(m.BR),{class:"w-72 text-xs",modelValue:R.value,multiple:"",options:F.value,placement:"bottom-end",teleport:"",onDelete:S,"onUpdate:modelValue":V},{option:(0,c.k6)(({option:t,selected:l})=>[(0,c.bF)((0,d.R1)(m.Pq),{multiselect:"",selected:l},null,8,["selected"]),(0,c.Lk)("div",ep,(0,p.v_)(t.label),1),t.isDeletable??!e.isReadOnly?((0,c.uX)(),(0,c.Wv)((0,d.R1)(m.EX),{key:0,class:"-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",icon:(0,d.R1)(ei.A),label:`Delete ${t.label}`,size:"xs",onClick:(0,I.D$)(e=>S(t),["stop"])},null,8,["icon","label","onClick"])):(0,c.Q3)("",!0)]),default:(0,c.k6)(()=>[(0,c.bF)((0,d.R1)(m.RO),{ref_key:"comboboxButtonRef",ref:b,"aria-describedby":(0,d.R1)(v),class:"group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",variant:"ghost"},{default:(0,c.k6)(()=>[1===R.value.length?((0,c.uX)(),(0,c.CE)(c.FK,{key:0},[a[5]||(a[5]=(0,c.Lk)("span",{class:"sr-only"},"Selected Auth Type:",-1)),(0,c.eW)(" "+(0,p.v_)(R.value[0]?.label),1)],64)):R.value.length>1?((0,c.uX)(),(0,c.CE)(c.FK,{key:1},[a[6]||(a[6]=(0,c.eW)(" Multiple ",-1)),a[7]||(a[7]=(0,c.Lk)("span",{class:"sr-only"},"Auth Types Selected",-1))],64)):((0,c.uX)(),(0,c.CE)(c.FK,{key:2},[a[8]||(a[8]=(0,c.Lk)("span",{class:"sr-only"},"Select",-1)),a[9]||(a[9]=(0,c.eW)(" Auth Type ",-1))],64)),(0,c.bF)((0,d.R1)(eu.A),{class:"size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",weight:"bold"})]),_:1},8,["aria-describedby"])]),_:1},8,["modelValue","options"])])]),default:(0,c.k6)(()=>[(0,c.bF)(en,{collection:e.collection,envVariables:e.envVariables,environment:e.environment,layout:e.layout,persistAuth:e.persistAuth,selectedSchemeOptions:R.value,server:e.server,workspace:e.workspace,onActiveSchemes:a[0]||(a[0]=e=>t("activeSchemes",e)),onAuthorized:a[1]||(a[1]=e=>t("authorized"))},{"oauth-actions":(0,c.k6)(()=>[(0,c.RG)(l.$slots,"oauth-actions",{},void 0,!0)]),_:3},8,["collection","envVariables","environment","layout","persistAuth","selectedSchemeOptions","server","workspace"]),(0,c.bF)(h,{scheme:x.value,state:(0,d.R1)(k),onClose:a[2]||(a[2]=e=>(0,d.R1)(k).hide()),onDelete:a[3]||(a[3]=t=>{var l;(l=x.value?.id)&&(A(e.selectedSecuritySchemeUids.filter(e=>{let t=l.split(",");return t.length>1&&Array.isArray(e)&&t.length===e.length?e.every(e=>!t.includes(e)):e!==l})),b.value?.$el.focus(),k.hide())})},null,8,["scheme","state"])]),_:3},8,["itemCount","layout"]))}}),ef=(0,a.A)(em,[["__scopeId","data-v-3f1067a4"]])},13438:(e,t,l)=>{l.d(t,{A:()=>y});var a=l(63277),o=l(48301),r=l(90613),s=l(52619),n=l(73926),i=["aria-labelledby"],u={class:"text-c-1 m-0 flex flex-1 items-center gap-1.5 leading-[20px]"},c=["id"],d={key:0,class:"sr-only"},p={key:0,class:"bg-b-2 text-c-2 inline-flex h-5 w-5 items-center justify-center rounded-full border text-xs font-semibold"},m={class:"sr-only"},f={key:0,class:"ui-not-open:hidden flex items-center gap-2 pr-0.75"},y=(0,a.pM)({__name:"ViewLayoutCollapse",props:{defaultOpen:{type:Boolean,default:!0},itemCount:{default:0},layout:{default:"client"}},emits:["update:modelValue"],setup(e,{emit:t}){let l=(0,a.Bi)(),y=(0,o.KR)(e.defaultOpen),h=()=>{y.value=!y.value,t("update:modelValue",y.value)};return(0,a.sV)(()=>{t("update:modelValue",y.value)}),(t,y)=>((0,a.uX)(),(0,a.Wv)((0,o.R1)(n.EN),{as:"div",class:(0,r.C4)(["group/collapse focus-within:text-c-1 text-c-2 last:ui-open:border-b-0 border-b",{"last-of-type:first-of-type:border-b-0":"reference"===e.layout}]),defaultOpen:e.defaultOpen,static:"reference"===e.layout||void 0,onClick:h},{default:(0,a.k6)(({open:y})=>[(0,a.Lk)("section",{"aria-labelledby":(0,o.R1)(l),class:"contents"},[(0,a.Lk)("div",{class:(0,r.C4)(["bg-b-2 flex items-center","reference"===e.layout&&"rounded-t-xl border border-b-0"])},[(0,a.bF)((0,o.R1)(n._q),{class:(0,r.C4)(["hover:text-c-1 group box-content flex max-h-8 flex-1 items-center gap-2.5 overflow-hidden px-1 py-1.5 text-base font-medium outline-none md:px-1.5 xl:pr-0.5 xl:pl-2",{"!pl-3":"reference"===e.layout}]),disabled:"reference"===e.layout},{default:(0,a.k6)(()=>["reference"!==e.layout?((0,a.uX)(),(0,a.Wv)((0,o.R1)(s.kv),{key:0,class:(0,r.C4)(["text-c-3 group-hover:text-c-1 ui-open:rotate-90 ui-not-open:rotate-0 rounded-px outline-offset-2 group-focus-visible:outline"]),icon:"ChevronRight",size:"md"})):(0,a.Q3)("",!0),(0,a.Lk)("h2",u,[(0,a.Lk)("span",{id:(0,o.R1)(l),class:"contents"},[(0,a.RG)(t.$slots,"title",{open:y}),y?(0,a.Q3)("",!0):((0,a.uX)(),(0,a.CE)("span",d," (Collapsed) "))],8,c),!y&&e.itemCount?((0,a.uX)(),(0,a.CE)("span",p,[(0,a.eW)((0,r.v_)(e.itemCount)+" ",1),(0,a.Lk)("span",m,"Item"+(0,r.v_)(1===e.itemCount?"":"s"),1)])):(0,a.Q3)("",!0)])]),_:2},1032,["class","disabled"]),t.$slots.actions?((0,a.uX)(),(0,a.CE)("div",f,[(0,a.RG)(t.$slots,"actions",{open:y})])):(0,a.Q3)("",!0)],2),(0,a.bF)((0,o.R1)(n.kS),(0,a.v6)(t.$attrs,{class:"diclosure-panel h-full max-h-fit roun
1ded-b"}),{default:(0,a.k6)(()=>[(0,a.RG)(t.$slots,"default",{open:y})]),_:2},1040)],8,i)]),_:3},8,["class","defaultOpen","static"]))}})},80193:(e,t,l)=>{l.d(t,{A:()=>k});var a=l(83443),o=l(47118),r=l(63868),s=l(83183),n=l(63277),i=l(48301),u=l(90613),c=l(52619),d=l(79491),p=l(98291),m=l(24857),f=["for"],y={class:"relative flex min-w-0 flex-1"},h=["readOnly","type","value"],v={key:1,class:"centered-y text-orange absolute right-7 text-xs"},b=(0,n.pM)({inheritAttrs:!1,__name:"DataTableInput",props:{id:{},type:{},containerClass:{},required:{type:Boolean,default:!1},modelValue:{},canAddCustomEnumValue:{type:Boolean,default:!0},readOnly:{type:Boolean,default:!1},enum:{},min:{},max:{},environment:{},envVariables:{},description:{},lineWrapping:{type:Boolean,default:!1}},emits:["update:modelValue","inputFocus","inputBlur","selectVariable"],setup(e,{emit:t}){let l=(0,i.KR)(!0),a=(0,i.KR)(!1),b=(0,i.KR)(null),k=()=>{a.value||t("inputBlur")},w=(0,n.EW)(()=>"password"===e.type?"text":e.type??"text"),x=()=>{e.enum?.length||e.readOnly||b.value?.focus()};return(a,g)=>((0,n.uX)(),(0,n.Wv)(s.A,{class:(0,u.C4)(["relative flex",e.containerClass])},{default:(0,n.k6)(()=>[a.$slots.default?((0,n.uX)(),(0,n.CE)("div",{key:0,class:"text-c-1 flex items-center pr-0 pl-3",for:e.id??"",onClick:x},[(0,n.RG)(a.$slots,"default",{},void 0,!0),g[6]||(g[6]=(0,n.eW)(": ",-1))],8,f)):(0,n.Q3)("",!0),(0,n.Lk)("div",y,[e.enum&&e.enum.length?((0,n.uX)(),(0,n.Wv)(o.A,{key:0,canAddCustomValue:e.canAddCustomEnumValue,modelValue:e.modelValue,value:e.enum,"onUpdate:modelValue":g[0]||(g[0]=e=>t("update:modelValue",e))},null,8,["canAddCustomValue","modelValue","value"])):((0,n.uX)(),(0,n.CE)(n.FK,{key:1},[l.value&&"password"===e.type?((0,n.uX)(),(0,n.CE)("input",(0,n.v6)({key:0},e.id?{...a.$attrs,id:e.id}:a.$attrs,{autocomplete:"off",class:["text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none px-2 py-1.25 -outline-offset-1",{"scalar-password-input":"password"===e.type}],"data-1p-ignore":"",readOnly:e.readOnly,spellcheck:"false",type:w.value,value:e.modelValue,onInput:g[1]||(g[1]=e=>t("update:modelValue",e.target.value??""))}),null,16,h)):((0,n.uX)(),(0,n.Wv)(r.A,(0,n.v6)({key:1},a.$attrs,{id:e.id,ref_key:"codeInput",ref:b,class:["text-c-1 disabled:text-c-2 peer w-full min-w-0 border-none -outline-offset-1",["password"===e.type&&e.description&&"pr-12",e.description&&"pr-8","password"===e.type&&"scalar-password-input"]],description:e.description,disableCloseBrackets:"",disableTabIndent:"",envVariables:e.envVariables,environment:e.environment,lineWrapping:!!e.lineWrapping,max:e.max,min:e.min,modelValue:e.modelValue??"",readOnly:e.readOnly,required:!!e.required,spellcheck:"false",type:w.value,onBlur:k,onFocus:g[2]||(g[2]=e=>t("inputFocus")),"onUpdate:modelValue":g[3]||(g[3]=e=>t("update:modelValue",e))}),null,16,["id","class","description","envVariables","environment","lineWrapping","max","min","modelValue","readOnly","required","type"]))],64))]),a.$slots.warning?((0,n.uX)(),(0,n.CE)("div",v,[(0,n.RG)(a.$slots,"warning",{},void 0,!0)])):(0,n.Q3)("",!0),(0,n.RG)(a.$slots,"icon",{},void 0,!0),e.modelValue?((0,n.uX)(),(0,n.Wv)((0,i.R1)(c.EX),{key:2,class:"-ml-.25 h-6 w-6 self-center p-1.25",icon:(0,i.R1)(d.A),label:"Clear Value",onClick:g[4]||(g[4]=e=>t("update:modelValue",""))},null,8,["icon"])):(0,n.Q3)("",!0),"password"===e.type?((0,n.uX)(),(0,n.Wv)((0,i.R1)(c.EX),{key:3,class:"-ml-.5 mr-1.25 h-6 w-6 self-center p-1.25",icon:l.value?(0,i.R1)(p.A):(0,i.R1)(m.A),label:l.value?"Show Password":"Hide Password",onClick:g[5]||(g[5]=e=>l.value=!l.value)},null,8,["icon","label"])):(0,n.Q3)("",!0)]),_:3},8,["class"]))}}),k=(0,a.A)(b,[["__scopeId","data-v-c1a50a6e"]])}}]);
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.