var P = function(t, e) {
  switch (t) {
    case "P":
      return e.date({
        width: "short"
      });
    case "PP":
      return e.date({
        width: "medium"
      });
    case "PPP":
      return e.date({
        width: "long"
      });
    case "PPPP":
    default:
      return e.date({
        width: "full"
      });
  }
}, c = function(t, e) {
  switch (t) {
    case "p":
      return e.time({
        width: "short"
      });
    case "pp":
      return e.time({
        width: "medium"
      });
    case "ppp":
      return e.time({
        width: "long"
      });
    case "pppp":
    default:
      return e.time({
        width: "full"
      });
  }
}, s = function(t, e) {
  var i = t.match(/(P+)(p+)?/) || [], d = i[1], u = i[2];
  if (!u)
    return P(t, e);
  var a;
  switch (d) {
    case "P":
      a = e.dateTime({
        width: "short"
      });
      break;
    case "PP":
      a = e.dateTime({
        width: "medium"
      });
      break;
    case "PPP":
      a = e.dateTime({
        width: "long"
      });
      break;
    case "PPPP":
    default:
      a = e.dateTime({
        width: "full"
      });
      break;
  }
  return a.replace("{{date}}", P(d, e)).replace("{{time}}", c(u, e));
}, h = {
  p: c,
  P: s
};
export {
  h as default
};
