Liferay.Loader.define("@liferay/search-experiences-web@3.0.7/sxp_blueprint_options/js/configuration/ManagementToolbar",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/form","@frontend-taglib-clay$clayui/icon","frontend-js-components-web","liferay!frontend-js-react-web$react","../../../sxp_blueprint_admin/js/utils/language"],(function(e,t,a){var n;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=f(a("@frontend-taglib-clay$clayui/button")),r=a("@frontend-taglib-clay$clayui/drop-down"),o=a("@frontend-taglib-clay$clayui/form"),u=(n=a("@frontend-taglib-clay$clayui/icon"))&&n.__esModule?n:{default:n},s=a("frontend-js-components-web"),i=f(a("liferay!frontend-js-react-web$react")),c=a("../../../sxp_blueprint_admin/js/utils/language");function d(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return d=function(){return e},e}function f(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=d();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}var m=({filterItems:e,loading:t,onChangeSortOrder:a,onSearch:n,searchValue:d,sortOrder:f,totalCount:m})=>{const[y,p]=(0,i.useState)(d),[b,g]=(0,i.useState)(!1);return i.default.createElement(i.default.Fragment,null,i.default.createElement(s.ManagementToolbar.Container,null,i.default.createElement(s.ManagementToolbar.ItemList,null,i.default.createElement(r.ClayDropDownWithItems,{items:e,trigger:i.default.createElement(l.default,{className:"nav-link",disabled:t,displayType:"unstyled"},i.default.createElement("span",{className:"navbar-breakpoint-down-d-none"},i.default.createElement("span",{className:"navbar-text-truncate"},Liferay.Language.get("filter-and-order")),i.default.createElement(u.default,{className:"inline-item inline-item-after",symbol:"caret-bottom"})),i.default.createElement("span",{className:"navbar-breakpoint-d-none"},i.default.createElement(u.default,{symbol:"filter"})))}),i.default.createElement(s.ManagementToolbar.Item,null,i.default.createElement(l.default,{className:"nav-link nav-link-monospaced",disabled:t,displayType:"unstyled",onClick:a},"asc"===f?i.default.createElement(u.default,{symbol:"order-list-up"}):i.default.createElement(u.default,{symbol:"order-list-down"})))),i.default.createElement(s.ManagementToolbar.Search,{showMobile:b},i.default.createElement(o.ClayInput.Group,null,i.default.createElement(o.ClayInput.GroupItem,null,i.default.createElement(o.ClayInput,{"aria-label":Liferay.Language.get("search"),className:"form-control input-group-inset input-group-inset-after",disabled:t,onChange:e=>{p(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),n(y))},placeholder:Liferay.Language.get("search"),type:"text",value:y}),i.default.createElement(o.ClayInput.GroupInsetItem,{after:!0,tag:"span"},i.default.createElement(l.ClayButtonWithIcon,{className:"navbar-breakpoint-d-none",displayType:"unstyled",onClick:()=>g(!1),symbol:"times"}),i.default.createElement(l.ClayButtonWithIcon,{disabled:t,displayType:"unstyled",onClick:()=>n(y),symbol:"search"}))))),i.default.createElement(s.ManagementToolbar.ItemList,null,i.default.createElement(s.ManagementToolbar.Item,{className:"navbar-breakpoint-d-none"},i.default.createElement(l.default,{className:"nav-link nav-link-monospaced",displayType:"unstyled",onClick:()=>g(!0)},i.default.createElement(u.default,{symbol:"search"}))))),!!d&&!t&&i.default.createElement(s.ManagementToolbar.ResultsBar,null,i.default.createElement(s.ManagementToolbar.ResultsBarItem,null,i.default.createElement("span",{className:"component-text text-truncate-inline"},i.default.createElement("span",{className:"text-truncate"},(0,c.sub)(1===m?Liferay.Language.get("x-result-for-x"):Liferay.Language.get("x-results-for-x"),[m,d])))),i.default.createElement(s.ManagementToolbar.ResultsBarItem,null,i.default.createElement(l.default,{className:"component-link tbar-link",displayType:"unstyled",onClick:()=>{n(""),p("")}},Liferay.Language.get("clear")))))};t.default=m}}));
//# sourceMappingURL=ManagementToolbar.js.map