///|
fn main {
  let bundle = @runtime.Bundle::new(
    "en-US",
    @intl.provider(),
    use_isolating=false,
  )
  ignore(
    bundle.add_resource(
      "invoice = Invoice for { $customer }: { NUMBER($total, minimumFractionDigits: 2) }\ndue = Due { DATETIME($date, year: \"numeric\", month: \"long\", day: \"numeric\") }\nitems = { $count ->\n    [one] One item\n   *[other] { $count } items\n}\n",
    ),
  )
  let total = @runtime.Number(1234.5, { "style": "currency", "currency": "USD" })
  let date = @runtime.DateTime(1792454400000, { "timeZone": "UTC" })
  let invoice = bundle.format("invoice", arguments={
    "customer": @runtime.Text("Ada"),
    "total": total,
  })
  let due = bundle.format("due", arguments={ "date": date })
  let items = bundle.format("items", arguments={ "count": @runtime.number(2) })
  if invoice.value != "Invoice for Ada: $1,234.50" ||
    due.value != "Due October 20, 2026" ||
    items.value != "2 items" {
    abort("Invoice localization mismatch")
  }
  if !invoice.errors.is_empty() ||
    !due.errors.is_empty() ||
    !items.errors.is_empty() {
    abort("Unexpected invoice errors")
  }
  println(invoice.value)
  println(due.value)
  println(items.value)
}