import ParcelCore enum RoomReminderApplication: Hashable { case bundle(String) case process(Int32) init(_ app: AppID) { self = app.bundleID.isEmpty ? .process(app.pid) : .bundle(app.bundleID) } init?(_ notice: FeedbackNotice, state: State) { if let bundle = notice.bundleID, !bundle.isEmpty { self = .bundle(bundle) } else if let processIdentifier = notice.processIdentifier { self = .process(processIdentifier) } else if let window = notice.window, let app = state.windows[window]?.app { self.init(app) } else { return nil } } var bundleID: String? { guard case .bundle(let value) = self else { return nil } return value } }