Liferay.Loader.define("@liferay/analytics-settings-web@5.0.51/js/components/table/utils",["module","exports","require","frontend-js-web","../../utils/filter"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.serializeTableRequestParams=function serializeTableRequestParams({filter:{type:e,value:t},keywords:r,pagination:{page:n,pageSize:o}}){const a={keywords:r,page:n,pageSize:o,sort:"".concat(t,":").concat(e)},c=Object.keys(a).map((e=>[e,String(a[e])])),s=new URLSearchParams(c);return decodeURIComponent(s.toString())},t.getOrderBy=function getOrderBy({type:e}){return e===o.OrderBy.Asc?o.OrderBy.Desc:o.OrderBy.Asc},t.getOrderBySymbol=function getOrderBySymbol({type:e}){return e===o.OrderBy.Asc?"order-list-up":"order-list-down"},t.getResultsLanguage=function getResultsLanguage(e){if(e>1)return(0,n.sub)(Liferay.Language.get("x-results-for").toLowerCase(),e);return(0,n.sub)(Liferay.Language.get("x-result-for").toLowerCase(),e)},t.getGlobalChecked=function getGlobalChecked(e){const t=Object.values(e).filter((({disabled:e})=>!e));if(!t.length)return!1;return t.every((({checked:e})=>e))},t.updateFormattedItems=function updateFormattedItems(e,t){const r={};return Object.entries(e).forEach((([e,n])=>{n.disabled?r[e]=n:r[e]=_objectSpread(_objectSpread({},n),{},{checked:t})})),r},t.formattingItems=function formattingItems(e){const t={};for(let r=0;r<e.length;r++){const n=e[r];t[n.id]=n}return t},t.selectFormattedItems=function selectFormattedItems(e,t){let r={};return t.forEach((t=>{r=_objectSpread(_objectSpread({},r),{},{[t]:e[t]})})),r},t.getIds=function getIds(e,t){const r=new Set(t);return Object.values(e).forEach((({checked:e,id:t})=>{e?r.add(Number(t)):r.delete(Number(t))})),[...r]};var n=r("frontend-js-web"),o=r("../../utils/filter");function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}}}));
//# sourceMappingURL=utils.js.map