const e=["RUNNING"],t=["INITIALIZING","ACCEPTED","DEPLOYING","AGGREGATING_LOGS"],u=["KILLED","STOPPED"],c=["FAILED","FRAMEWORK_FAILURE","APP_MASTER_START_FAILED","INITIALIZATION_FAILED"],g=(i,n)=>n?{value:"Serving",variant:"success"}:e.includes(i)?{value:"Running",variant:"success",loading:!0}:t.includes(i)?{value:"Starting",variant:"notice",loading:!0}:i==="STOPPING"?{value:"Stopping",variant:"notice",loading:!0}:i==="DELETING"?{value:"Deleting",variant:"notice",loading:!0}:i==="RESTARTING"?{value:"Restarting",variant:"notice",loading:!0}:c.includes(i)?{value:"Failed",variant:"fail"}:u.includes(i)?{value:"Stopped",variant:"secondary"}:{value:i,variant:"secondary"},l=i=>e.includes(i),a=i=>l(i)||t.includes(i),d=i=>!a(i),f=i=>i?`${i.charAt(0)}${i.slice(1).toLowerCase()}`:"-",A=i=>{if(!i)return"/";let n=i.trim();return n?(n.startsWith("/")||(n=`/${n}`),n.length>1&&(n=n.replace(/\/+$/,"")),n||"/"):"/"},I=i=>A(i),E=i=>i==="PREFIX"?"Compatibility prefix":"Root routing",p=()=>{var i;return typeof window<"u"&&((i=window.location)!=null&&i.origin)?window.location.origin.replace(/\/$/,""):""},T=i=>{if(!i)return null;if(/^https?:\/\//.test(i))return i;const n=p();return n?new URL(i,n).toString():i},S=i=>a(i.state)?"pod":"file",v=i=>Array.isArray(i)?i.map(n=>{const r=n.indexOf("="),o=r>=0?n.slice(0,r).trim():n.trim(),s=r>=0?n.slice(r+1):"";return{key:o,value:s}}):[],L=i=>Array.isArray(i)?i.map(n=>{const r=((n==null?void 0:n.key)??"").trim();return r?`${r}=${(n==null?void 0:n.value)??""}`:null}).filter(n=>n!==null):[];export{d as a,S as b,T as c,f as d,I as e,E as f,g,a as i,A as n,v as p,L as s};
