import{ab as c}from"./index.17037962789732.js";function u(s){if(!s)return{};const r={current:s.current},{terms:t,sorts:f}=s;return Object.keys(s).forEach(i=>{if(i==="terms"){let n=0;if(!t)return;Object.keys(t).forEach(e=>{if(!(t[e]===""||t[e]===void 0||t[e].length===0||c(t[e])&&Object.keys(t[e]).length===0||t[e]===null)){if(e.indexOf("$LIKE")>-1&&t[e].toString().indexOf("%")===-1&&(t[e]=`%${t[e]}%`),e.indexOf("$IN")>-1?t[e]=t[e].toString():e.indexOf("$START")>-1?t[e]=`%${t[e]}`:e.indexOf("$END")>-1&&(t[e]=`${t[e]}%`),e.indexOf("@")>-1){const o=e.split("@");r[`terms[${n}].column`]=o[0],r[`terms[${n}].type`]=o[1]}else r[`terms[${n}].column`]=e;r[`terms[${n}].value`]=t[e],n+=1}})}else if(i==="sorts"){if(!f)return;Object.keys(f).forEach((n,e)=>{r[`sorts[${e}].name`]=n,r[`sorts[${e}].order`]=f[n].replace("end","")})}else r[i]=s[i]}),r}export{u as e};
