#import "core/draw/participant.typ"

#let PAR-SPECIALS = ("?", "[", "]")
#let SHAPES = (
  "participant",
  "actor",
  "boundary",
  "control",
  "entity",
  "database",
  "collections",
  "queue",
  "custom"
)
#let DEFAULT-COLOR = rgb("#E2E2F0")

#let _par(
  name,
  display-name: auto,
  invisible: false,
  ..style
) = {
  return ((
    type: "par",
    draw: participant.render,
    name: name,
    display-name: if display-name == auto {name} else {display-name},
    invisible: false,
    style: style.named()
  ),)
}

#let _exists(participants, name) = {
  if name in PAR-SPECIALS {
    return true
  }

  for p in participants {
    if name == p.name {
      return true
    }
  }
  return false
}
