Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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/editableTypeDefaultOptions","../../../../../../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({item:e}){const t=(0,i.useCollectionConfig)(),{editableId:a,fragmentEntryLinkId:b,type:m}=e,y=(0,c.useDispatch)(),O=(0,c.useSelector)((e=>e)),P=O.fragmentEntryLinks[b],_=m===l.EDITABLE_TYPES.backgroundImage?r.BACKGROUND_IMAGE_FRAGMENT_ENTRY_PROCESSOR:o.EDITABLE_FRAGMENT_ENTRY_PROCESSOR,I=(0,s.default)(O,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(f.default,{fieldType:m,mappedItem:I,onMappingSelect:e=>{const t=E(E({},P.editableValues),{},{[_]:E(E({},P.editableValues[_]),{},{[a]:E({config:(0,d.default)(e)?E(E({},p.EDITABLE_TYPE_DEFAULT_OPTIONS[m]),I.config):I.config,defaultValue:I.defaultValue},e)})});y((0,u.default)({editableValues:t,fragmentEntryLinkId:b}))}}),m===l.EDITABLE_TYPES["date-time"]&&(0,d.default)(I)&&n.default.createElement(g.default,{editableId:a,editableValueNamespace:e.editableValueNamespace,editableValues:P.editableValues,fragmentEntryLinkId:e.fragmentEntryLinkId}))};var n=b(a("liferay!frontend-js-react-web$react")),r=a("../../../../../../app/config/constants/backgroundImageFragmentEntryProcessor"),o=a("../../../../../../app/config/constants/editableFragmentEntryProcessor"),p=a("../../../../../../app/config/constants/editableTypeDefaultOptions"),l=a("../../../../../../app/config/constants/editableTypes"),i=a("../../../../../../app/contexts/CollectionItemContext"),c=a("../../../../../../app/contexts/StoreContext"),s=b(a("../../../../../../app/selectors/selectEditableValue")),u=b(a("../../../../../../app/thunks/updateEditableValues")),d=b(a("../../../../../../app/utils/editable-value/isMapped")),f=b(a("../../../../../../common/components/MappingSelector")),g=(a("../../../../../../prop-types/index"),b(a("./DateEditableFormatInput")));function b(e){return e&&e.__esModule?e:{default:e}}function m(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 E(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?m(Object(a),!0).forEach((function(t){y(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):m(Object(a)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}function y(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