/* GuestsPanel.c generated by valac 0.56.19, the Vala compiler
 * generated from GuestsPanel.vala, do not modify */

/*
 * SPDX-License-Identifier: GPL-3.0-or-later
 * SPDX-FileCopyrightText: 2011-2026 elementary, Inc. (https://elementary.io)
 *
 * Authored by: Jaap Broekhuizen
 */

#include <gtk/gtk.h>
#include <glib-object.h>
#include <libical-glib/libical-glib.h>
#include <gee.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <folks/folks.h>
#include <gio/gio.h>
#include <glib/gi18n-lib.h>
#include <granite.h>

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif
#if !defined(VALA_EXTERN)
#if defined(_MSC_VER)
#define VALA_EXTERN __declspec(dllexport) extern
#elif __GNUC__ >= 4
#define VALA_EXTERN __attribute__((visibility("default"))) extern
#else
#define VALA_EXTERN extern
#endif
#endif

#define MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL (maya_view_event_edition_guests_panel_get_type ())
#define MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanel))
#define MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanelClass))
#define MAYA_VIEW_EVENT_EDITION_IS_GUESTS_PANEL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL))
#define MAYA_VIEW_EVENT_EDITION_IS_GUESTS_PANEL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL))
#define MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanelClass))

typedef struct _MayaViewEventEditionGuestsPanel MayaViewEventEditionGuestsPanel;
typedef struct _MayaViewEventEditionGuestsPanelClass MayaViewEventEditionGuestsPanelClass;
typedef struct _MayaViewEventEditionGuestsPanelPrivate MayaViewEventEditionGuestsPanelPrivate;
enum  {
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_0_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_NUM_PROPERTIES
};
static GParamSpec* maya_view_event_edition_guests_panel_properties[MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_NUM_PROPERTIES];
typedef enum  {
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_ICON = 0,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_NAME,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_STATUS,
	MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_N_COLUMNS
} MayaViewEventEditionGuestsPanelCOLUMNS;

#define MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_TYPE_COLUMNS (maya_view_event_edition_guests_panel_columns_get_type ())
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID (maya_view_event_edition_guest_grid_get_type ())
#define MAYA_VIEW_EVENT_EDITION_GUEST_GRID(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID, MayaViewEventEditionGuestGrid))
#define MAYA_VIEW_EVENT_EDITION_GUEST_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID, MayaViewEventEditionGuestGridClass))
#define MAYA_VIEW_EVENT_EDITION_IS_GUEST_GRID(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID))
#define MAYA_VIEW_EVENT_EDITION_IS_GUEST_GRID_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID))
#define MAYA_VIEW_EVENT_EDITION_GUEST_GRID_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MAYA_VIEW_EVENT_EDITION_TYPE_GUEST_GRID, MayaViewEventEditionGuestGridClass))

typedef struct _MayaViewEventEditionGuestGrid MayaViewEventEditionGuestGrid;
typedef struct _MayaViewEventEditionGuestGridClass MayaViewEventEditionGuestGridClass;
typedef struct _Block11Data Block11Data;
typedef struct _MayaViewEventEditionGuestsPanelLoadContactsData MayaViewEventEditionGuestsPanelLoadContactsData;
#define _g_free0(var) (var = (g_free (var), NULL))

struct _MayaViewEventEditionGuestsPanel {
	GtkBox parent_instance;
	MayaViewEventEditionGuestsPanelPrivate * priv;
};

struct _MayaViewEventEditionGuestsPanelClass {
	GtkBoxClass parent_class;
};

struct _MayaViewEventEditionGuestsPanelPrivate {
	ICalComponent* _component;
	GtkEntry* guest_entry;
	GtkEntryCompletion* guest_completion;
	GtkListBox* guest_list;
	GeeArrayList* attendees;
	GtkListStore* guest_store;
};

struct _Block11Data {
	int _ref_count_;
	MayaViewEventEditionGuestsPanel* self;
	MayaViewEventEditionGuestGrid* guest_element;
};

struct _MayaViewEventEditionGuestsPanelLoadContactsData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	MayaViewEventEditionGuestsPanel* self;
	FolksIndividualAggregator* aggregator;
	FolksIndividualAggregator* _tmp0_;
	FolksIndividualAggregator* _tmp1_;
	gboolean _tmp2_;
	gboolean _tmp3_;
	FolksIndividualAggregator* _tmp4_;
	GeeMap* _tmp5_;
	GeeMap* _tmp6_;
	FolksIndividualAggregator* _tmp7_;
	FolksIndividualAggregator* _tmp8_;
};

static gint MayaViewEventEditionGuestsPanel_private_offset;
static gpointer maya_view_event_edition_guests_panel_parent_class = NULL;

VALA_EXTERN GType maya_view_event_edition_guests_panel_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MayaViewEventEditionGuestsPanel, g_object_unref)
static GType maya_view_event_edition_guests_panel_columns_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
VALA_EXTERN MayaViewEventEditionGuestsPanel* maya_view_event_edition_guests_panel_new (ICalComponent* component);
VALA_EXTERN MayaViewEventEditionGuestsPanel* maya_view_event_edition_guests_panel_construct (GType object_type,
                                                                                 ICalComponent* component);
static void maya_view_event_edition_guests_panel_apply_contact_store_model (MayaViewEventEditionGuestsPanel* self,
                                                                     GeeMap* contacts);
VALA_EXTERN void maya_view_event_edition_guests_panel_save (MayaViewEventEditionGuestsPanel* self);
VALA_EXTERN ICalComponent* maya_view_event_edition_guests_panel_get_component (MayaViewEventEditionGuestsPanel* self);
static void maya_view_event_edition_guests_panel_add_guest (MayaViewEventEditionGuestsPanel* self,
                                                     ICalProperty* attendee);
VALA_EXTERN GType maya_view_event_edition_guest_grid_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MayaViewEventEditionGuestGrid, g_object_unref)
static Block11Data* block11_data_ref (Block11Data* _data11_);
static void block11_data_unref (void * _userdata_);
VALA_EXTERN MayaViewEventEditionGuestGrid* maya_view_event_edition_guest_grid_new (ICalProperty* attendee);
VALA_EXTERN MayaViewEventEditionGuestGrid* maya_view_event_edition_guest_grid_construct (GType object_type,
                                                                             ICalProperty* attendee);
VALA_EXTERN ICalProperty* maya_view_event_edition_guest_grid_get_attendee (MayaViewEventEditionGuestGrid* self);
static void __lambda12_ (Block11Data* _data11_);
static void ___lambda12__maya_view_event_edition_guest_grid_removed (MayaViewEventEditionGuestGrid* _sender,
                                                              gpointer self);
static gboolean maya_view_event_edition_guests_panel_suggestion_selected (MayaViewEventEditionGuestsPanel* self,
                                                                   GtkTreeModel* model,
                                                                   GtkTreeIter* iter);
static void maya_view_event_edition_guests_panel_load_contacts_data_free (gpointer _data);
static void maya_view_event_edition_guests_panel_load_contacts (MayaViewEventEditionGuestsPanel* self,
                                                         GAsyncReadyCallback _callback_,
                                                         gpointer _user_data_);
static void maya_view_event_edition_guests_panel_load_contacts_finish (MayaViewEventEditionGuestsPanel* self,
                                                                GAsyncResult* _res_);
static gboolean maya_view_event_edition_guests_panel_load_contacts_co (MayaViewEventEditionGuestsPanelLoadContactsData* _data_);
static void ___lambda13_ (MayaViewEventEditionGuestsPanel* self);
static void ____lambda13__g_object_notify (GObject* _sender,
                                    GParamSpec* pspec,
                                    gpointer self);
static void maya_view_event_edition_guests_panel_set_component (MayaViewEventEditionGuestsPanel* self,
                                                         ICalComponent* value);
VALA_EXTERN const gchar* maya_view_event_edition_guests_panel_get_guests (MayaViewEventEditionGuestsPanel* self);
VALA_EXTERN void maya_view_event_edition_guests_panel_set_guests (MayaViewEventEditionGuestsPanel* self,
                                                      const gchar* value);
static GObject * maya_view_event_edition_guests_panel_constructor (GType type,
                                                            guint n_construct_properties,
                                                            GObjectConstructParam * construct_properties);
static gboolean _maya_view_event_edition_guests_panel___lambda14_ (MayaViewEventEditionGuestsPanel* self,
                                                            GtkTreeModel* model,
                                                            GtkTreeIter* iter);
static gboolean __maya_view_event_edition_guests_panel___lambda14__gtk_entry_completion_match_selected (GtkEntryCompletion* _sender,
                                                                                                 GtkTreeModel* model,
                                                                                                 GtkTreeIter* iter,
                                                                                                 gpointer self);
static gboolean _maya_view_event_edition_guests_panel___lambda15_ (MayaViewEventEditionGuestsPanel* self,
                                                            GtkEntryCompletion* completion,
                                                            const gchar* key,
                                                            GtkTreeIter* iter);
static gboolean __maya_view_event_edition_guests_panel___lambda15__gtk_entry_completion_match_func (GtkEntryCompletion* completion,
                                                                                             const gchar* key,
                                                                                             GtkTreeIter* iter,
                                                                                             gpointer self);
static void _maya_view_event_edition_guests_panel___lambda16_ (MayaViewEventEditionGuestsPanel* self);
static void __maya_view_event_edition_guests_panel___lambda16__gtk_entry_activate (GtkEntry* _sender,
                                                                            gpointer self);
static void maya_view_event_edition_guests_panel_finalize (GObject * obj);
static GType maya_view_event_edition_guests_panel_get_type_once (void);
static void _vala_maya_view_event_edition_guests_panel_get_property (GObject * object,
                                                              guint property_id,
                                                              GValue * value,
                                                              GParamSpec * pspec);
static void _vala_maya_view_event_edition_guests_panel_set_property (GObject * object,
                                                              guint property_id,
                                                              const GValue * value,
                                                              GParamSpec * pspec);

static inline gpointer
maya_view_event_edition_guests_panel_get_instance_private (MayaViewEventEditionGuestsPanel* self)
{
	return G_STRUCT_MEMBER_P (self, MayaViewEventEditionGuestsPanel_private_offset);
}

static GType
maya_view_event_edition_guests_panel_columns_get_type_once (void)
{
	static const GEnumValue values[] = {{MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_ICON, "MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_ICON", "icon"}, {MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_NAME, "MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_NAME", "name"}, {MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_STATUS, "MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_STATUS", "status"}, {MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_N_COLUMNS, "MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COLUMNS_N_COLUMNS", "n-columns"}, {0, NULL, NULL}};
	GType maya_view_event_edition_guests_panel_columns_type_id;
	maya_view_event_edition_guests_panel_columns_type_id = g_enum_register_static ("MayaViewEventEditionGuestsPanelCOLUMNS", values);
	return maya_view_event_edition_guests_panel_columns_type_id;
}

static GType
maya_view_event_edition_guests_panel_columns_get_type (void)
{
	static volatile gsize maya_view_event_edition_guests_panel_columns_type_id__once = 0;
	if (g_once_init_enter (&maya_view_event_edition_guests_panel_columns_type_id__once)) {
		GType maya_view_event_edition_guests_panel_columns_type_id;
		maya_view_event_edition_guests_panel_columns_type_id = maya_view_event_edition_guests_panel_columns_get_type_once ();
		g_once_init_leave (&maya_view_event_edition_guests_panel_columns_type_id__once, maya_view_event_edition_guests_panel_columns_type_id);
	}
	return maya_view_event_edition_guests_panel_columns_type_id__once;
}

MayaViewEventEditionGuestsPanel*
maya_view_event_edition_guests_panel_construct (GType object_type,
                                                ICalComponent* component)
{
	MayaViewEventEditionGuestsPanel * self = NULL;
	g_return_val_if_fail (component != NULL, NULL);
	self = (MayaViewEventEditionGuestsPanel*) g_object_new (object_type, "component", component, NULL);
	return self;
}

MayaViewEventEditionGuestsPanel*
maya_view_event_edition_guests_panel_new (ICalComponent* component)
{
	return maya_view_event_edition_guests_panel_construct (MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, component);
}

/**
     * Add the contacts to the EntryCompletion model.
     */
static void
maya_view_event_edition_guests_panel_apply_contact_store_model (MayaViewEventEditionGuestsPanel* self,
                                                                GeeMap* contacts)
{
	GtkTreeIter contact = {0};
	GeeMapIterator* map_iterator = NULL;
	GeeMapIterator* _tmp0_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (contacts != NULL);
	_tmp0_ = gee_map_map_iterator (contacts);
	map_iterator = _tmp0_;
	while (TRUE) {
		GeeMapIterator* _tmp1_;
		_tmp1_ = map_iterator;
		if (!gee_map_iterator_next (_tmp1_)) {
			break;
		}
		{
			GeeIterator* _address_it = NULL;
			GeeMapIterator* _tmp2_;
			gpointer _tmp3_;
			FolksIndividual* _tmp4_;
			GeeSet* _tmp5_;
			GeeSet* _tmp6_;
			GeeIterator* _tmp7_;
			GeeIterator* _tmp8_;
			_tmp2_ = map_iterator;
			_tmp3_ = gee_map_iterator_get_value (_tmp2_);
			_tmp4_ = (FolksIndividual*) _tmp3_;
			_tmp5_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) _tmp4_);
			_tmp6_ = _tmp5_;
			_tmp7_ = gee_iterable_iterator ((GeeIterable*) _tmp6_);
			_tmp8_ = _tmp7_;
			_g_object_unref0 (_tmp4_);
			_address_it = _tmp8_;
			while (TRUE) {
				GeeIterator* _tmp9_;
				FolksEmailFieldDetails* address = NULL;
				GeeIterator* _tmp10_;
				gpointer _tmp11_;
				GtkListStore* _tmp12_;
				GtkTreeIter _tmp13_ = {0};
				GtkListStore* _tmp14_;
				GtkTreeIter _tmp15_;
				GeeMapIterator* _tmp16_;
				gpointer _tmp17_;
				FolksIndividual* _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				FolksEmailFieldDetails* _tmp21_;
				gconstpointer _tmp22_;
				gconstpointer _tmp23_;
				_tmp9_ = _address_it;
				if (!gee_iterator_next (_tmp9_)) {
					break;
				}
				_tmp10_ = _address_it;
				_tmp11_ = gee_iterator_get (_tmp10_);
				address = (FolksEmailFieldDetails*) _tmp11_;
				_tmp12_ = self->priv->guest_store;
				gtk_list_store_append (_tmp12_, &_tmp13_);
				contact = _tmp13_;
				_tmp14_ = self->priv->guest_store;
				_tmp15_ = contact;
				_tmp16_ = map_iterator;
				_tmp17_ = gee_map_iterator_get_value (_tmp16_);
				_tmp18_ = (FolksIndividual*) _tmp17_;
				_tmp19_ = folks_name_details_get_full_name ((FolksNameDetails*) _tmp18_);
				_tmp20_ = _tmp19_;
				_tmp21_ = address;
				_tmp22_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp21_);
				_tmp23_ = _tmp22_;
				gtk_list_store_set (_tmp14_, &_tmp15_, 0, _tmp20_, 1, (const gchar*) _tmp23_, -1);
				_g_object_unref0 (_tmp18_);
				_g_object_unref0 (address);
			}
			_g_object_unref0 (_address_it);
		}
	}
	_g_object_unref0 (map_iterator);
}

/**
     * Save the values in the dialog into the component.
     */
static gpointer
_g_object_ref0 (gpointer self)
{
	return self ? g_object_ref (self) : NULL;
}

void
maya_view_event_edition_guests_panel_save (MayaViewEventEditionGuestsPanel* self)
{
	g_return_if_fail (self != NULL);
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp0_ = FALSE;
			_tmp0_ = TRUE;
			while (TRUE) {
				ICalComponent* _tmp2_;
				ICalProperty* remove_prop = NULL;
				ICalProperty* found_prop = NULL;
				ICalProperty* _tmp7_;
				ICalProperty* _tmp8_;
				gboolean can_remove = FALSE;
				if (!_tmp0_) {
					gint _tmp1_;
					_tmp1_ = i;
					i = _tmp1_ + 1;
				}
				_tmp0_ = FALSE;
				_tmp2_ = self->priv->_component;
				if (!(i < i_cal_component_count_properties (_tmp2_, I_CAL_ATTENDEE_PROPERTY))) {
					break;
				}
				if (i == 0) {
					ICalComponent* _tmp3_;
					ICalProperty* _tmp4_;
					_tmp3_ = self->priv->_component;
					_tmp4_ = i_cal_component_get_first_property (_tmp3_, I_CAL_ATTENDEE_PROPERTY);
					_g_object_unref0 (remove_prop);
					remove_prop = _tmp4_;
				} else {
					ICalComponent* _tmp5_;
					ICalProperty* _tmp6_;
					_tmp5_ = self->priv->_component;
					_tmp6_ = i_cal_component_get_next_property (_tmp5_, I_CAL_ATTENDEE_PROPERTY);
					_g_object_unref0 (remove_prop);
					remove_prop = _tmp6_;
				}
				_tmp7_ = remove_prop;
				_tmp8_ = _g_object_ref0 (_tmp7_);
				found_prop = _tmp8_;
				can_remove = TRUE;
				{
					GeeArrayList* _attendee_list = NULL;
					GeeArrayList* _tmp9_;
					gint _attendee_size = 0;
					GeeArrayList* _tmp10_;
					gint _tmp11_;
					gint _tmp12_;
					gint _attendee_index = 0;
					_tmp9_ = self->priv->attendees;
					_attendee_list = _tmp9_;
					_tmp10_ = _attendee_list;
					_tmp11_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp10_);
					_tmp12_ = _tmp11_;
					_attendee_size = _tmp12_;
					_attendee_index = -1;
					while (TRUE) {
						gint _tmp13_;
						gint _tmp14_;
						ICalProperty* attendee = NULL;
						GeeArrayList* _tmp15_;
						gpointer _tmp16_;
						ICalProperty* _tmp17_;
						const gchar* _tmp18_;
						ICalProperty* _tmp19_;
						const gchar* _tmp20_;
						_attendee_index = _attendee_index + 1;
						_tmp13_ = _attendee_index;
						_tmp14_ = _attendee_size;
						if (!(_tmp13_ < _tmp14_)) {
							break;
						}
						_tmp15_ = _attendee_list;
						_tmp16_ = gee_abstract_list_get ((GeeAbstractList*) _tmp15_, _attendee_index);
						attendee = (ICalProperty*) _tmp16_;
						_tmp17_ = attendee;
						_tmp18_ = i_cal_property_get_uid (_tmp17_);
						_tmp19_ = remove_prop;
						_tmp20_ = i_cal_property_get_uid (_tmp19_);
						if (g_strcmp0 (_tmp18_, _tmp20_) == 0) {
							ICalProperty* _tmp21_;
							ICalProperty* _tmp22_;
							can_remove = FALSE;
							_tmp21_ = attendee;
							_tmp22_ = _g_object_ref0 (_tmp21_);
							_g_object_unref0 (found_prop);
							found_prop = _tmp22_;
						}
					}
				}
				if (can_remove == TRUE) {
					ICalComponent* _tmp23_;
					ICalProperty* _tmp24_;
					_tmp23_ = self->priv->_component;
					_tmp24_ = remove_prop;
					i_cal_component_remove_property (_tmp23_, _tmp24_);
				} else {
					ICalProperty* _tmp25_;
					ICalProperty* _tmp26_;
					_tmp25_ = found_prop;
					_tmp26_ = remove_prop;
					if (_tmp25_ != _tmp26_) {
						GeeArrayList* _tmp27_;
						ICalProperty* _tmp28_;
						_tmp27_ = self->priv->attendees;
						_tmp28_ = found_prop;
						gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp27_, _tmp28_);
					}
				}
				_g_object_unref0 (found_prop);
				_g_object_unref0 (remove_prop);
			}
		}
	}
	{
		GeeArrayList* _attendee_list = NULL;
		GeeArrayList* _tmp29_;
		gint _attendee_size = 0;
		GeeArrayList* _tmp30_;
		gint _tmp31_;
		gint _tmp32_;
		gint _attendee_index = 0;
		_tmp29_ = self->priv->attendees;
		_attendee_list = _tmp29_;
		_tmp30_ = _attendee_list;
		_tmp31_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp30_);
		_tmp32_ = _tmp31_;
		_attendee_size = _tmp32_;
		_attendee_index = -1;
		while (TRUE) {
			gint _tmp33_;
			gint _tmp34_;
			ICalProperty* attendee = NULL;
			GeeArrayList* _tmp35_;
			gpointer _tmp36_;
			ICalComponent* _tmp37_;
			ICalProperty* _tmp38_;
			ICalProperty* _tmp39_;
			ICalProperty* _tmp40_;
			_attendee_index = _attendee_index + 1;
			_tmp33_ = _attendee_index;
			_tmp34_ = _attendee_size;
			if (!(_tmp33_ < _tmp34_)) {
				break;
			}
			_tmp35_ = _attendee_list;
			_tmp36_ = gee_abstract_list_get ((GeeAbstractList*) _tmp35_, _attendee_index);
			attendee = (ICalProperty*) _tmp36_;
			_tmp37_ = self->priv->_component;
			_tmp38_ = attendee;
			_tmp39_ = i_cal_property_clone (_tmp38_);
			_tmp40_ = _tmp39_;
			i_cal_component_add_property (_tmp37_, _tmp40_);
			_g_object_unref0 (_tmp40_);
		}
	}
}

static Block11Data*
block11_data_ref (Block11Data* _data11_)
{
	g_atomic_int_inc (&_data11_->_ref_count_);
	return _data11_;
}

static void
block11_data_unref (void * _userdata_)
{
	Block11Data* _data11_;
	_data11_ = (Block11Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data11_->_ref_count_)) {
		MayaViewEventEditionGuestsPanel* self;
		self = _data11_->self;
		_g_object_unref0 (_data11_->guest_element);
		_g_object_unref0 (self);
		g_slice_free (Block11Data, _data11_);
	}
}

static void
__lambda12_ (Block11Data* _data11_)
{
	MayaViewEventEditionGuestsPanel* self;
	GeeArrayList* _tmp0_;
	ICalProperty* _tmp1_;
	ICalProperty* _tmp2_;
	self = _data11_->self;
	_tmp0_ = self->priv->attendees;
	_tmp1_ = maya_view_event_edition_guest_grid_get_attendee (_data11_->guest_element);
	_tmp2_ = _tmp1_;
	gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp0_, _tmp2_);
}

static void
___lambda12__maya_view_event_edition_guest_grid_removed (MayaViewEventEditionGuestGrid* _sender,
                                                         gpointer self)
{
	__lambda12_ (self);
}

static void
maya_view_event_edition_guests_panel_add_guest (MayaViewEventEditionGuestsPanel* self,
                                                ICalProperty* attendee)
{
	Block11Data* _data11_;
	MayaViewEventEditionGuestGrid* _tmp0_;
	GtkListBoxRow* row = NULL;
	GtkWidget* _tmp1_;
	GtkListBoxRow* _tmp2_ = NULL;
	GtkListBox* _tmp3_;
	GeeArrayList* _tmp4_;
	ICalProperty* _tmp5_;
	ICalProperty* _tmp6_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (attendee != NULL);
	_data11_ = g_slice_new0 (Block11Data);
	_data11_->_ref_count_ = 1;
	_data11_->self = g_object_ref (self);
	_tmp0_ = maya_view_event_edition_guest_grid_new (attendee);
	g_object_ref_sink (_tmp0_);
	_data11_->guest_element = _tmp0_;
	_tmp1_ = _g_object_ref0 ((GtkWidget*) _data11_->guest_element);
	_tmp2_ = (GtkListBoxRow*) gtk_list_box_row_new ();
	g_object_set ((GtkContainer*) _tmp2_, "child", _tmp1_, NULL);
	_g_object_unref0 (_tmp1_);
	g_object_ref_sink (_tmp2_);
	row = _tmp2_;
	gtk_widget_show_all ((GtkWidget*) row);
	_tmp3_ = self->priv->guest_list;
	gtk_container_add ((GtkContainer*) _tmp3_, (GtkWidget*) row);
	_tmp4_ = self->priv->attendees;
	_tmp5_ = maya_view_event_edition_guest_grid_get_attendee (_data11_->guest_element);
	_tmp6_ = _tmp5_;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp6_);
	g_signal_connect_data (_data11_->guest_element, "removed", (GCallback) ___lambda12__maya_view_event_edition_guest_grid_removed, block11_data_ref (_data11_), (GClosureNotify) block11_data_unref, 0);
	_g_object_unref0 (row);
	block11_data_unref (_data11_);
	_data11_ = NULL;
}

static gboolean
maya_view_event_edition_guests_panel_suggestion_selected (MayaViewEventEditionGuestsPanel* self,
                                                          GtkTreeModel* model,
                                                          GtkTreeIter* iter)
{
	ICalProperty* attendee = NULL;
	ICalProperty* _tmp0_;
	GValue selected_value = {0};
	GtkTreeIter _tmp1_;
	GValue _tmp2_ = {0};
	ICalProperty* _tmp3_;
	const gchar* _tmp4_;
	ICalProperty* _tmp5_;
	ICalProperty* _tmp6_;
	GtkEntry* _tmp7_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = i_cal_property_new (I_CAL_ATTENDEE_PROPERTY);
	attendee = _tmp0_;
	_tmp1_ = *iter;
	gtk_tree_model_get_value (model, &_tmp1_, 1, &_tmp2_);
	G_IS_VALUE (&selected_value) ? (g_value_unset (&selected_value), NULL) : NULL;
	selected_value = _tmp2_;
	_tmp3_ = attendee;
	_tmp4_ = g_value_get_string (&selected_value);
	i_cal_property_set_attendee (_tmp3_, _tmp4_);
	_tmp5_ = attendee;
	attendee = NULL;
	_tmp6_ = _tmp5_;
	maya_view_event_edition_guests_panel_add_guest (self, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->guest_entry;
	g_signal_emit_by_name ((GtkEditable*) _tmp7_, "delete-text", 0, -1);
	result = TRUE;
	G_IS_VALUE (&selected_value) ? (g_value_unset (&selected_value), NULL) : NULL;
	_g_object_unref0 (attendee);
	return result;
}

static void
maya_view_event_edition_guests_panel_load_contacts_data_free (gpointer _data)
{
	MayaViewEventEditionGuestsPanelLoadContactsData* _data_;
	_data_ = _data;
	_g_object_unref0 (_data_->self);
	g_slice_free (MayaViewEventEditionGuestsPanelLoadContactsData, _data_);
}

static void
maya_view_event_edition_guests_panel_load_contacts (MayaViewEventEditionGuestsPanel* self,
                                                    GAsyncReadyCallback _callback_,
                                                    gpointer _user_data_)
{
	MayaViewEventEditionGuestsPanelLoadContactsData* _data_;
	MayaViewEventEditionGuestsPanel* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (MayaViewEventEditionGuestsPanelLoadContactsData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, maya_view_event_edition_guests_panel_load_contacts_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	maya_view_event_edition_guests_panel_load_contacts_co (_data_);
}

static void
maya_view_event_edition_guests_panel_load_contacts_finish (MayaViewEventEditionGuestsPanel* self,
                                                           GAsyncResult* _res_)
{
	MayaViewEventEditionGuestsPanelLoadContactsData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), NULL);
}

static void
___lambda13_ (MayaViewEventEditionGuestsPanel* self)
{
	maya_view_event_edition_guests_panel_load_contacts (self, NULL, NULL);
}

static void
____lambda13__g_object_notify (GObject* _sender,
                               GParamSpec* pspec,
                               gpointer self)
{
	___lambda13_ ((MayaViewEventEditionGuestsPanel*) self);
}

static gboolean
maya_view_event_edition_guests_panel_load_contacts_co (MayaViewEventEditionGuestsPanelLoadContactsData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = folks_individual_aggregator_dup ();
	_data_->aggregator = _data_->_tmp0_;
	_data_->_tmp1_ = _data_->aggregator;
	_data_->_tmp2_ = folks_individual_aggregator_get_is_prepared (_data_->_tmp1_);
	_data_->_tmp3_ = _data_->_tmp2_;
	if (_data_->_tmp3_) {
		_data_->_tmp4_ = _data_->aggregator;
		_data_->_tmp5_ = folks_individual_aggregator_get_individuals (_data_->_tmp4_);
		_data_->_tmp6_ = _data_->_tmp5_;
		maya_view_event_edition_guests_panel_apply_contact_store_model (_data_->self, _data_->_tmp6_);
	} else {
		_data_->_tmp7_ = _data_->aggregator;
		g_signal_connect_object ((GObject*) _data_->_tmp7_, "notify::is-quiescent", (GCallback) ____lambda13__g_object_notify, _data_->self, 0);
		_data_->_tmp8_ = _data_->aggregator;
		folks_individual_aggregator_prepare (_data_->_tmp8_, NULL, NULL);
	}
	_g_object_unref0 (_data_->aggregator);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

ICalComponent*
maya_view_event_edition_guests_panel_get_component (MayaViewEventEditionGuestsPanel* self)
{
	ICalComponent* result;
	ICalComponent* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_component;
	result = _tmp0_;
	return result;
}

static void
maya_view_event_edition_guests_panel_set_component (MayaViewEventEditionGuestsPanel* self,
                                                    ICalComponent* value)
{
	ICalComponent* old_value;
	g_return_if_fail (self != NULL);
	old_value = maya_view_event_edition_guests_panel_get_component (self);
	if (old_value != value) {
		ICalComponent* _tmp0_;
		_tmp0_ = _g_object_ref0 (value);
		_g_object_unref0 (self->priv->_component);
		self->priv->_component = _tmp0_;
		g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_guests_panel_properties[MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY]);
	}
}

const gchar*
maya_view_event_edition_guests_panel_get_guests (MayaViewEventEditionGuestsPanel* self)
{
	const gchar* result;
	GtkEntry* _tmp0_;
	const gchar* _tmp1_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->guest_entry;
	_tmp1_ = gtk_entry_get_text (_tmp0_);
	result = _tmp1_;
	return result;
}

void
maya_view_event_edition_guests_panel_set_guests (MayaViewEventEditionGuestsPanel* self,
                                                 const gchar* value)
{
	GtkEntry* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->guest_entry;
	gtk_entry_set_text (_tmp0_, value);
	g_object_notify_by_pspec ((GObject *) self, maya_view_event_edition_guests_panel_properties[MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY]);
}

static gboolean
_maya_view_event_edition_guests_panel___lambda14_ (MayaViewEventEditionGuestsPanel* self,
                                                   GtkTreeModel* model,
                                                   GtkTreeIter* iter)
{
	GtkTreeIter _tmp0_;
	gboolean result;
	g_return_val_if_fail (model != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = *iter;
	result = maya_view_event_edition_guests_panel_suggestion_selected (self, model, &_tmp0_);
	return result;
}

static gboolean
__maya_view_event_edition_guests_panel___lambda14__gtk_entry_completion_match_selected (GtkEntryCompletion* _sender,
                                                                                        GtkTreeModel* model,
                                                                                        GtkTreeIter* iter,
                                                                                        gpointer self)
{
	gboolean result;
	result = _maya_view_event_edition_guests_panel___lambda14_ ((MayaViewEventEditionGuestsPanel*) self, model, iter);
	return result;
}

static gboolean
string_contains (const gchar* self,
                 const gchar* needle)
{
	gchar* _tmp0_;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (needle != NULL, FALSE);
	_tmp0_ = strstr ((gchar*) self, (gchar*) needle);
	result = _tmp0_ != NULL;
	return result;
}

static gboolean
_maya_view_event_edition_guests_panel___lambda15_ (MayaViewEventEditionGuestsPanel* self,
                                                   GtkEntryCompletion* completion,
                                                   const gchar* key,
                                                   GtkTreeIter* iter)
{
	GValue val1 = {0};
	GValue val2 = {0};
	GtkListStore* model = NULL;
	GtkTreeModel* _tmp0_;
	GtkListStore* _tmp1_;
	GtkListStore* _tmp2_;
	GtkTreeIter _tmp3_;
	GValue _tmp4_ = {0};
	GtkListStore* _tmp5_;
	GtkTreeIter _tmp6_;
	GValue _tmp7_ = {0};
	gboolean _tmp8_ = FALSE;
	const gchar* _tmp9_;
	gchar* _tmp10_;
	gchar* _tmp11_;
	gboolean _tmp12_;
	gboolean result;
	g_return_val_if_fail (completion != NULL, FALSE);
	g_return_val_if_fail (key != NULL, FALSE);
	g_return_val_if_fail (iter != NULL, FALSE);
	_tmp0_ = gtk_entry_completion_get_model (completion);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, gtk_list_store_get_type (), GtkListStore));
	model = _tmp1_;
	_tmp2_ = model;
	_tmp3_ = *iter;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp2_, &_tmp3_, 0, &_tmp4_);
	G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
	val1 = _tmp4_;
	_tmp5_ = model;
	_tmp6_ = *iter;
	gtk_tree_model_get_value ((GtkTreeModel*) _tmp5_, &_tmp6_, 1, &_tmp7_);
	G_IS_VALUE (&val2) ? (g_value_unset (&val2), NULL) : NULL;
	val2 = _tmp7_;
	_tmp9_ = g_value_get_string (&val1);
	_tmp10_ = g_utf8_casefold (_tmp9_, (gssize) -1);
	_tmp11_ = _tmp10_;
	_tmp12_ = string_contains (_tmp11_, key);
	_g_free0 (_tmp11_);
	if (_tmp12_) {
		_tmp8_ = TRUE;
	} else {
		const gchar* _tmp13_;
		gchar* _tmp14_;
		gchar* _tmp15_;
		_tmp13_ = g_value_get_string (&val2);
		_tmp14_ = g_utf8_casefold (_tmp13_, (gssize) -1);
		_tmp15_ = _tmp14_;
		_tmp8_ = string_contains (_tmp15_, key);
		_g_free0 (_tmp15_);
	}
	if (_tmp8_) {
		result = TRUE;
		_g_object_unref0 (model);
		G_IS_VALUE (&val2) ? (g_value_unset (&val2), NULL) : NULL;
		G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
		return result;
	}
	result = FALSE;
	_g_object_unref0 (model);
	G_IS_VALUE (&val2) ? (g_value_unset (&val2), NULL) : NULL;
	G_IS_VALUE (&val1) ? (g_value_unset (&val1), NULL) : NULL;
	return result;
}

static gboolean
__maya_view_event_edition_guests_panel___lambda15__gtk_entry_completion_match_func (GtkEntryCompletion* completion,
                                                                                    const gchar* key,
                                                                                    GtkTreeIter* iter,
                                                                                    gpointer self)
{
	gboolean result;
	result = _maya_view_event_edition_guests_panel___lambda15_ ((MayaViewEventEditionGuestsPanel*) self, completion, key, iter);
	return result;
}

static void
_maya_view_event_edition_guests_panel___lambda16_ (MayaViewEventEditionGuestsPanel* self)
{
	ICalProperty* attendee = NULL;
	ICalProperty* _tmp0_;
	ICalProperty* _tmp1_;
	GtkEntry* _tmp2_;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	ICalProperty* _tmp5_;
	ICalProperty* _tmp6_;
	GtkEntry* _tmp7_;
	_tmp0_ = i_cal_property_new (I_CAL_ATTENDEE_PROPERTY);
	attendee = _tmp0_;
	_tmp1_ = attendee;
	_tmp2_ = self->priv->guest_entry;
	_tmp3_ = gtk_entry_get_text (_tmp2_);
	_tmp4_ = _tmp3_;
	i_cal_property_set_attendee (_tmp1_, _tmp4_);
	_tmp5_ = attendee;
	attendee = NULL;
	_tmp6_ = _tmp5_;
	maya_view_event_edition_guests_panel_add_guest (self, _tmp6_);
	_g_object_unref0 (_tmp6_);
	_tmp7_ = self->priv->guest_entry;
	g_signal_emit_by_name ((GtkEditable*) _tmp7_, "delete-text", 0, -1);
	_g_object_unref0 (attendee);
}

static void
__maya_view_event_edition_guests_panel___lambda16__gtk_entry_activate (GtkEntry* _sender,
                                                                       gpointer self)
{
	_maya_view_event_edition_guests_panel___lambda16_ ((MayaViewEventEditionGuestsPanel*) self);
}

static GObject *
maya_view_event_edition_guests_panel_constructor (GType type,
                                                  guint n_construct_properties,
                                                  GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	MayaViewEventEditionGuestsPanel * self;
	GeeArrayList* _tmp0_;
	GtkListStore* _tmp1_;
	GtkLabel* no_guests_label = NULL;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkStyleContext* _tmp4_;
	GtkLabel* _tmp5_;
	GtkStyleContext* _tmp6_;
	GtkLabel* _tmp7_;
	GtkListBox* _tmp8_ = NULL;
	GtkListBox* _tmp9_;
	GtkLabel* _tmp10_;
	GraniteHeaderLabel* guest_label = NULL;
	GtkListBox* _tmp11_;
	GtkWidget* _tmp12_;
	GraniteHeaderLabel* _tmp13_ = NULL;
	GtkScrolledWindow* guest_scrolledwindow = NULL;
	GtkListBox* _tmp14_;
	GtkWidget* _tmp15_;
	GtkScrolledWindow* _tmp16_ = NULL;
	GtkFrame* frame = NULL;
	GtkScrolledWindow* _tmp17_;
	GtkWidget* _tmp18_;
	GtkFrame* _tmp19_ = NULL;
	GtkEntryCompletion* _tmp20_;
	GtkEntryCompletion* _tmp21_;
	GtkEntryCompletion* _tmp22_;
	GtkListStore* _tmp23_;
	GtkEntryCompletion* _tmp24_;
	GtkEntryCompletion* _tmp25_;
	GtkEntryCompletion* _tmp26_;
	GtkEntryCompletion* _tmp27_;
	gchar* _tmp28_;
	GtkSearchEntry* _tmp29_ = NULL;
	GtkEntry* _tmp30_;
	GtkEntryCompletion* _tmp31_;
	GtkEntry* _tmp32_;
	GraniteHeaderLabel* _tmp33_;
	GtkEntry* _tmp34_;
	GtkFrame* _tmp35_;
	ICalProperty* property = NULL;
	ICalComponent* _tmp36_;
	ICalProperty* _tmp37_;
	parent_class = G_OBJECT_CLASS (maya_view_event_edition_guests_panel_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanel);
	_tmp0_ = gee_array_list_new (i_cal_property_get_type (), NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->attendees);
	self->priv->attendees = _tmp0_;
	_tmp1_ = gtk_list_store_new (2, G_TYPE_STRING, G_TYPE_STRING, -1);
	_g_object_unref0 (self->priv->guest_store);
	self->priv->guest_store = _tmp1_;
	maya_view_event_edition_guests_panel_load_contacts (self, NULL, NULL);
	_tmp2_ = (GtkLabel*) gtk_label_new (_ ("No Invitees"));
	g_object_ref_sink (_tmp2_);
	no_guests_label = _tmp2_;
	_tmp3_ = no_guests_label;
	_tmp4_ = gtk_widget_get_style_context ((GtkWidget*) _tmp3_);
	gtk_style_context_add_class (_tmp4_, GRANITE_STYLE_CLASS_H3_LABEL);
	_tmp5_ = no_guests_label;
	_tmp6_ = gtk_widget_get_style_context ((GtkWidget*) _tmp5_);
	gtk_style_context_add_class (_tmp6_, GTK_STYLE_CLASS_DIM_LABEL);
	_tmp7_ = no_guests_label;
	gtk_widget_show ((GtkWidget*) _tmp7_);
	_tmp8_ = (GtkListBox*) gtk_list_box_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_widget_set_vexpand ((GtkWidget*) _tmp8_, TRUE);
	gtk_list_box_set_selection_mode (_tmp8_, GTK_SELECTION_NONE);
	g_object_ref_sink (_tmp8_);
	_g_object_unref0 (self->priv->guest_list);
	self->priv->guest_list = _tmp8_;
	_tmp9_ = self->priv->guest_list;
	_tmp10_ = no_guests_label;
	gtk_list_box_set_placeholder (_tmp9_, (GtkWidget*) _tmp10_);
	_tmp11_ = self->priv->guest_list;
	_tmp12_ = _g_object_ref0 ((GtkWidget*) _tmp11_);
	_tmp13_ = granite_header_label_new (_ ("Invitees"));
	gtk_label_set_mnemonic_widget ((GtkLabel*) _tmp13_, _tmp12_);
	_g_object_unref0 (_tmp12_);
	g_object_ref_sink (_tmp13_);
	guest_label = _tmp13_;
	_tmp14_ = self->priv->guest_list;
	_tmp15_ = _g_object_ref0 ((GtkWidget*) _tmp14_);
	_tmp16_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_set ((GtkContainer*) _tmp16_, "child", _tmp15_, NULL);
	_g_object_unref0 (_tmp15_);
	g_object_ref_sink (_tmp16_);
	guest_scrolledwindow = _tmp16_;
	_tmp17_ = guest_scrolledwindow;
	_tmp18_ = _g_object_ref0 ((GtkWidget*) _tmp17_);
	_tmp19_ = (GtkFrame*) gtk_frame_new (NULL);
	g_object_set ((GtkContainer*) _tmp19_, "child", _tmp18_, NULL);
	_g_object_unref0 (_tmp18_);
	g_object_ref_sink (_tmp19_);
	frame = _tmp19_;
	_tmp20_ = gtk_entry_completion_new ();
	_g_object_unref0 (self->priv->guest_completion);
	self->priv->guest_completion = _tmp20_;
	_tmp21_ = self->priv->guest_completion;
	gtk_entry_completion_set_minimum_key_length (_tmp21_, 3);
	_tmp22_ = self->priv->guest_completion;
	_tmp23_ = self->priv->guest_store;
	gtk_entry_completion_set_model (_tmp22_, (GtkTreeModel*) _tmp23_);
	_tmp24_ = self->priv->guest_completion;
	gtk_entry_completion_set_text_column (_tmp24_, 0);
	_tmp25_ = self->priv->guest_completion;
	gtk_entry_completion_set_text_column (_tmp25_, 1);
	_tmp26_ = self->priv->guest_completion;
	g_signal_connect_object (_tmp26_, "match-selected", (GCallback) __maya_view_event_edition_guests_panel___lambda14__gtk_entry_completion_match_selected, self, 0);
	_tmp27_ = self->priv->guest_completion;
	gtk_entry_completion_set_match_func (_tmp27_, __maya_view_event_edition_guests_panel___lambda15__gtk_entry_completion_match_func, g_object_ref (self), g_object_unref);
	_tmp28_ = g_strdup (_ ("Invite"));
	_tmp29_ = (GtkSearchEntry*) gtk_search_entry_new ();
	gtk_widget_set_hexpand ((GtkWidget*) _tmp29_, TRUE);
	gtk_entry_set_placeholder_text ((GtkEntry*) _tmp29_, _tmp28_);
	_g_free0 (_tmp28_);
	g_object_ref_sink (_tmp29_);
	_g_object_unref0 (self->priv->guest_entry);
	self->priv->guest_entry = (GtkEntry*) _tmp29_;
	_tmp30_ = self->priv->guest_entry;
	_tmp31_ = self->priv->guest_completion;
	gtk_entry_set_completion (_tmp30_, _tmp31_);
	_tmp32_ = self->priv->guest_entry;
	g_signal_connect_object (_tmp32_, "activate", (GCallback) __maya_view_event_edition_guests_panel___lambda16__gtk_entry_activate, self, 0);
	gtk_widget_set_margin_start ((GtkWidget*) self, 12);
	gtk_widget_set_margin_end ((GtkWidget*) self, 12);
	gtk_box_set_spacing ((GtkBox*) self, 6);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp33_ = guest_label;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp33_);
	_tmp34_ = self->priv->guest_entry;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp34_);
	_tmp35_ = frame;
	gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp35_);
	_tmp36_ = self->priv->_component;
	_tmp37_ = i_cal_component_get_first_property (_tmp36_, I_CAL_ATTENDEE_PROPERTY);
	property = _tmp37_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp38_ = FALSE;
			_tmp38_ = TRUE;
			while (TRUE) {
				ICalComponent* _tmp40_;
				ICalProperty* _tmp41_;
				const gchar* _tmp42_;
				ICalComponent* _tmp44_;
				ICalProperty* _tmp45_;
				if (!_tmp38_) {
					gint _tmp39_;
					_tmp39_ = i;
					i = _tmp39_ + 1;
				}
				_tmp38_ = FALSE;
				_tmp40_ = self->priv->_component;
				if (!(i < i_cal_component_count_properties (_tmp40_, I_CAL_ATTENDEE_PROPERTY))) {
					break;
				}
				_tmp41_ = property;
				_tmp42_ = i_cal_property_get_attendee (_tmp41_);
				if (_tmp42_ != NULL) {
					ICalProperty* _tmp43_;
					_tmp43_ = property;
					maya_view_event_edition_guests_panel_add_guest (self, _tmp43_);
				}
				_tmp44_ = self->priv->_component;
				_tmp45_ = i_cal_component_get_next_property (_tmp44_, I_CAL_ATTENDEE_PROPERTY);
				_g_object_unref0 (property);
				property = _tmp45_;
			}
		}
	}
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (property);
	_g_object_unref0 (frame);
	_g_object_unref0 (guest_scrolledwindow);
	_g_object_unref0 (guest_label);
	_g_object_unref0 (no_guests_label);
	return obj;
}

static void
maya_view_event_edition_guests_panel_class_init (MayaViewEventEditionGuestsPanelClass * klass,
                                                 gpointer klass_data)
{
	maya_view_event_edition_guests_panel_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &MayaViewEventEditionGuestsPanel_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_maya_view_event_edition_guests_panel_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_maya_view_event_edition_guests_panel_set_property;
	G_OBJECT_CLASS (klass)->constructor = maya_view_event_edition_guests_panel_constructor;
	G_OBJECT_CLASS (klass)->finalize = maya_view_event_edition_guests_panel_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY, maya_view_event_edition_guests_panel_properties[MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY] = g_param_spec_object ("component", "component", "component", i_cal_component_get_type (), G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY));
	g_object_class_install_property (G_OBJECT_CLASS (klass), MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY, maya_view_event_edition_guests_panel_properties[MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY] = g_param_spec_string ("guests", "guests", "guests", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE | G_PARAM_WRITABLE));
}

static void
maya_view_event_edition_guests_panel_instance_init (MayaViewEventEditionGuestsPanel * self,
                                                    gpointer klass)
{
	self->priv = maya_view_event_edition_guests_panel_get_instance_private (self);
}

static void
maya_view_event_edition_guests_panel_finalize (GObject * obj)
{
	MayaViewEventEditionGuestsPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanel);
	_g_object_unref0 (self->priv->_component);
	_g_object_unref0 (self->priv->guest_entry);
	_g_object_unref0 (self->priv->guest_completion);
	_g_object_unref0 (self->priv->guest_list);
	_g_object_unref0 (self->priv->attendees);
	_g_object_unref0 (self->priv->guest_store);
	G_OBJECT_CLASS (maya_view_event_edition_guests_panel_parent_class)->finalize (obj);
}

static GType
maya_view_event_edition_guests_panel_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (MayaViewEventEditionGuestsPanelClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) maya_view_event_edition_guests_panel_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (MayaViewEventEditionGuestsPanel), 0, (GInstanceInitFunc) maya_view_event_edition_guests_panel_instance_init, NULL };
	GType maya_view_event_edition_guests_panel_type_id;
	maya_view_event_edition_guests_panel_type_id = g_type_register_static (gtk_box_get_type (), "MayaViewEventEditionGuestsPanel", &g_define_type_info, 0);
	MayaViewEventEditionGuestsPanel_private_offset = g_type_add_instance_private (maya_view_event_edition_guests_panel_type_id, sizeof (MayaViewEventEditionGuestsPanelPrivate));
	return maya_view_event_edition_guests_panel_type_id;
}

GType
maya_view_event_edition_guests_panel_get_type (void)
{
	static volatile gsize maya_view_event_edition_guests_panel_type_id__once = 0;
	if (g_once_init_enter (&maya_view_event_edition_guests_panel_type_id__once)) {
		GType maya_view_event_edition_guests_panel_type_id;
		maya_view_event_edition_guests_panel_type_id = maya_view_event_edition_guests_panel_get_type_once ();
		g_once_init_leave (&maya_view_event_edition_guests_panel_type_id__once, maya_view_event_edition_guests_panel_type_id);
	}
	return maya_view_event_edition_guests_panel_type_id__once;
}

static void
_vala_maya_view_event_edition_guests_panel_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec)
{
	MayaViewEventEditionGuestsPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanel);
	switch (property_id) {
		case MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY:
		g_value_set_object (value, maya_view_event_edition_guests_panel_get_component (self));
		break;
		case MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY:
		g_value_set_string (value, maya_view_event_edition_guests_panel_get_guests (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_maya_view_event_edition_guests_panel_set_property (GObject * object,
                                                         guint property_id,
                                                         const GValue * value,
                                                         GParamSpec * pspec)
{
	MayaViewEventEditionGuestsPanel * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, MAYA_VIEW_EVENT_EDITION_TYPE_GUESTS_PANEL, MayaViewEventEditionGuestsPanel);
	switch (property_id) {
		case MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_COMPONENT_PROPERTY:
		maya_view_event_edition_guests_panel_set_component (self, g_value_get_object (value));
		break;
		case MAYA_VIEW_EVENT_EDITION_GUESTS_PANEL_GUESTS_PROPERTY:
		maya_view_event_edition_guests_panel_set_guests (self, g_value_get_string (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

