Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.130/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/FieldSet",["module","exports","require","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../app/components/fragment-configuration-fields/index","../../../../../../app/config/constants/containerWidthTypes","../../../../../../app/config/constants/fragmentEntryTypes","../../../../../../app/config/constants/layoutDataItemTypes","../../../../../../app/config/constants/viewportSizes","../../../../../../app/contexts/StoreContext","../../../../../../app/utils/getEditableLocalizedValue","../../../../../../app/utils/isNullOrUndefined","../../../../../../common/components/Collapse","../../../../../../common/components/CurrentLanguageFlag","../../../../../../prop-types/index"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.fieldIsDisabled=y,t.FieldSet=function({isCustomStylesFieldSet:e=!1,fields:t,item:a={},label:n,languageId:i,onValueSelect:o,values:u}){const p=(0,c.useSelector)((e=>e)),{fragmentEntryLinks:m,selectedViewportSize:g}=p,y=function(e,t,a,n){let l=t;n!==d.VIEWPORT_SIZES.desktop&&(l=t.filter((e=>e.responsive||"backgroundImage"===e.name)));if(e.type!==r.LAYOUT_DATA_ITEM_TYPES.fragment)return l;a[e.config.fragmentEntryLinkId].fragmentEntryType===s.FRAGMENT_ENTRY_TYPES.input&&(l=l.filter((e=>"display"!==e.name)));return l}(a,t,m,g);return y.length&&n?l.default.createElement(f.default,{label:n,open:!0},l.default.createElement(_,{fields:y,isCustomStylesFieldSet:e,item:a,languageId:i,onValueSelect:o,values:u})):l.default.createElement(_,{fields:y,isCustomStylesFieldSet:e,item:a,languageId:i,onValueSelect:o,values:u})};var n=g(a("liferay!frontend-js-react-web$classnames")),l=(g(a("liferay!frontend-js-react-web$prop-types")),g(a("liferay!frontend-js-react-web$react"))),i=a("../../../../../../app/components/fragment-configuration-fields/index"),o=a("../../../../../../app/config/constants/containerWidthTypes"),s=a("../../../../../../app/config/constants/fragmentEntryTypes"),r=a("../../../../../../app/config/constants/layoutDataItemTypes"),d=a("../../../../../../app/config/constants/viewportSizes"),c=a("../../../../../../app/contexts/StoreContext"),u=a("../../../../../../app/utils/getEditableLocalizedValue"),p=g(a("../../../../../../app/utils/isNullOrUndefined")),f=g(a("../../../../../../common/components/Collapse")),m=g(a("../../../../../../common/components/CurrentLanguageFlag"));a("../../../../../../prop-types/index");function g(e){return e&&e.__esModule?e:{default:e}}const e={small:"small"};function y(e,t){var a;return!!t.disabled||e.type===r.LAYOUT_DATA_ITEM_TYPES.container&&(null===(a=e.config)||void 0===a?void 0:a.widthType)===o.CONTAINER_WIDTH_TYPES.fixed&&("marginRight"===t.name||"marginLeft"===t.name)}function _({fields:t,isCustomStylesFieldSet:a,item:o,languageId:s,onValueSelect:r,values:d}){return l.default.createElement("div",{className:"page-editor__sidebar__fieldset"},t.map(((t,c)=>{let u=t.type&&i.FRAGMENT_CONFIGURATION_FIELDS[t.type];return Liferay.FeatureFlags["LPS-163362"]||"opacity"!==t.name||(u=i.FRAGMENT_CONFIGURATION_FIELDS.text),l.default.createElement("div",{className:(0,n.default)(t.cssClass,"autofit-row page-editor__sidebar__fieldset__field align-items-end",{"page-editor__sidebar__fieldset__field-small":t.displaySize===e.small}),key:c},l.default.createElement("div",{className:"autofit-col autofit-col-expand"},l.default.createElement(u,{disabled:y(o,t),field:t,isCustomStyle:a,item:o,onValueSelect:r,value:S({field:t,languageId:s,values:d})})),t.localizable&&l.default.createElement(m.default,{className:"ml-2"}))})))}function S({field:e,languageId:t,values:a}){if(""===e.name)return a;const n=a[e.name];return(0,p.default)(n)?e.defaultValue:e.localizable&&"object"==typeof n?(0,u.getEditableLocalizedValue)(n,t,e.defaultValue):n}}}));
//# sourceMappingURL=FieldSet.js.map