Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/plugins/browser/components/page-structure/components/item-configuration-panels/DateEditableFormatInput",["module","exports","require","liferay!frontend-js-react-web$react","../../../../../../app/components/fragment-configuration-fields/SelectField","../../../../../../app/components/fragment-configuration-fields/TextField","../../../../../../app/config/constants/editableFragmentEntryProcessor","../../../../../../app/contexts/StoreContext","../../../../../../app/selectors/selectLanguageId","../../../../../../app/selectors/selectSegmentsExperienceId","../../../../../../app/thunks/updateEditableValues","../../../../../../app/utils/setIn"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({editableId:t,editableValueNamespace:a,editableValues:p,fragmentEntryLinkId:f}){const m=(0,u.useDispatch)(),y=p[a][t],b=(0,u.useSelector)(i.default),M=(0,u.useSelector)(s.default),[v,E]=(0,n.useState)((()=>y.config.dateFormat?D(y.config.dateFormat):g[0].value)),[F,S]=(0,n.useState)((()=>v===e.custom)),I=(e,a)=>{E(D(a)),m((0,c.default)({editableValues:(0,d.setIn)(p,[o.EDITABLE_FRAGMENT_ENTRY_PROCESSOR,t,"config",e],a),fragmentEntryLinkId:f,languageId:b,segmentsExperienceId:M}))};return n.default.createElement(n.default.Fragment,null,n.default.createElement(r.SelectField,{field:{label:Liferay.Language.get("date-format"),name:"dateFormat",typeOptions:{validValues:g}},onValueSelect:(t,a)=>{a===e.custom?S(!0):(S(!1),I(t,a))},value:v}),F&&n.default.createElement(l.TextField,{field:{label:Liferay.Language.get("custom-format"),name:"dateFormat"},onValueSelect:I,value:y.config.dateFormat}));function D(t){var a;const n=g.find((e=>t===e.value));return null!==(a=null==n?void 0:n.value)&&void 0!==a?a:e.custom}};var n=function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=f();if(t&&t.has(e))return t.get(e);var a={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var l=n?Object.getOwnPropertyDescriptor(e,r):null;l&&(l.get||l.set)?Object.defineProperty(a,r,l):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react")),r=a("../../../../../../app/components/fragment-configuration-fields/SelectField"),l=a("../../../../../../app/components/fragment-configuration-fields/TextField"),o=a("../../../../../../app/config/constants/editableFragmentEntryProcessor"),u=a("../../../../../../app/contexts/StoreContext"),i=p(a("../../../../../../app/selectors/selectLanguageId")),s=p(a("../../../../../../app/selectors/selectSegmentsExperienceId")),c=p(a("../../../../../../app/thunks/updateEditableValues")),d=a("../../../../../../app/utils/setIn");function p(e){return e&&e.__esModule?e:{default:e}}function f(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return f=function(){return e},e}const e={custom:"custom"},g=[{label:"MM/DD/YY",value:"MM/dd/yy"},{label:"DD/MM/YY",value:"dd/MM/yy"},{label:"YY/MM/DD",value:"yy/MM/dd"},{label:"DD/MM/YYYY",value:"dd/MM/yyyy"},{label:Liferay.Language.get("custom"),value:e.custom}]}}));
//# sourceMappingURL=DateEditableFormatInput.js.map