// What `/photos?show=` names: the whole library or its pictures (the films// are the Videos tool's own list, `/videos`) —// the route's value, read leniently, and the library list's filter word it// opens on (`media`'s `kind`). Storage opens the library by it too.importFoundationpublicenumPhotosShow: String, CaseIterable, Sendable {case allcase photos/// The route's `show` value, read leniently: anything this build does not/// know shows the whole library rather than an empty one.publicinit(route value: String?) {self = value.flatMap(PhotosShow.init(rawValue:)) ?? .all }/// What goes back into the route — `nil` for the whole library, so the/// plain `/photos` link stays the plain link.publicvar routeValue: String? { self == .all ? nil : rawValue }/// What the library is headed when it is opened to show this: nil keeps/// the table's own name ("Photos").publicvar title: String? { nil }/// The library's filter value it opens on: the `kind` it narrows to, or/// nil for all.publicvar kind: String? {switchself {case .all: returnnilcase .photos: return"photo" } }}