Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/common/components/LengthField",["module","exports","require","@frontend-taglib-clay$clayui/button","@liferay/layout-js-components-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../app/config/constants/viewportSizes","../../app/contexts/StoreContext","../../app/utils/getResetLabelByViewport","../../prop_types/index"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.LengthField=function LengthField({field:t,onEnter:n,onValueSelect:u,value:p}){var s;const d=(0,i.useSelector)((e=>e.selectedViewportSize)),[f,y]=(0,o.useState)(e.has(t.name)&&p!==t.defaultValue),b=(0,o.useMemo)((()=>(0,c.getResetLabelByViewport)(d)),[d]);return o.default.createElement("div",{className:"align-items-center d-flex page-editor__length-field"},o.default.createElement(a.LengthInput,{className:t.icon?"mb-0":null,defaultUnit:null===(s=t.typeOptions)||void 0===s?void 0:s.defaultUnit,field:t,onEnter:n,onValueSelect:(n,r)=>{e.has(t.name)&&y(!0),u(n,r)},showLabel:!t.icon,value:p}),f?o.default.createElement(r.ClayButtonWithIcon,{"aria-label":b,className:"border-0 flex-shrink-0 mb-0 ml-2",displayType:"secondary",onClick:()=>{y(d!==l.VIEWPORT_SIZES.desktop),u(t.name,null)},size:"sm",symbol:"restore",title:b}):null)};var r=n("@frontend-taglib-clay$clayui/button"),a=n("@liferay/layout-js-components-web"),o=(function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("liferay!frontend-js-react-web$prop-types")),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 n={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var o=r?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react"))),l=n("../../app/config/constants/viewportSizes"),i=n("../../app/contexts/StoreContext"),c=n("../../app/utils/getResetLabelByViewport");n("../../prop_types/index");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}const e=new Set(["opacity","borderWidth"])}}));
//# sourceMappingURL=LengthField.js.map