Liferay.Loader.define("@liferay/object-js-components-web@1.0.58/utils/datetime",["module","exports","require","liferay!frontend-js-dependencies-web$moment/min/moment-with-locales"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.generateDateConfigurations=function generateDateConfigurations({defaultLanguageId:e,locale:t,type:a}){let r=!1;const o="date_time"===a||"DateTime"===a,c=(0,n.default)().locale(null!=t?t:e),i=c.localeData().longDateFormat("L"),l=c.localeData().firstDayOfWeek(),f=c.localeData().longDateFormat("LT");let D=i;if(o){const[e]=f.split(s,1),t=1===e.length?"H"===e[0]?"H".concat(f):"h".concat(f):f;D="".concat(i," ").concat(t),r=f.endsWith("A")}const p=i.replace("YYYY","yyyy").replace("DD","dd").replace("D","d"),y=D.replace(u,"_");return{clayFormat:p,firstDayOfWeek:l,isDateTime:o,momentFormat:D,placeholder:y,serverFormat:o?d:m,use12Hours:r}},t.generateDate=function generateDate({isDateTime:e,momentFormat:t,serverFormat:a,value:r}){let c=r;if(e){const e=r.indexOf(" ");c=r.substring(0,e);const t=r.substring(e).replace(o,"_");c="".concat(c).concat(t)}const s={formattedDate:c,rawDate:""},i=(0,n.default)(c,t,!0);i.isValid()&&(s.rawDate=i.locale("en").format(a),s.years={end:i.year()+5,start:i.year()-5});return s},t.generateInputMask=function generateInputMask(t){const a=[];[...t].forEach((t=>{if("A"===t||"a"===t)return a.push(c),void a.push(i);a.push(r.test(t)?e:t)}));const n=t.split(l).reduce(((e,t)=>{switch(t){case"YYYY":return"".concat(e," yyyy");case"MM":return"".concat(e," mm");case"DD":return"".concat(e," dd");case"mm":return"".concat(e," MM");case"A":case"a":return e;case"":return"".concat(e," ");default:return"".concat(e," ").concat(t)}}),"").trim();return{mask:a,pipeFormat:n}};var n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(a("liferay!frontend-js-dependencies-web$moment/min/moment-with-locales"));const e=/\d/,r=/[a-z]/i,o=/-/g,c=/[AP]/i,s=/[^a-z]/gi,i=/M/i,l=/[^\w]/i,u=/\w/g,m="YYYY-MM-DD",d="YYYY-MM-DD HH:mm"}}));
//# sourceMappingURL=datetime.js.map