/*!
 * Copyright © 2018 Splunk Inc.
 * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
 * in part without a valid written license from Splunk Inc. is PROHIBITED.
 */(()=>{"use strict";var e={8999:function(e,t,r){var l=this&&this.__createBinding||(Object.create?function(e,t,r,l){void 0===l&&(l=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,l,i)}:function(e,t,r,l){void 0===l&&(l=r),e[l]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.useColumnSelectorFooterMessage=void 0;const o=n(r(9497)),a=r(3620);t.useColumnSelectorFooterMessage=({filter:e,availableFields:t,selectedFields:r,filteredFields:l,noSelectedFieldsInfo:i=!1})=>{const n=(0,o.useMemo)((()=>{if(!r||!l)return[];const e=new Set(r.filter((e=>""!==e&&void 0!==e)));return l.filter((t=>e.has(t.name)))}),[r,l]);return e&&!l.length?null:o.default.createElement(a.ColumnSelectorFooterMessage,{noSelectedFieldsInfo:i,numSelected:null==n?void 0:n.length,numFiltered:l.length,numAvailable:t.length,filter:e})}},3620:function(e,t,r){var l=this&&this.__createBinding||(Object.create?function(e,t,r,l){void 0===l&&(l=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,l,i)}:function(e,t,r,l){void 0===l&&(l=r),e[l]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&l(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.ColumnSelectorFooterMessage=void 0;const o=n(r(9497)),a=r(3773),u=r(6649),s=r(9497);t.ColumnSelectorFooterMessage=({numSelected:e,numFiltered:t,numAvailable:r,filter:l,noSelectedFieldsInfo:i})=>{const n=(0,s.useMemo)((()=>l?i?(0,a.sprintf)((0,u._)("%(filtered)d filtered from %(available)d fields"),{filtered:t,available:r}):(0,a.sprintf)((0,u._)("%(selected)d selected from %(filtered)d filtered"),{selected:e,filtered:t}):i?(0,a.sprintf)((0,u._)("%(shown)d of %(available)d fields"),{shown:t,available:r}):(0,a.sprintf)((0,u._)("%(selected)d selected from %(available)d"),{selected:e,available:r})),[l,i,t,r,e]);return o.createElement("span",{"data-test":"footer-message","aria-live":"polite","aria-atomic":"true"},n)}},3773:e=>{e.exports=require("@splunk/ui-utils/format")},6649:e=>{e.exports=require("@splunk/ui-utils/i18n")},9497:e=>{e.exports=require("react")}},t={};var r=function r(l){var i=t[l];if(void 0!==i)return i.exports;var n=t[l]={exports:{}};return e[l].call(n.exports,n,n.exports,r),n.exports}(8999);module.exports=r})();
//# sourceMappingURL=useColumnSelectorFooterMessage.js.map