Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.169/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)(),_=(0,l.useSelector)((e=>e)),E=_.fragmentEntryLinks[b],y=g===p.EDITABLE_TYPES.backgroundImage?r.BACKGROUND_IMAGE_FRAGMENT_ENTRY_PROCESSOR:o.EDITABLE_FRAGMENT_ENTRY_PROCESSOR,P=(0,c.default)(_,b,a,y);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({},E.editableValues),{},{[y]:_objectSpread(_objectSpread({},E.editableValues[y]),{},{[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:E.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