Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.170/page_editor/plugins/browser/components/page_structure/components/item_configuration_panels/FragmentStylesPanel",["module","exports","require","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../../../../../app/config/constants/fragmentConfigurationRoles","../../../../../../app/config/constants/viewportSizes","../../../../../../app/config/index","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectLanguageId","../../../../../../app/utils/getFragmentConfigurationValues","../../../../../../app/utils/getResponsiveConfig","../../../../../../app/utils/updateConfigurationValue","../../../../../../prop_types/index","./CommonStyles","./FieldSet"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.FragmentStylesPanel=function FragmentStylesPanel({item:e}){var t,n;const o=(0,l.useDispatch)(),s=(0,l.useSelectorCallback)((t=>t.fragmentEntryLinks[e.config.fragmentEntryLinkId]),[e.config.fragmentEntryLinkId]),d=(0,l.useSelector)(u.default),g=(0,l.useSelector)((e=>e.selectedViewportSize)),m=(0,c.getResponsiveConfig)(e.config,g),y=(null===(t=s.configuration)||void 0===t||null===(n=t.fieldSets)||void 0===n?void 0:n.filter((e=>e.configurationRole===a.FRAGMENT_CONFIGURATION_ROLES.style)).length)&&g===i.VIEWPORT_SIZES.desktop,S=(0,r.useCallback)(((e,t)=>{(0,f.default)({configuration:s.configuration,dispatch:o,fragmentEntryLink:s,languageId:d,name:e,value:t})}),[o,s,d]);return r.default.createElement(r.default.Fragment,null,g===i.VIEWPORT_SIZES.desktop&&r.default.createElement(CustomStyles,{fragmentEntryLink:s,onValueSelect:S}),r.default.createElement(p.CommonStyles,{className:y?"mt-3":null,commonStylesValues:m.styles,item:e}))};_interopRequireDefault(n("liferay!frontend-js-react-web$prop-types"));var r=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 i=r?Object.getOwnPropertyDescriptor(e,a):null;i&&(i.get||i.set)?Object.defineProperty(n,a,i):n[a]=e[a]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),a=n("../../../../../../app/config/constants/fragmentConfigurationRoles"),i=n("../../../../../../app/config/constants/viewportSizes"),o=n("../../../../../../app/config/index"),l=n("../../../../../../app/contexts/StoreContext"),u=_interopRequireDefault(n("../../../../../../app/selectors/selectLanguageId")),s=_interopRequireDefault(n("../../../../../../app/utils/getFragmentConfigurationValues")),c=n("../../../../../../app/utils/getResponsiveConfig"),f=_interopRequireDefault(n("../../../../../../app/utils/updateConfigurationValue")),p=(n("../../../../../../prop_types/index"),n("./CommonStyles")),d=n("./FieldSet");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const CustomStyles=({fragmentEntryLink:e,onValueSelect:t})=>{var n,i;const u=(0,l.useSelector)((e=>e.selectedViewportSize)),c=(0,l.useSelectorRef)((e=>e.fragmentEntryLinks)),f=null===(n=e.configuration)||void 0===n||null===(i=n.fieldSets)||void 0===i?void 0:i.filter((e=>e.configurationRole===a.FRAGMENT_CONFIGURATION_ROLES.style));return(null==f?void 0:f.length)?r.default.createElement("div",{className:"page-editor__page-structure__section__custom-styles pb-0"},r.default.createElement("h1",{className:"sr-only"},Liferay.Language.get("custom-styles")),f.map(((n,a)=>r.default.createElement(d.FieldSet,{description:n.description,fields:n.fields,fragmentEntryLinks:c.current,isCustomStylesFieldSet:!0,key:a,label:n.label,languageId:o.config.defaultLanguageId,onValueSelect:t,selectedViewportSize:u,values:(0,s.default)(e)})))):null}}}));
//# sourceMappingURL=FragmentStylesPanel.js.map