import{fZ as a}from"./index-d6499a22.js";var c=(e=>(e.ALL="all",e.DEPLOYED_ONLY="deployed only",e.MY_ONLY="my models only",e))(c||{});const O={name:({name:e},{name:n})=>e.localeCompare(n),"last created":({created:e},{created:n})=>{const r=new Date(e).getTime(),t=new Date(n).getTime();return r===t?0:r<t?1:-1}},b=(e,n)=>{const r=O[n];return r?e.sort(r):e},g=(e,n)=>n?e.filter(r=>r.name.toLowerCase().includes(n.toLowerCase())):e,D=(e,n,r,t)=>n===c.MY_ONLY?e.filter(s=>s.userFullName.toLowerCase()===(r==null?void 0:r.username)):n===c.DEPLOYED_ONLY?t?e.filter(s=>!!t.find(u=>s.name===u.modelName)):[]:e,Y=e=>{let n=[];return e.forEach(r=>{const t=n.find(s=>s.name===r.name);t?r.version>t.version&&(n=n.map(s=>r.name===s.name?r:s)):n.push(r)}),n},h=(e,n)=>{if(e.status===a.RUNNING){if(n.status!==a.RUNNING)return-1}else if(n.status===a.RUNNING)return 1;return 0},E=e=>+String(e).slice(0,6),R=(e,n)=>{const r=Object.entries(e).reduce((t,[s,i])=>(Object.entries(i).forEach(([u,d])=>{var f,m;const{properties:o}=n.find(({name:N})=>N===s)||{};t[s]||(t[s]={schema:s,value:{}}),t[s].value[u]=l(d,o==null?void 0:o[u].type,(m=(f=o==null?void 0:o[u])==null?void 0:f.items)==null?void 0:m.type)}),t),{});return Object.values(r)},l=(e,n,r)=>{switch(!0){case n==="integer":return Number.parseInt(e,10);case n==="string":return String(e);case n==="float":return Number.parseFloat(e);case n==="boolean":return!!e;case n==="array":return e.map(t=>l(t.value,r));default:return e}};export{c as M,b as a,g as b,Y as c,E as d,h as e,D as f,R as g,O as s};
