Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/plugins/browser/components/page_structure/components/item_configuration_panels/collection_general_panel/PaginationOptions",["module","exports","require","@frontend-taglib-clay$clayui/form","@liferay/layout-js-components-web","liferay!frontend-js-react-web$classnames","frontend-js-components-web","frontend-js-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../../app/config/constants/paginationErrorMessages","../../../../../../../app/config/index","../../../../../../../common/components/WarningMessage"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.PaginationOptions=function PaginationOptions({displayAllPages:e,handleConfigurationChanged:t,initialNumberOfItemsPerPage:a,initialNumberOfPages:d}){const p=(0,o.useId)(),g=(0,o.useId)(),[m,b]=(0,r.useControlledState)(a),[y,_]=(0,u.useState)(null),[P,h]=(0,u.useState)(d),w=a>c.config.searchContainerPageMaxDelta;return(0,u.useEffect)((()=>{let e=null;w?e=(0,i.sub)(s.PAGINATION_ERROR_MESSAGES.maximumItemsPerPage,c.config.searchContainerPageMaxDelta):a<1&&(e=s.PAGINATION_ERROR_MESSAGES.neededItem),_(e)}),[w,a]),u.default.createElement(u.default.Fragment,null,u.default.createElement("div",{className:"mb-2 pt-1"},u.default.createElement(n.ClayCheckbox,{checked:e,label:Liferay.Language.get("display-all-pages"),onChange:e=>t({displayAllPages:e.target.checked})})),!e&&u.default.createElement(n.default.Group,{small:!0},u.default.createElement("label",{htmlFor:g},Liferay.Language.get("maximum-number-of-pages-to-display")),u.default.createElement(n.ClayInput,{id:g,min:"1",onBlur:e=>{const a=Math.abs(Number(e.target.value))||1;(!P||P<0)&&h(a),a!==d&&t({numberOfPages:a})},onChange:e=>h(Number(e.target.value)),type:"number",value:P||""})),u.default.createElement(n.default.Group,{className:(0,l.default)({"has-warning":y}),small:!0},u.default.createElement("label",{htmlFor:p},Liferay.Language.get("maximum-number-of-items-per-page")),u.default.createElement(n.ClayInput,{id:p,min:"1",onBlur:e=>{const n=Math.abs(Number(e.target.value))||1;(!m||m<0)&&b(n),n!==a&&t({numberOfItemsPerPage:n})},onChange:e=>b(Number(e.target.value)),type:"number",value:m||""}),y&&u.default.createElement(f.WarningMessage,{message:y})))};var n=_interopRequireWildcard(a("@frontend-taglib-clay$clayui/form")),r=a("@liferay/layout-js-components-web"),l=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),o=a("frontend-js-components-web"),i=a("frontend-js-web"),u=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),_interopRequireWildcard(a("liferay!frontend-js-react-web$react"))),s=a("../../../../../../../app/config/constants/paginationErrorMessages"),c=a("../../../../../../../app/config/index"),f=a("../../../../../../../common/components/WarningMessage");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=PaginationOptions.js.map