Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/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 i=(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===r.FRAGMENT_CONFIGURATION_ROLES.style)).length)&&g===o.VIEWPORT_SIZES.desktop,S=(0,a.useCallback)(((e,t)=>{(0,f.default)({configuration:s.configuration,dispatch:i,fragmentEntryLink:s,languageId:d,name:e,value:t})}),[i,s,d]);return a.default.createElement(a.default.Fragment,null,g===o.VIEWPORT_SIZES.desktop&&a.default.createElement(CustomStyles,{fragmentEntryLink:s,onValueSelect:S}),a.default.createElement(p.CommonStyles,{className:y?"mt-3":null,commonStylesValues:m.styles,item:e}))};_interopRequireDefault(n("liferay!frontend-js-react-web$prop-types"));var a=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={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var o=a?Object.getOwnPropertyDescriptor(e,r):null;o&&(o.get||o.set)?Object.defineProperty(n,r,o):n[r]=e[r]}n.default=e,t&&t.set(e,n);return n}(n("liferay!frontend-js-react-web$react")),r=n("../../../../../../app/config/constants/fragmentConfigurationRoles"),o=n("../../../../../../app/config/constants/viewportSizes"),i=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,o;const l=null===(n=e.configuration)||void 0===n||null===(o=n.fieldSets)||void 0===o?void 0:o.filter((e=>e.configurationRole===r.FRAGMENT_CONFIGURATION_ROLES.style));return(null==l?void 0:l.length)?a.default.createElement("div",{className:"page-editor__page-structure__section__custom-styles pb-0"},a.default.createElement("h1",{className:"sr-only"},Liferay.Language.get("custom-styles")),l.map(((n,r)=>a.default.createElement(d.FieldSet,{fields:n.fields,isCustomStylesFieldSet:!0,key:r,label:n.label,languageId:i.config.defaultLanguageId,onValueSelect:t,values:(0,s.default)(e)})))):null}}}));
//# sourceMappingURL=FragmentStylesPanel.js.map