Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.141/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/MappingPanel",["module","exports","require","liferay!frontend-js-react-web$react","../../../../../../app/config/constants/backgroundImageFragmentEntryProcessor","../../../../../../app/config/constants/editableFragmentEntryProcessor","../../../../../../app/config/constants/editableTypes","../../../../../../app/contexts/CollectionItemContext","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectEditableValue","../../../../../../app/thunks/updateEditableValues","../../../../../../app/utils/editable-value/isMapped","../../../../../../common/components/MappingSelector","../../../../../../prop-types/index","./DateEditableFormatInput"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.MappingPanel=function MappingPanel({item:e}){const t=(0,i.useCollectionConfig)(),{editableId:a,fragmentEntryLinkId:b,type:g}=e,m=(0,l.useDispatch)(),E=(0,l.useSelector)((e=>e)),y=E.fragmentEntryLinks[b],_=g===p.EDITABLE_TYPES.backgroundImage?r.BACKGROUND_IMAGE_FRAGMENT_ENTRY_PROCESSOR:o.EDITABLE_FRAGMENT_ENTRY_PROCESSOR,P=(0,c.default)(E,b,a,_);return n.default.createElement(n.default.Fragment,null,t&&n.default.createElement("p",{className:"page-editor__mapping-panel__helper text-secondary"},Liferay.Language.get("collection-mapping-help")),n.default.createElement(d.default,{fieldType:g,mappedItem:P,onMappingSelect:e=>{let t=_objectSpread({},P.config);g!==p.EDITABLE_TYPES["date-time"]||(0,s.default)(e)?g===p.EDITABLE_TYPES.image&&(0,s.default)(e)&&(t=_objectSpread(_objectSpread({},P.config),{},{alt:"",imageTitle:""})):t={};const n=_objectSpread(_objectSpread({},y.editableValues),{},{[_]:_objectSpread(_objectSpread({},y.editableValues[_]),{},{[a]:_objectSpread({config:t,defaultValue:P.defaultValue},e)})});m((0,u.default)({editableValues:n,fragmentEntryLinkId:b}))}}),g===p.EDITABLE_TYPES["date-time"]&&(0,s.default)(P)&&n.default.createElement(f.default,{editableId:a,editableValueNamespace:e.editableValueNamespace,editableValues:y.editableValues,fragmentEntryLinkId:e.fragmentEntryLinkId}))};var n=_interopRequireDefault(a("liferay!frontend-js-react-web$react")),r=a("../../../../../../app/config/constants/backgroundImageFragmentEntryProcessor"),o=a("../../../../../../app/config/constants/editableFragmentEntryProcessor"),p=a("../../../../../../app/config/constants/editableTypes"),i=a("../../../../../../app/contexts/CollectionItemContext"),l=a("../../../../../../app/contexts/StoreContext"),c=_interopRequireDefault(a("../../../../../../app/selectors/selectEditableValue")),u=_interopRequireDefault(a("../../../../../../app/thunks/updateEditableValues")),s=_interopRequireDefault(a("../../../../../../app/utils/editable-value/isMapped")),d=_interopRequireDefault(a("../../../../../../common/components/MappingSelector")),f=(a("../../../../../../prop-types/index"),_interopRequireDefault(a("./DateEditableFormatInput")));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(a),!0).forEach((function(t){_defineProperty(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):ownKeys(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}}}));
//# sourceMappingURL=MappingPanel.js.map