/* contacts-contact-editor.c generated by valac 0.21.2.6-90bab, the Vala compiler
 * generated from contacts-contact-editor.vala, do not modify */

/* -*- Mode: vala; indent-tabs-mode: t; c-basic-offset: 2; tab-width: 8 -*- */
/*
 * Copyright (C) 2011 Alexander Larsson <alexl@redhat.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
#include <folks/folks.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <glib/gi18n-lib.h>


#define CONTACTS_TYPE_ADDRESS_EDITOR (contacts_address_editor_get_type ())
#define CONTACTS_ADDRESS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditor))
#define CONTACTS_ADDRESS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditorClass))
#define CONTACTS_IS_ADDRESS_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_ADDRESS_EDITOR))
#define CONTACTS_IS_ADDRESS_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_ADDRESS_EDITOR))
#define CONTACTS_ADDRESS_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditorClass))

typedef struct _ContactsAddressEditor ContactsAddressEditor;
typedef struct _ContactsAddressEditorClass ContactsAddressEditorClass;
typedef struct _ContactsAddressEditorPrivate ContactsAddressEditorPrivate;
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))

#define CONTACTS_TYPE_CONTACT_EDITOR (contacts_contact_editor_get_type ())
#define CONTACTS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor))
#define CONTACTS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))
#define CONTACTS_IS_CONTACT_EDITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_IS_CONTACT_EDITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_EDITOR))
#define CONTACTS_CONTACT_EDITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorClass))

typedef struct _ContactsContactEditor ContactsContactEditor;
typedef struct _ContactsContactEditorClass ContactsContactEditorClass;
typedef struct _ContactsContactEditorPrivate ContactsContactEditorPrivate;

#define CONTACTS_TYPE_CONTACT (contacts_contact_get_type ())
#define CONTACTS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT, ContactsContact))
#define CONTACTS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT, ContactsContactClass))
#define CONTACTS_IS_CONTACT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT))
#define CONTACTS_IS_CONTACT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT))
#define CONTACTS_CONTACT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT, ContactsContactClass))

typedef struct _ContactsContact ContactsContact;
typedef struct _ContactsContactClass ContactsContactClass;

#define CONTACTS_CONTACT_EDITOR_TYPE_FIELD (contacts_contact_editor_field_get_type ())

#define CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA (contacts_contact_editor_row_data_get_type ())
typedef struct _ContactsContactEditorRowData ContactsContactEditorRowData;
typedef struct _ContactsContactEditorField ContactsContactEditorField;

#define CONTACTS_TYPE_TYPECOMBO (contacts_typecombo_get_type ())
#define CONTACTS_TYPECOMBO(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPECOMBO, ContactsTypeCombo))
#define CONTACTS_TYPECOMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPECOMBO, ContactsTypeComboClass))
#define CONTACTS_IS_TYPECOMBO(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPECOMBO))
#define CONTACTS_IS_TYPECOMBO_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPECOMBO))
#define CONTACTS_TYPECOMBO_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPECOMBO, ContactsTypeComboClass))

typedef struct _ContactsTypeCombo ContactsTypeCombo;
typedef struct _ContactsTypeComboClass ContactsTypeComboClass;
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))

#define CONTACTS_TYPE_TYPESET (contacts_typeset_get_type ())
#define CONTACTS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSet))
#define CONTACTS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))
#define CONTACTS_IS_TYPESET(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_TYPESET))
#define CONTACTS_IS_TYPESET_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_TYPESET))
#define CONTACTS_TYPESET_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_TYPESET, ContactsTypeSetClass))

typedef struct _ContactsTypeSet ContactsTypeSet;
typedef struct _ContactsTypeSetClass ContactsTypeSetClass;
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
typedef struct _Block24Data Block24Data;
typedef struct _Block25Data Block25Data;
#define _contacts_contact_editor_field_free0(var) ((var == NULL) ? NULL : (var = (contacts_contact_editor_field_free (var), NULL)))
#define _contacts_contact_editor_row_data_free0(var) ((var == NULL) ? NULL : (var = (contacts_contact_editor_row_data_free (var), NULL)))

#define CONTACTS_TYPE_CONTACT_FRAME (contacts_contact_frame_get_type ())
#define CONTACTS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrame))
#define CONTACTS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))
#define CONTACTS_IS_CONTACT_FRAME(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_IS_CONTACT_FRAME_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_CONTACT_FRAME))
#define CONTACTS_CONTACT_FRAME_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_CONTACT_FRAME, ContactsContactFrameClass))

typedef struct _ContactsContactFrame ContactsContactFrame;
typedef struct _ContactsContactFrameClass ContactsContactFrameClass;
typedef struct _Block26Data Block26Data;
typedef struct _ContactsContactPrivate ContactsContactPrivate;

#define CONTACTS_TYPE_STORE (contacts_store_get_type ())
#define CONTACTS_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_STORE, ContactsStore))
#define CONTACTS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_STORE, ContactsStoreClass))
#define CONTACTS_IS_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_STORE))
#define CONTACTS_IS_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_STORE))
#define CONTACTS_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_STORE, ContactsStoreClass))

typedef struct _ContactsStore ContactsStore;
typedef struct _ContactsStoreClass ContactsStoreClass;
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))

#define CONTACTS_CONTACT_EDITOR_TYPE_PROPERTY_DATA (contacts_contact_editor_property_data_get_type ())
typedef struct _ContactsContactEditorPropertyData ContactsContactEditorPropertyData;

#define CONTACTS_TYPE_FAKE_PERSONA (contacts_fake_persona_get_type ())
#define CONTACTS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersona))
#define CONTACTS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))
#define CONTACTS_IS_FAKE_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_IS_FAKE_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_FAKE_PERSONA))
#define CONTACTS_FAKE_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_FAKE_PERSONA, ContactsFakePersonaClass))

typedef struct _ContactsFakePersona ContactsFakePersona;
typedef struct _ContactsFakePersonaClass ContactsFakePersonaClass;

struct _ContactsAddressEditor {
	GtkBox parent_instance;
	ContactsAddressEditorPrivate * priv;
	GtkEntry* entries[7];
	FolksPostalAddressFieldDetails* details;
};

struct _ContactsAddressEditorClass {
	GtkBoxClass parent_class;
};

struct _ContactsContactEditor {
	GtkGrid parent_instance;
	ContactsContactEditorPrivate * priv;
};

struct _ContactsContactEditorClass {
	GtkGridClass parent_class;
};

struct _ContactsContactEditorRowData {
	FolksAbstractFieldDetails* details;
};

struct _ContactsContactEditorField {
	gboolean changed;
	GeeHashMap* rows;
};

struct _ContactsContactEditorPrivate {
	ContactsContact* contact;
	gint last_row;
	GeeHashMap* writable_personas;
};

struct _Block21Data {
	int _ref_count_;
	ContactsContactEditor * self;
	GtkEntry* value_entry;
	gint row;
	gchar* value;
};

struct _Block22Data {
	int _ref_count_;
	ContactsContactEditor * self;
	GtkEntry* value_entry;
	gchar* value;
	gint row;
};

struct _Block23Data {
	int _ref_count_;
	ContactsContactEditor * self;
	GtkTextView* value_text;
	gchar* value;
	gint row;
};

struct _Block24Data {
	int _ref_count_;
	ContactsContactEditor * self;
	gint row;
};

struct _Block25Data {
	int _ref_count_;
	ContactsContactEditor * self;
	ContactsAddressEditor* value_address;
	gint row;
};

struct _Block26Data {
	int _ref_count_;
	ContactsContactEditor * self;
	ContactsContactFrame* image_frame;
	GtkEntry* name_entry;
	ContactsContact* c;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksPresenceType presence_type;
	gchar* presence_message;
	gboolean is_phone;
	FolksIndividual* individual;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

struct _ContactsContactEditorPropertyData {
	FolksPersona* persona;
	GValue value;
};


static gpointer contacts_address_editor_parent_class = NULL;
extern gchar** contacts_contact_postal_element_props;
extern gint contacts_contact_postal_element_props_length1;
extern gchar** contacts_contact_postal_element_names;
extern gint contacts_contact_postal_element_names_length1;
static gpointer contacts_contact_editor_parent_class = NULL;

GType contacts_address_editor_get_type (void) G_GNUC_CONST;
enum  {
	CONTACTS_ADDRESS_EDITOR_DUMMY_PROPERTY
};
ContactsAddressEditor* contacts_address_editor_new (FolksPostalAddressFieldDetails* _details);
ContactsAddressEditor* contacts_address_editor_construct (GType object_type, FolksPostalAddressFieldDetails* _details);
static void _____lambda39_ (ContactsAddressEditor* self);
static void ______lambda39__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void contacts_address_editor_real_grab_focus (GtkWidget* base);
static void contacts_address_editor_finalize (GObject* obj);
GType contacts_contact_editor_get_type (void) G_GNUC_CONST;
GType contacts_contact_get_type (void) G_GNUC_CONST;
static GType contacts_contact_editor_field_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static GType contacts_contact_editor_row_data_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
static ContactsContactEditorRowData* contacts_contact_editor_row_data_dup (const ContactsContactEditorRowData* self);
static void contacts_contact_editor_row_data_free (ContactsContactEditorRowData* self);
static void contacts_contact_editor_row_data_copy (const ContactsContactEditorRowData* self, ContactsContactEditorRowData* dest);
static void contacts_contact_editor_row_data_destroy (ContactsContactEditorRowData* self);
static ContactsContactEditorField* contacts_contact_editor_field_dup (const ContactsContactEditorField* self);
static void contacts_contact_editor_field_free (ContactsContactEditorField* self);
static void contacts_contact_editor_field_copy (const ContactsContactEditorField* self, ContactsContactEditorField* dest);
static void contacts_contact_editor_field_destroy (ContactsContactEditorField* self);
#define CONTACTS_CONTACT_EDITOR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditorPrivate))
enum  {
	CONTACTS_CONTACT_EDITOR_DUMMY_PROPERTY
};
static void contacts_contact_editor_get_value_from_emails (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
GType contacts_typecombo_get_type (void) G_GNUC_CONST;
void contacts_typecombo_update_details (ContactsTypeCombo* self, FolksAbstractFieldDetails* details);
static void contacts_contact_editor_get_value_from_phones (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_urls (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_nickname (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_birthday (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_notes (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_get_value_from_addresses (ContactsContactEditor* self, GeeHashMap* rows, GValue* result);
static void contacts_contact_editor_set_field_changed (ContactsContactEditor* self, gint row);
static void contacts_contact_editor_remove_row (ContactsContactEditor* self, gint row);
GType contacts_typeset_get_type (void) G_GNUC_CONST;
static void contacts_contact_editor_attach_row_with_entry (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksAbstractFieldDetails* details, const gchar* value, const gchar* type);
static Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
ContactsTypeCombo* contacts_typecombo_new (ContactsTypeSet* type_set);
ContactsTypeCombo* contacts_typecombo_construct (GType object_type, ContactsTypeSet* type_set);
void contacts_typecombo_set_active (ContactsTypeCombo* self, FolksAbstractFieldDetails* details);
void contacts_typecombo_set_to (ContactsTypeCombo* self, const gchar* type);
static void __lambda40_ (Block21Data* _data21_);
static void ___lambda40__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda41_ (Block21Data* _data21_);
static void ___lambda41__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda42_ (Block21Data* _data21_);
static void ___lambda42__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda43_ (Block21Data* _data21_);
static void ___lambda43__gtk_widget_map (GtkWidget* _sender, gpointer self);
static void contacts_contact_editor_attach_row_with_entry_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void __lambda44_ (Block22Data* _data22_);
static void ___lambda44__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda45_ (Block22Data* _data22_);
static void ___lambda45__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda46_ (Block22Data* _data22_);
static void ___lambda46__gtk_widget_map (GtkWidget* _sender, gpointer self);
static void contacts_contact_editor_attach_row_with_text_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row);
static Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void __lambda47_ (Block23Data* _data23_);
static void ___lambda47__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self);
static void __lambda48_ (Block23Data* _data23_);
static void ___lambda48__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda49_ (Block23Data* _data23_);
static void ___lambda49__gtk_widget_map (GtkWidget* _sender, gpointer self);
static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row);
static Block24Data* block24_data_ref (Block24Data* _data24_);
static void block24_data_unref (void * _userdata_);
static void __lambda50_ (Block24Data* _data24_);
static void ___lambda50__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda51_ (Block24Data* _data24_);
static void ___lambda51__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void __lambda52_ (Block24Data* _data24_);
static void ___lambda52__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_for_address (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksPostalAddressFieldDetails* details, const gchar* type);
static Block25Data* block25_data_ref (Block25Data* _data25_);
static void block25_data_unref (void * _userdata_);
static void __lambda53_ (Block25Data* _data25_);
static void ___lambda53__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda54_ (Block25Data* _data25_);
static void ___lambda54__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self);
static void __lambda55_ (Block25Data* _data25_);
static void ___lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void __lambda56_ (Block25Data* _data25_);
static void ___lambda56__gtk_widget_map (GtkWidget* _sender, gpointer self);
static void contacts_contact_editor_add_edit_row (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, gint* row, gboolean add_empty, const gchar* type);
ContactsTypeSet* contacts_typeset_get_email (void);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
ContactsTypeSet* contacts_typeset_get_phone (void);
gboolean contacts_is_set (const gchar* str);
ContactsTypeSet* contacts_typeset_get_general (void);
static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx);
ContactsContactEditor* contacts_contact_editor_new (void);
ContactsContactEditor* contacts_contact_editor_construct (GType object_type);
void contacts_contact_editor_update (ContactsContactEditor* self, ContactsContact* c);
GType contacts_contact_frame_get_type (void) G_GNUC_CONST;
static Block26Data* block26_data_ref (Block26Data* _data26_);
static void block26_data_unref (void * _userdata_);
#define PROFILE_SIZE 96
ContactsContactFrame* contacts_contact_frame_new (gint size, gboolean with_button);
ContactsContactFrame* contacts_contact_frame_construct (GType object_type, gint size, gboolean with_button);
static void __lambda57_ (Block26Data* _data26_);
void contacts_change_avatar (ContactsContact* contact, ContactsContactFrame* image_frame);
static void ___lambda57__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self);
void contacts_contact_keep_widget_uptodate (ContactsContact* self, GtkWidget* w, GtkCallback callback, void* callback_target, GDestroyNotify callback_target_destroy_notify);
static void __lambda72_ (Block26Data* _data26_, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
GType contacts_store_get_type (void) G_GNUC_CONST;
static void ___lambda72__gtk_callback (GtkWidget* widget, gpointer self);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void __lambda73_ (Block26Data* _data26_);
static void ___lambda73__gtk_editable_changed (GtkEditable* _sender, gpointer self);
GeeList* contacts_contact_get_personas_for_display (ContactsContact* self);
gchar* contacts_contact_format_persona_store_name_for_contact (FolksPersona* persona);
gchar** contacts_contact_sort_persona_properties (gchar** props, int props_length1, int* result_length1);
void contacts_contact_editor_clear (ContactsContactEditor* self);
GType contacts_contact_editor_property_data_get_type (void) G_GNUC_CONST;
ContactsContactEditorPropertyData* contacts_contact_editor_property_data_dup (const ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_free (ContactsContactEditorPropertyData* self);
void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest);
void contacts_contact_editor_property_data_destroy (ContactsContactEditorPropertyData* self);
GeeHashMap* contacts_contact_editor_properties_changed (ContactsContactEditor* self);
gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result);
void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type);
ContactsFakePersona* contacts_fake_persona_new (ContactsContact* contact);
ContactsFakePersona* contacts_fake_persona_construct (GType object_type, ContactsContact* contact);
GType contacts_fake_persona_get_type (void) G_GNUC_CONST;
static void contacts_contact_editor_finalize (GObject* obj);
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);


static gpointer _g_object_ref0 (gpointer self) {
	return self ? g_object_ref (self) : NULL;
}


static void _____lambda39_ (ContactsAddressEditor* self) {
	g_signal_emit_by_name (self, "changed");
}


static void ______lambda39__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	_____lambda39_ (self);
}


ContactsAddressEditor* contacts_address_editor_construct (GType object_type, FolksPostalAddressFieldDetails* _details) {
	ContactsAddressEditor * self = NULL;
	FolksPostalAddressFieldDetails* _tmp0_ = NULL;
	FolksPostalAddressFieldDetails* _tmp1_ = NULL;
	g_return_val_if_fail (_details != NULL, NULL);
	self = (ContactsAddressEditor*) g_object_new (object_type, NULL);
	gtk_widget_set_hexpand ((GtkWidget*) self, TRUE);
	gtk_orientable_set_orientation ((GtkOrientable*) self, GTK_ORIENTATION_VERTICAL);
	_tmp0_ = _details;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->details);
	self->details = _tmp1_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp2_ = FALSE;
			_tmp2_ = TRUE;
			while (TRUE) {
				gboolean _tmp3_ = FALSE;
				gint _tmp5_ = 0;
				gchar* postal_part = NULL;
				FolksPostalAddressFieldDetails* _tmp6_ = NULL;
				gconstpointer _tmp7_ = NULL;
				FolksPostalAddress* _tmp8_ = NULL;
				gchar** _tmp9_ = NULL;
				gint _tmp9__length1 = 0;
				gint _tmp10_ = 0;
				const gchar* _tmp11_ = NULL;
				gint _tmp12_ = 0;
				GtkEntry* _tmp13_ = NULL;
				GtkEntry* _tmp14_ = NULL;
				gint _tmp15_ = 0;
				GtkEntry* _tmp16_ = NULL;
				gint _tmp17_ = 0;
				GtkEntry* _tmp18_ = NULL;
				gchar** _tmp19_ = NULL;
				gint _tmp19__length1 = 0;
				gint _tmp20_ = 0;
				const gchar* _tmp21_ = NULL;
				const gchar* _tmp22_ = NULL;
				gint _tmp26_ = 0;
				GtkEntry* _tmp27_ = NULL;
				GtkStyleContext* _tmp28_ = NULL;
				gint _tmp29_ = 0;
				GtkEntry* _tmp30_ = NULL;
				GtkStyleContext* _tmp31_ = NULL;
				gint _tmp32_ = 0;
				GtkEntry* _tmp33_ = NULL;
				gint _tmp34_ = 0;
				GtkEntry* _tmp35_ = NULL;
				_tmp3_ = _tmp2_;
				if (!_tmp3_) {
					gint _tmp4_ = 0;
					_tmp4_ = i;
					i = _tmp4_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp5_ = i;
				if (!(_tmp5_ < 7)) {
					break;
				}
				_tmp6_ = self->details;
				_tmp7_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp6_);
				_tmp8_ = _tmp7_;
				_tmp9_ = contacts_contact_postal_element_props;
				_tmp9__length1 = contacts_contact_postal_element_props_length1;
				_tmp10_ = i;
				_tmp11_ = _tmp9_[_tmp10_];
				g_object_get ((GObject*) ((FolksPostalAddress*) _tmp8_), _tmp11_, &postal_part, NULL);
				_tmp12_ = i;
				_tmp13_ = (GtkEntry*) gtk_entry_new ();
				g_object_ref_sink (_tmp13_);
				_g_object_unref0 (self->entries[_tmp12_]);
				self->entries[_tmp12_] = _tmp13_;
				_tmp14_ = self->entries[_tmp12_];
				_tmp15_ = i;
				_tmp16_ = self->entries[_tmp15_];
				gtk_widget_set_hexpand ((GtkWidget*) _tmp16_, TRUE);
				_tmp17_ = i;
				_tmp18_ = self->entries[_tmp17_];
				_tmp19_ = contacts_contact_postal_element_names;
				_tmp19__length1 = contacts_contact_postal_element_names_length1;
				_tmp20_ = i;
				_tmp21_ = _tmp19_[_tmp20_];
				g_object_set ((GObject*) _tmp18_, "placeholder-text", _tmp21_, NULL);
				_tmp22_ = postal_part;
				if (_tmp22_ != NULL) {
					gint _tmp23_ = 0;
					GtkEntry* _tmp24_ = NULL;
					const gchar* _tmp25_ = NULL;
					_tmp23_ = i;
					_tmp24_ = self->entries[_tmp23_];
					_tmp25_ = postal_part;
					gtk_entry_set_text (_tmp24_, _tmp25_);
				}
				_tmp26_ = i;
				_tmp27_ = self->entries[_tmp26_];
				_tmp28_ = gtk_widget_get_style_context ((GtkWidget*) _tmp27_);
				gtk_style_context_add_class (_tmp28_, "contacts-entry");
				_tmp29_ = i;
				_tmp30_ = self->entries[_tmp29_];
				_tmp31_ = gtk_widget_get_style_context ((GtkWidget*) _tmp30_);
				gtk_style_context_add_class (_tmp31_, "contacts-postal-entry");
				_tmp32_ = i;
				_tmp33_ = self->entries[_tmp32_];
				gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp33_);
				_tmp34_ = i;
				_tmp35_ = self->entries[_tmp34_];
				g_signal_connect_object ((GtkEditable*) _tmp35_, "changed", (GCallback) ______lambda39__gtk_editable_changed, self, 0);
				_g_free0 (postal_part);
			}
		}
	}
	return self;
}


ContactsAddressEditor* contacts_address_editor_new (FolksPostalAddressFieldDetails* _details) {
	return contacts_address_editor_construct (CONTACTS_TYPE_ADDRESS_EDITOR, _details);
}


static void contacts_address_editor_real_grab_focus (GtkWidget* base) {
	ContactsAddressEditor * self;
	GtkEntry* _tmp0_ = NULL;
	self = (ContactsAddressEditor*) base;
	_tmp0_ = self->entries[0];
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}


static void contacts_address_editor_class_init (ContactsAddressEditorClass * klass) {
	contacts_address_editor_parent_class = g_type_class_peek_parent (klass);
	GTK_WIDGET_CLASS (klass)->grab_focus = contacts_address_editor_real_grab_focus;
	G_OBJECT_CLASS (klass)->finalize = contacts_address_editor_finalize;
	g_signal_new ("changed", CONTACTS_TYPE_ADDRESS_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}


static void contacts_address_editor_instance_init (ContactsAddressEditor * self) {
}


static void contacts_address_editor_finalize (GObject* obj) {
	ContactsAddressEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_ADDRESS_EDITOR, ContactsAddressEditor);
	_vala_array_destroy (self->entries, 7, (GDestroyNotify) g_object_unref);
	_g_object_unref0 (self->details);
	G_OBJECT_CLASS (contacts_address_editor_parent_class)->finalize (obj);
}


GType contacts_address_editor_get_type (void) {
	static volatile gsize contacts_address_editor_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_address_editor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsAddressEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_address_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsAddressEditor), 0, (GInstanceInitFunc) contacts_address_editor_instance_init, NULL };
		GType contacts_address_editor_type_id;
		contacts_address_editor_type_id = g_type_register_static (GTK_TYPE_BOX, "ContactsAddressEditor", &g_define_type_info, 0);
		g_once_init_leave (&contacts_address_editor_type_id__volatile, contacts_address_editor_type_id);
	}
	return contacts_address_editor_type_id__volatile;
}


static void contacts_contact_editor_get_value_from_emails (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp37_ = NULL;
	GType _tmp38_ = 0UL;
	GValue _tmp39_ = {0};
	GeeHashSet* _tmp40_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			ContactsTypeCombo* _tmp15_ = NULL;
			GtkEntry* entry = NULL;
			GeeMapEntry* _tmp16_ = NULL;
			gconstpointer _tmp17_ = NULL;
			gint _tmp18_ = 0;
			GtkWidget* _tmp19_ = NULL;
			GtkEntry* _tmp20_ = NULL;
			ContactsTypeCombo* _tmp21_ = NULL;
			GeeMapEntry* _tmp22_ = NULL;
			gconstpointer _tmp23_ = NULL;
			ContactsContactEditorRowData* _tmp24_ = NULL;
			FolksAbstractFieldDetails* _tmp25_ = NULL;
			FolksEmailFieldDetails* details = NULL;
			GtkEntry* _tmp26_ = NULL;
			const gchar* _tmp27_ = NULL;
			GeeMapEntry* _tmp28_ = NULL;
			gconstpointer _tmp29_ = NULL;
			ContactsContactEditorRowData* _tmp30_ = NULL;
			FolksAbstractFieldDetails* _tmp31_ = NULL;
			GeeMultiMap* _tmp32_ = NULL;
			GeeMultiMap* _tmp33_ = NULL;
			FolksEmailFieldDetails* _tmp34_ = NULL;
			GeeHashSet* _tmp35_ = NULL;
			FolksEmailFieldDetails* _tmp36_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp14_) : NULL);
			combo = _tmp15_;
			_tmp16_ = row_entry;
			_tmp17_ = gee_map_entry_get_key (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp18_));
			_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp19_) : NULL);
			entry = _tmp20_;
			_tmp21_ = combo;
			_tmp22_ = row_entry;
			_tmp23_ = gee_map_entry_get_value (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = (*((ContactsContactEditorRowData*) _tmp24_)).details;
			contacts_typecombo_update_details (_tmp21_, _tmp25_);
			_tmp26_ = entry;
			_tmp27_ = gtk_entry_get_text (_tmp26_);
			_tmp28_ = row_entry;
			_tmp29_ = gee_map_entry_get_value (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = (*((ContactsContactEditorRowData*) _tmp30_)).details;
			_tmp32_ = folks_abstract_field_details_get_parameters (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = folks_email_field_details_new (_tmp27_, _tmp33_);
			details = _tmp34_;
			_tmp35_ = new_details;
			_tmp36_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp35_, _tmp36_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp37_ = new_details;
	_tmp38_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp37_);
	g_value_init (&_tmp39_, _tmp38_);
	new_value = _tmp39_;
	_tmp40_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp40_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_phones (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp37_ = NULL;
	GType _tmp38_ = 0UL;
	GValue _tmp39_ = {0};
	GeeHashSet* _tmp40_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			ContactsTypeCombo* _tmp15_ = NULL;
			GtkEntry* entry = NULL;
			GeeMapEntry* _tmp16_ = NULL;
			gconstpointer _tmp17_ = NULL;
			gint _tmp18_ = 0;
			GtkWidget* _tmp19_ = NULL;
			GtkEntry* _tmp20_ = NULL;
			ContactsTypeCombo* _tmp21_ = NULL;
			GeeMapEntry* _tmp22_ = NULL;
			gconstpointer _tmp23_ = NULL;
			ContactsContactEditorRowData* _tmp24_ = NULL;
			FolksAbstractFieldDetails* _tmp25_ = NULL;
			FolksPhoneFieldDetails* details = NULL;
			GtkEntry* _tmp26_ = NULL;
			const gchar* _tmp27_ = NULL;
			GeeMapEntry* _tmp28_ = NULL;
			gconstpointer _tmp29_ = NULL;
			ContactsContactEditorRowData* _tmp30_ = NULL;
			FolksAbstractFieldDetails* _tmp31_ = NULL;
			GeeMultiMap* _tmp32_ = NULL;
			GeeMultiMap* _tmp33_ = NULL;
			FolksPhoneFieldDetails* _tmp34_ = NULL;
			GeeHashSet* _tmp35_ = NULL;
			FolksPhoneFieldDetails* _tmp36_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp14_) : NULL);
			combo = _tmp15_;
			_tmp16_ = row_entry;
			_tmp17_ = gee_map_entry_get_key (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp18_));
			_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp19_) : NULL);
			entry = _tmp20_;
			_tmp21_ = combo;
			_tmp22_ = row_entry;
			_tmp23_ = gee_map_entry_get_value (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = (*((ContactsContactEditorRowData*) _tmp24_)).details;
			contacts_typecombo_update_details (_tmp21_, _tmp25_);
			_tmp26_ = entry;
			_tmp27_ = gtk_entry_get_text (_tmp26_);
			_tmp28_ = row_entry;
			_tmp29_ = gee_map_entry_get_value (_tmp28_);
			_tmp30_ = _tmp29_;
			_tmp31_ = (*((ContactsContactEditorRowData*) _tmp30_)).details;
			_tmp32_ = folks_abstract_field_details_get_parameters (_tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = folks_phone_field_details_new (_tmp27_, _tmp33_);
			details = _tmp34_;
			_tmp35_ = new_details;
			_tmp36_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp35_, _tmp36_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp37_ = new_details;
	_tmp38_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp37_);
	g_value_init (&_tmp39_, _tmp38_);
	new_value = _tmp39_;
	_tmp40_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp40_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_urls (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp27_ = NULL;
	GType _tmp28_ = 0UL;
	GValue _tmp29_ = {0};
	GeeHashSet* _tmp30_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkEntry* entry = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			GtkEntry* _tmp15_ = NULL;
			FolksUrlFieldDetails* details = NULL;
			GtkEntry* _tmp16_ = NULL;
			const gchar* _tmp17_ = NULL;
			GeeMapEntry* _tmp18_ = NULL;
			gconstpointer _tmp19_ = NULL;
			ContactsContactEditorRowData* _tmp20_ = NULL;
			FolksAbstractFieldDetails* _tmp21_ = NULL;
			GeeMultiMap* _tmp22_ = NULL;
			GeeMultiMap* _tmp23_ = NULL;
			FolksUrlFieldDetails* _tmp24_ = NULL;
			GeeHashSet* _tmp25_ = NULL;
			FolksUrlFieldDetails* _tmp26_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp14_) : NULL);
			entry = _tmp15_;
			_tmp16_ = entry;
			_tmp17_ = gtk_entry_get_text (_tmp16_);
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_value (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = (*((ContactsContactEditorRowData*) _tmp20_)).details;
			_tmp22_ = folks_abstract_field_details_get_parameters (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = folks_url_field_details_new (_tmp17_, _tmp23_);
			details = _tmp24_;
			_tmp25_ = new_details;
			_tmp26_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp25_, _tmp26_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp27_ = new_details;
	_tmp28_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp27_);
	g_value_init (&_tmp29_, _tmp28_);
	new_value = _tmp29_;
	_tmp30_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp30_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_nickname (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GValue new_value = {0};
	GValue _tmp0_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	new_value = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkEntry* entry = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			GtkEntry* _tmp15_ = NULL;
			GtkEntry* _tmp16_ = NULL;
			const gchar* _tmp17_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp14_) : NULL);
			entry = _tmp15_;
			_tmp16_ = entry;
			_tmp17_ = gtk_entry_get_text (_tmp16_);
			g_value_set_string (&new_value, _tmp17_);
			_g_object_unref0 (entry);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	*result = new_value;
	return;
}


static void contacts_contact_editor_get_value_from_birthday (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GValue new_value = {0};
	GValue _tmp0_ = {0};
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	g_value_init (&_tmp0_, G_TYPE_DATE_TIME);
	new_value = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkGrid* box = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			GtkGrid* _tmp15_ = NULL;
			GtkSpinButton* day_spin = NULL;
			GtkGrid* _tmp16_ = NULL;
			GtkWidget* _tmp17_ = NULL;
			GtkSpinButton* _tmp18_ = NULL;
			GtkComboBoxText* combo = NULL;
			GtkGrid* _tmp19_ = NULL;
			GtkWidget* _tmp20_ = NULL;
			GtkComboBoxText* _tmp21_ = NULL;
			GDateTime* bday = NULL;
			GtkGrid* _tmp22_ = NULL;
			gconstpointer _tmp23_ = NULL;
			GtkComboBoxText* _tmp24_ = NULL;
			gint _tmp25_ = 0;
			GtkSpinButton* _tmp26_ = NULL;
			gdouble _tmp27_ = 0.0;
			GDateTime* _tmp28_ = NULL;
			GDateTime* _tmp29_ = NULL;
			GDateTime* _tmp30_ = NULL;
			GDateTime* _tmp31_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_GRID) ? ((GtkGrid*) _tmp14_) : NULL);
			box = _tmp15_;
			_tmp16_ = box;
			_tmp17_ = gtk_grid_get_child_at (_tmp16_, 0, 0);
			_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, GTK_TYPE_SPIN_BUTTON) ? ((GtkSpinButton*) _tmp17_) : NULL);
			day_spin = _tmp18_;
			_tmp19_ = box;
			_tmp20_ = gtk_grid_get_child_at (_tmp19_, 1, 0);
			_tmp21_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp20_, GTK_TYPE_COMBO_BOX_TEXT) ? ((GtkComboBoxText*) _tmp20_) : NULL);
			combo = _tmp21_;
			_tmp22_ = box;
			_tmp23_ = g_object_get_data ((GObject*) _tmp22_, "year");
			_tmp24_ = combo;
			_tmp25_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp24_);
			_tmp26_ = day_spin;
			_tmp27_ = gtk_spin_button_get_value (_tmp26_);
			_tmp28_ = g_date_time_new_local ((gint) ((gint) ((gintptr) _tmp23_)), _tmp25_ + 1, (gint) _tmp27_, 0, 0, (gdouble) 0);
			bday = _tmp28_;
			_tmp29_ = bday;
			_tmp30_ = g_date_time_to_utc (_tmp29_);
			_g_date_time_unref0 (bday);
			bday = _tmp30_;
			_tmp31_ = bday;
			g_value_set_boxed (&new_value, _tmp31_);
			_g_date_time_unref0 (bday);
			_g_object_unref0 (combo);
			_g_object_unref0 (day_spin);
			_g_object_unref0 (box);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	*result = new_value;
	return;
}


static void contacts_contact_editor_get_value_from_notes (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp38_ = NULL;
	GType _tmp39_ = 0UL;
	GValue _tmp40_ = {0};
	GeeHashSet* _tmp41_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			GtkTextView* text = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			GtkWidget* _tmp15_ = NULL;
			GtkTextView* _tmp16_ = NULL;
			GtkTextIter start = {0};
			GtkTextIter end = {0};
			GtkTextView* _tmp17_ = NULL;
			GtkTextBuffer* _tmp18_ = NULL;
			GtkTextIter _tmp19_ = {0};
			GtkTextView* _tmp20_ = NULL;
			GtkTextBuffer* _tmp21_ = NULL;
			GtkTextIter _tmp22_ = {0};
			gchar* value = NULL;
			GtkTextView* _tmp23_ = NULL;
			GtkTextBuffer* _tmp24_ = NULL;
			GtkTextIter _tmp25_ = {0};
			GtkTextIter _tmp26_ = {0};
			gchar* _tmp27_ = NULL;
			FolksNoteFieldDetails* details = NULL;
			const gchar* _tmp28_ = NULL;
			GeeMapEntry* _tmp29_ = NULL;
			gconstpointer _tmp30_ = NULL;
			ContactsContactEditorRowData* _tmp31_ = NULL;
			FolksAbstractFieldDetails* _tmp32_ = NULL;
			GeeMultiMap* _tmp33_ = NULL;
			GeeMultiMap* _tmp34_ = NULL;
			FolksNoteFieldDetails* _tmp35_ = NULL;
			GeeHashSet* _tmp36_ = NULL;
			FolksNoteFieldDetails* _tmp37_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp13_));
			_tmp15_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, GTK_TYPE_BIN) ? ((GtkBin*) _tmp14_) : NULL);
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, GTK_TYPE_TEXT_VIEW) ? ((GtkTextView*) _tmp15_) : NULL);
			text = _tmp16_;
			_tmp17_ = text;
			_tmp18_ = gtk_text_view_get_buffer (_tmp17_);
			gtk_text_buffer_get_start_iter (_tmp18_, &_tmp19_);
			start = _tmp19_;
			_tmp20_ = text;
			_tmp21_ = gtk_text_view_get_buffer (_tmp20_);
			gtk_text_buffer_get_end_iter (_tmp21_, &_tmp22_);
			end = _tmp22_;
			_tmp23_ = text;
			_tmp24_ = gtk_text_view_get_buffer (_tmp23_);
			_tmp25_ = start;
			_tmp26_ = end;
			_tmp27_ = gtk_text_buffer_get_text (_tmp24_, &_tmp25_, &_tmp26_, TRUE);
			value = _tmp27_;
			_tmp28_ = value;
			_tmp29_ = row_entry;
			_tmp30_ = gee_map_entry_get_value (_tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = (*((ContactsContactEditorRowData*) _tmp31_)).details;
			_tmp33_ = folks_abstract_field_details_get_parameters (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = folks_note_field_details_new (_tmp28_, _tmp34_, NULL);
			details = _tmp35_;
			_tmp36_ = new_details;
			_tmp37_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp36_, _tmp37_);
			_g_object_unref0 (details);
			_g_free0 (value);
			_g_object_unref0 (text);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp38_ = new_details;
	_tmp39_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp38_);
	g_value_init (&_tmp40_, _tmp39_);
	new_value = _tmp40_;
	_tmp41_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp41_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_get_value_from_addresses (ContactsContactEditor* self, GeeHashMap* rows, GValue* result) {
	GeeHashSet* new_details = NULL;
	GeeHashSet* _tmp0_ = NULL;
	GValue new_value = {0};
	GeeHashSet* _tmp102_ = NULL;
	GType _tmp103_ = 0UL;
	GValue _tmp104_ = {0};
	GeeHashSet* _tmp105_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (rows != NULL);
	_tmp0_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_row_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			ContactsTypeCombo* combo = NULL;
			GeeMapEntry* _tmp11_ = NULL;
			gconstpointer _tmp12_ = NULL;
			gint _tmp13_ = 0;
			GtkWidget* _tmp14_ = NULL;
			ContactsTypeCombo* _tmp15_ = NULL;
			ContactsAddressEditor* addr_editor = NULL;
			GeeMapEntry* _tmp16_ = NULL;
			gconstpointer _tmp17_ = NULL;
			gint _tmp18_ = 0;
			GtkWidget* _tmp19_ = NULL;
			ContactsAddressEditor* _tmp20_ = NULL;
			ContactsTypeCombo* _tmp21_ = NULL;
			GeeMapEntry* _tmp22_ = NULL;
			gconstpointer _tmp23_ = NULL;
			ContactsContactEditorRowData* _tmp24_ = NULL;
			FolksAbstractFieldDetails* _tmp25_ = NULL;
			FolksPostalAddress* new_value = NULL;
			ContactsAddressEditor* _tmp26_ = NULL;
			FolksPostalAddressFieldDetails* _tmp27_ = NULL;
			gconstpointer _tmp28_ = NULL;
			FolksPostalAddress* _tmp29_ = NULL;
			const gchar* _tmp30_ = NULL;
			const gchar* _tmp31_ = NULL;
			ContactsAddressEditor* _tmp32_ = NULL;
			FolksPostalAddressFieldDetails* _tmp33_ = NULL;
			gconstpointer _tmp34_ = NULL;
			FolksPostalAddress* _tmp35_ = NULL;
			const gchar* _tmp36_ = NULL;
			const gchar* _tmp37_ = NULL;
			ContactsAddressEditor* _tmp38_ = NULL;
			FolksPostalAddressFieldDetails* _tmp39_ = NULL;
			gconstpointer _tmp40_ = NULL;
			FolksPostalAddress* _tmp41_ = NULL;
			const gchar* _tmp42_ = NULL;
			const gchar* _tmp43_ = NULL;
			ContactsAddressEditor* _tmp44_ = NULL;
			FolksPostalAddressFieldDetails* _tmp45_ = NULL;
			gconstpointer _tmp46_ = NULL;
			FolksPostalAddress* _tmp47_ = NULL;
			const gchar* _tmp48_ = NULL;
			const gchar* _tmp49_ = NULL;
			ContactsAddressEditor* _tmp50_ = NULL;
			FolksPostalAddressFieldDetails* _tmp51_ = NULL;
			gconstpointer _tmp52_ = NULL;
			FolksPostalAddress* _tmp53_ = NULL;
			const gchar* _tmp54_ = NULL;
			const gchar* _tmp55_ = NULL;
			ContactsAddressEditor* _tmp56_ = NULL;
			FolksPostalAddressFieldDetails* _tmp57_ = NULL;
			gconstpointer _tmp58_ = NULL;
			FolksPostalAddress* _tmp59_ = NULL;
			const gchar* _tmp60_ = NULL;
			const gchar* _tmp61_ = NULL;
			ContactsAddressEditor* _tmp62_ = NULL;
			FolksPostalAddressFieldDetails* _tmp63_ = NULL;
			gconstpointer _tmp64_ = NULL;
			FolksPostalAddress* _tmp65_ = NULL;
			const gchar* _tmp66_ = NULL;
			const gchar* _tmp67_ = NULL;
			ContactsAddressEditor* _tmp68_ = NULL;
			FolksPostalAddressFieldDetails* _tmp69_ = NULL;
			gconstpointer _tmp70_ = NULL;
			FolksPostalAddress* _tmp71_ = NULL;
			const gchar* _tmp72_ = NULL;
			const gchar* _tmp73_ = NULL;
			ContactsAddressEditor* _tmp74_ = NULL;
			FolksPostalAddressFieldDetails* _tmp75_ = NULL;
			const gchar* _tmp76_ = NULL;
			const gchar* _tmp77_ = NULL;
			FolksPostalAddress* _tmp78_ = NULL;
			FolksPostalAddressFieldDetails* details = NULL;
			FolksPostalAddress* _tmp92_ = NULL;
			GeeMapEntry* _tmp93_ = NULL;
			gconstpointer _tmp94_ = NULL;
			ContactsContactEditorRowData* _tmp95_ = NULL;
			FolksAbstractFieldDetails* _tmp96_ = NULL;
			GeeMultiMap* _tmp97_ = NULL;
			GeeMultiMap* _tmp98_ = NULL;
			FolksPostalAddressFieldDetails* _tmp99_ = NULL;
			GeeHashSet* _tmp100_ = NULL;
			FolksPostalAddressFieldDetails* _tmp101_ = NULL;
			_tmp7_ = _row_entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _row_entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			row_entry = (GeeMapEntry*) _tmp10_;
			_tmp11_ = row_entry;
			_tmp12_ = gee_map_entry_get_key (_tmp11_);
			_tmp13_ = _tmp12_;
			_tmp14_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, (gint) ((gintptr) _tmp13_));
			_tmp15_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp14_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp14_) : NULL);
			combo = _tmp15_;
			_tmp16_ = row_entry;
			_tmp17_ = gee_map_entry_get_key (_tmp16_);
			_tmp18_ = _tmp17_;
			_tmp19_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, (gint) ((gintptr) _tmp18_));
			_tmp20_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp19_, CONTACTS_TYPE_ADDRESS_EDITOR) ? ((ContactsAddressEditor*) _tmp19_) : NULL);
			addr_editor = _tmp20_;
			_tmp21_ = combo;
			_tmp22_ = row_entry;
			_tmp23_ = gee_map_entry_get_value (_tmp22_);
			_tmp24_ = _tmp23_;
			_tmp25_ = (*((ContactsContactEditorRowData*) _tmp24_)).details;
			contacts_typecombo_update_details (_tmp21_, _tmp25_);
			_tmp26_ = addr_editor;
			_tmp27_ = _tmp26_->details;
			_tmp28_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp27_);
			_tmp29_ = _tmp28_;
			_tmp30_ = folks_postal_address_get_po_box ((FolksPostalAddress*) _tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = addr_editor;
			_tmp33_ = _tmp32_->details;
			_tmp34_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp33_);
			_tmp35_ = _tmp34_;
			_tmp36_ = folks_postal_address_get_extension ((FolksPostalAddress*) _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = addr_editor;
			_tmp39_ = _tmp38_->details;
			_tmp40_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp39_);
			_tmp41_ = _tmp40_;
			_tmp42_ = folks_postal_address_get_street ((FolksPostalAddress*) _tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = addr_editor;
			_tmp45_ = _tmp44_->details;
			_tmp46_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp45_);
			_tmp47_ = _tmp46_;
			_tmp48_ = folks_postal_address_get_locality ((FolksPostalAddress*) _tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = addr_editor;
			_tmp51_ = _tmp50_->details;
			_tmp52_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp51_);
			_tmp53_ = _tmp52_;
			_tmp54_ = folks_postal_address_get_region ((FolksPostalAddress*) _tmp53_);
			_tmp55_ = _tmp54_;
			_tmp56_ = addr_editor;
			_tmp57_ = _tmp56_->details;
			_tmp58_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp57_);
			_tmp59_ = _tmp58_;
			_tmp60_ = folks_postal_address_get_postal_code ((FolksPostalAddress*) _tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = addr_editor;
			_tmp63_ = _tmp62_->details;
			_tmp64_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp63_);
			_tmp65_ = _tmp64_;
			_tmp66_ = folks_postal_address_get_country ((FolksPostalAddress*) _tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = addr_editor;
			_tmp69_ = _tmp68_->details;
			_tmp70_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp69_);
			_tmp71_ = _tmp70_;
			_tmp72_ = folks_postal_address_get_address_format ((FolksPostalAddress*) _tmp71_);
			_tmp73_ = _tmp72_;
			_tmp74_ = addr_editor;
			_tmp75_ = _tmp74_->details;
			_tmp76_ = folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) _tmp75_);
			_tmp77_ = _tmp76_;
			_tmp78_ = folks_postal_address_new (_tmp31_, _tmp37_, _tmp43_, _tmp49_, _tmp55_, _tmp61_, _tmp67_, _tmp73_, _tmp77_);
			new_value = _tmp78_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp79_ = FALSE;
					_tmp79_ = TRUE;
					while (TRUE) {
						gboolean _tmp80_ = FALSE;
						gint _tmp82_ = 0;
						ContactsAddressEditor* _tmp83_ = NULL;
						FolksPostalAddress* _tmp84_ = NULL;
						gchar** _tmp85_ = NULL;
						gint _tmp85__length1 = 0;
						gint _tmp86_ = 0;
						const gchar* _tmp87_ = NULL;
						ContactsAddressEditor* _tmp88_ = NULL;
						gint _tmp89_ = 0;
						GtkEntry* _tmp90_ = NULL;
						const gchar* _tmp91_ = NULL;
						_tmp80_ = _tmp79_;
						if (!_tmp80_) {
							gint _tmp81_ = 0;
							_tmp81_ = i;
							i = _tmp81_ + 1;
						}
						_tmp79_ = FALSE;
						_tmp82_ = i;
						_tmp83_ = addr_editor;
						if (!(_tmp82_ < 7)) {
							break;
						}
						_tmp84_ = new_value;
						_tmp85_ = contacts_contact_postal_element_props;
						_tmp85__length1 = contacts_contact_postal_element_props_length1;
						_tmp86_ = i;
						_tmp87_ = _tmp85_[_tmp86_];
						_tmp88_ = addr_editor;
						_tmp89_ = i;
						_tmp90_ = _tmp88_->entries[_tmp89_];
						_tmp91_ = gtk_entry_get_text (_tmp90_);
						g_object_set ((GObject*) _tmp84_, _tmp87_, _tmp91_, NULL);
					}
				}
			}
			_tmp92_ = new_value;
			_tmp93_ = row_entry;
			_tmp94_ = gee_map_entry_get_value (_tmp93_);
			_tmp95_ = _tmp94_;
			_tmp96_ = (*((ContactsContactEditorRowData*) _tmp95_)).details;
			_tmp97_ = folks_abstract_field_details_get_parameters (_tmp96_);
			_tmp98_ = _tmp97_;
			_tmp99_ = folks_postal_address_field_details_new (_tmp92_, _tmp98_);
			details = _tmp99_;
			_tmp100_ = new_details;
			_tmp101_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp100_, _tmp101_);
			_g_object_unref0 (details);
			_g_object_unref0 (new_value);
			_g_object_unref0 (addr_editor);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp102_ = new_details;
	_tmp103_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp102_);
	g_value_init (&_tmp104_, _tmp103_);
	new_value = _tmp104_;
	_tmp105_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp105_);
	*result = new_value;
	_g_object_unref0 (new_details);
	return;
}


static void contacts_contact_editor_set_field_changed (ContactsContactEditor* self, gint row) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _fields_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _fields_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			fields = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _entry_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeSet* _tmp11_ = NULL;
				GeeSet* _tmp12_ = NULL;
				GeeSet* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_entry_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					GeeMapEntry* entry = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					GeeMapEntry* _tmp20_ = NULL;
					gconstpointer _tmp21_ = NULL;
					ContactsContactEditorField* _tmp22_ = NULL;
					GeeHashMap* _tmp23_ = NULL;
					GeeSet* _tmp24_ = NULL;
					GeeSet* _tmp25_ = NULL;
					GeeSet* _tmp26_ = NULL;
					gint _tmp27_ = 0;
					gboolean _tmp28_ = FALSE;
					gboolean _tmp29_ = FALSE;
					_tmp16_ = _entry_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _entry_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					entry = (GeeMapEntry*) _tmp19_;
					_tmp20_ = entry;
					_tmp21_ = gee_map_entry_get_value (_tmp20_);
					_tmp22_ = _tmp21_;
					_tmp23_ = (*((ContactsContactEditorField*) _tmp22_)).rows;
					_tmp24_ = gee_abstract_map_get_keys ((GeeMap*) _tmp23_);
					_tmp25_ = _tmp24_;
					_tmp26_ = _tmp25_;
					_tmp27_ = row;
					_tmp28_ = gee_collection_contains ((GeeCollection*) _tmp26_, (gpointer) ((gintptr) _tmp27_));
					_tmp29_ = _tmp28_;
					_g_object_unref0 (_tmp26_);
					if (_tmp29_) {
						GeeMapEntry* _tmp30_ = NULL;
						gconstpointer _tmp31_ = NULL;
						ContactsContactEditorField* _tmp32_ = NULL;
						gboolean _tmp33_ = FALSE;
						GeeMapEntry* _tmp34_ = NULL;
						gconstpointer _tmp35_ = NULL;
						ContactsContactEditorField* _tmp36_ = NULL;
						_tmp30_ = entry;
						_tmp31_ = gee_map_entry_get_value (_tmp30_);
						_tmp32_ = _tmp31_;
						_tmp33_ = (*((ContactsContactEditorField*) _tmp32_)).changed;
						if (_tmp33_) {
							_g_object_unref0 (entry);
							_g_object_unref0 (_entry_it);
							_g_object_unref0 (fields);
							_g_object_unref0 (_fields_it);
							return;
						}
						_tmp34_ = entry;
						_tmp35_ = gee_map_entry_get_value (_tmp34_);
						_tmp36_ = _tmp35_;
						(*((ContactsContactEditorField*) _tmp36_)).changed = TRUE;
						_g_object_unref0 (entry);
						_g_object_unref0 (_entry_it);
						_g_object_unref0 (fields);
						_g_object_unref0 (_fields_it);
						return;
					}
					_g_object_unref0 (entry);
				}
				_g_object_unref0 (_entry_it);
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
}


static void contacts_contact_editor_remove_row (ContactsContactEditor* self, gint row) {
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _fields_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _fields_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			fields = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeSet* _tmp11_ = NULL;
				GeeSet* _tmp12_ = NULL;
				GeeSet* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_field_entry_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					_tmp16_ = _field_entry_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _field_entry_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					field_entry = (GeeMapEntry*) _tmp19_;
					{
						GeeIterator* _idx_it = NULL;
						GeeMapEntry* _tmp20_ = NULL;
						gconstpointer _tmp21_ = NULL;
						ContactsContactEditorField* _tmp22_ = NULL;
						GeeHashMap* _tmp23_ = NULL;
						GeeSet* _tmp24_ = NULL;
						GeeSet* _tmp25_ = NULL;
						GeeSet* _tmp26_ = NULL;
						GeeIterator* _tmp27_ = NULL;
						GeeIterator* _tmp28_ = NULL;
						_tmp20_ = field_entry;
						_tmp21_ = gee_map_entry_get_value (_tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = (*((ContactsContactEditorField*) _tmp22_)).rows;
						_tmp24_ = gee_abstract_map_get_keys ((GeeMap*) _tmp23_);
						_tmp25_ = _tmp24_;
						_tmp26_ = _tmp25_;
						_tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_);
						_tmp28_ = _tmp27_;
						_g_object_unref0 (_tmp26_);
						_idx_it = _tmp28_;
						while (TRUE) {
							GeeIterator* _tmp29_ = NULL;
							gboolean _tmp30_ = FALSE;
							gint idx = 0;
							GeeIterator* _tmp31_ = NULL;
							gpointer _tmp32_ = NULL;
							gint _tmp33_ = 0;
							gint _tmp34_ = 0;
							_tmp29_ = _idx_it;
							_tmp30_ = gee_iterator_next (_tmp29_);
							if (!_tmp30_) {
								break;
							}
							_tmp31_ = _idx_it;
							_tmp32_ = gee_iterator_get (_tmp31_);
							idx = (gint) ((gintptr) _tmp32_);
							_tmp33_ = idx;
							_tmp34_ = row;
							if (_tmp33_ == _tmp34_) {
								GtkWidget* child = NULL;
								gint _tmp35_ = 0;
								GtkWidget* _tmp36_ = NULL;
								GtkWidget* _tmp37_ = NULL;
								GtkWidget* _tmp38_ = NULL;
								gint _tmp39_ = 0;
								GtkWidget* _tmp40_ = NULL;
								GtkWidget* _tmp41_ = NULL;
								GtkWidget* _tmp42_ = NULL;
								gint _tmp43_ = 0;
								GtkWidget* _tmp44_ = NULL;
								GtkWidget* _tmp45_ = NULL;
								GtkWidget* _tmp46_ = NULL;
								GeeMapEntry* _tmp47_ = NULL;
								gconstpointer _tmp48_ = NULL;
								ContactsContactEditorField* _tmp49_ = NULL;
								GeeMapEntry* _tmp50_ = NULL;
								gconstpointer _tmp51_ = NULL;
								ContactsContactEditorField* _tmp52_ = NULL;
								GeeHashMap* _tmp53_ = NULL;
								gint _tmp54_ = 0;
								_tmp35_ = row;
								_tmp36_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, _tmp35_);
								_tmp37_ = _g_object_ref0 (_tmp36_);
								child = _tmp37_;
								_tmp38_ = child;
								gtk_widget_destroy (_tmp38_);
								_tmp39_ = row;
								_tmp40_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, _tmp39_);
								_tmp41_ = _g_object_ref0 (_tmp40_);
								_g_object_unref0 (child);
								child = _tmp41_;
								_tmp42_ = child;
								gtk_widget_destroy (_tmp42_);
								_tmp43_ = row;
								_tmp44_ = gtk_grid_get_child_at ((GtkGrid*) self, 3, _tmp43_);
								_tmp45_ = _g_object_ref0 (_tmp44_);
								_g_object_unref0 (child);
								child = _tmp45_;
								_tmp46_ = child;
								gtk_widget_destroy (_tmp46_);
								_tmp47_ = field_entry;
								_tmp48_ = gee_map_entry_get_value (_tmp47_);
								_tmp49_ = _tmp48_;
								(*((ContactsContactEditorField*) _tmp49_)).changed = TRUE;
								_tmp50_ = field_entry;
								_tmp51_ = gee_map_entry_get_value (_tmp50_);
								_tmp52_ = _tmp51_;
								_tmp53_ = (*((ContactsContactEditorField*) _tmp52_)).rows;
								_tmp54_ = row;
								gee_abstract_map_unset ((GeeAbstractMap*) _tmp53_, (gpointer) ((gintptr) _tmp54_), NULL);
								_g_object_unref0 (child);
								_g_object_unref0 (_idx_it);
								_g_object_unref0 (field_entry);
								_g_object_unref0 (_field_entry_it);
								_g_object_unref0 (fields);
								_g_object_unref0 (_fields_it);
								return;
							}
						}
						_g_object_unref0 (_idx_it);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
}


static Block21Data* block21_data_ref (Block21Data* _data21_) {
	g_atomic_int_inc (&_data21_->_ref_count_);
	return _data21_;
}


static void block21_data_unref (void * _userdata_) {
	Block21Data* _data21_;
	_data21_ = (Block21Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data21_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data21_->self;
		_g_object_unref0 (_data21_->value_entry);
		_g_free0 (_data21_->value);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static void __lambda40_ (Block21Data* _data21_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda40__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self) {
	__lambda40_ (self);
}


static void __lambda41_ (Block21Data* _data21_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda41__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda41_ (self);
}


static void __lambda42_ (Block21Data* _data21_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data21_->self;
	_tmp0_ = _data21_->row;
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda42__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda42_ (self);
}


static void __lambda43_ (Block21Data* _data21_) {
	ContactsContactEditor * self;
	const gchar* _tmp0_ = NULL;
	self = _data21_->self;
	_tmp0_ = _data21_->value;
	if (g_strcmp0 (_tmp0_, "") == 0) {
		gtk_widget_grab_focus ((GtkWidget*) _data21_->value_entry);
	}
}


static void ___lambda43__gtk_widget_map (GtkWidget* _sender, gpointer self) {
	__lambda43_ (self);
}


static void contacts_contact_editor_attach_row_with_entry (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksAbstractFieldDetails* details, const gchar* value, const gchar* type) {
	Block21Data* _data21_;
	gint _tmp0_ = 0;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_ = NULL;
	ContactsTypeCombo* combo = NULL;
	ContactsTypeSet* _tmp3_ = NULL;
	ContactsTypeCombo* _tmp4_ = NULL;
	ContactsTypeCombo* _tmp5_ = NULL;
	ContactsTypeCombo* _tmp6_ = NULL;
	FolksAbstractFieldDetails* _tmp7_ = NULL;
	const gchar* _tmp8_ = NULL;
	ContactsTypeCombo* _tmp11_ = NULL;
	gint _tmp12_ = 0;
	GtkEntry* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gint _tmp15_ = 0;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp16_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp17_ = NULL;
	gint _tmp18_ = 0;
	ContactsTypeCombo* _tmp19_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_set != NULL);
	g_return_if_fail (details != NULL);
	g_return_if_fail (value != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = row;
	_data21_->row = _tmp0_;
	_tmp1_ = value;
	_tmp2_ = g_strdup (_tmp1_);
	_g_free0 (_data21_->value);
	_data21_->value = _tmp2_;
	_tmp3_ = type_set;
	_tmp4_ = contacts_typecombo_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	combo = _tmp4_;
	_tmp5_ = combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = combo;
	_tmp7_ = details;
	contacts_typecombo_set_active (_tmp6_, _tmp7_);
	_tmp8_ = type;
	if (_tmp8_ != NULL) {
		ContactsTypeCombo* _tmp9_ = NULL;
		const gchar* _tmp10_ = NULL;
		_tmp9_ = combo;
		_tmp10_ = type;
		contacts_typecombo_set_to (_tmp9_, _tmp10_);
	}
	_tmp11_ = combo;
	_tmp12_ = _data21_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp11_, 0, _tmp12_, 1, 1);
	_tmp13_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp13_);
	_data21_->value_entry = _tmp13_;
	_tmp14_ = _data21_->value;
	gtk_entry_set_text (_data21_->value_entry, _tmp14_);
	gtk_widget_set_hexpand ((GtkWidget*) _data21_->value_entry, TRUE);
	_tmp15_ = _data21_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _data21_->value_entry, 1, _tmp15_, 1, 1);
	_tmp16_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp16_);
	delete_button = _tmp16_;
	_tmp17_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp17_);
	image = _tmp17_;
	gtk_container_add ((GtkContainer*) delete_button, (GtkWidget*) image);
	_tmp18_ = _data21_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) delete_button, 3, _tmp18_, 1, 1);
	_tmp19_ = combo;
	g_signal_connect_data (_tmp19_, "changed", (GCallback) ___lambda40__contacts_typecombo_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	g_signal_connect_data ((GtkEditable*) _data21_->value_entry, "changed", (GCallback) ___lambda41__gtk_editable_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	g_signal_connect_data (delete_button, "clicked", (GCallback) ___lambda42__gtk_button_clicked, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) _data21_->value_entry, "map", (GCallback) ___lambda43__gtk_widget_map, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_g_object_unref0 (image);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (combo);
	block21_data_unref (_data21_);
	_data21_ = NULL;
}


static Block22Data* block22_data_ref (Block22Data* _data22_) {
	g_atomic_int_inc (&_data22_->_ref_count_);
	return _data22_;
}


static void block22_data_unref (void * _userdata_) {
	Block22Data* _data22_;
	_data22_ = (Block22Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data22_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data22_->self;
		_g_object_unref0 (_data22_->value_entry);
		_g_free0 (_data22_->value);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static void __lambda44_ (Block22Data* _data22_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data22_->self;
	_tmp0_ = _data22_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda44__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda44_ (self);
}


static void __lambda45_ (Block22Data* _data22_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data22_->self;
	_tmp0_ = _data22_->row;
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda45__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda45_ (self);
}


static void __lambda46_ (Block22Data* _data22_) {
	ContactsContactEditor * self;
	const gchar* _tmp0_ = NULL;
	self = _data22_->self;
	_tmp0_ = _data22_->value;
	if (g_strcmp0 (_tmp0_, "") == 0) {
		gtk_widget_grab_focus ((GtkWidget*) _data22_->value_entry);
	}
}


static void ___lambda46__gtk_widget_map (GtkWidget* _sender, gpointer self) {
	__lambda46_ (self);
}


static void contacts_contact_editor_attach_row_with_entry_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block22Data* _data22_;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GtkLabel* title_label = NULL;
	const gchar* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_ = NULL;
	GtkTextDirection _tmp8_ = 0;
	GtkLabel* _tmp11_ = NULL;
	gint _tmp12_ = 0;
	GtkEntry* _tmp13_ = NULL;
	const gchar* _tmp14_ = NULL;
	gint _tmp15_ = 0;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp16_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp17_ = NULL;
	gint _tmp18_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (_data22_->value);
	_data22_->value = _tmp1_;
	_tmp2_ = row;
	_data22_->row = _tmp2_;
	_tmp3_ = title;
	_tmp4_ = (GtkLabel*) gtk_label_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	title_label = _tmp4_;
	_tmp5_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	_tmp7_ = title_label;
	_tmp8_ = gtk_widget_get_direction ((GtkWidget*) _tmp7_);
	if (_tmp8_ == GTK_TEXT_DIR_LTR) {
		GtkLabel* _tmp9_ = NULL;
		_tmp9_ = title_label;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp9_, 6);
	} else {
		GtkLabel* _tmp10_ = NULL;
		_tmp10_ = title_label;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp10_, 6);
	}
	_tmp11_ = title_label;
	_tmp12_ = _data22_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp11_, 0, _tmp12_, 1, 1);
	_tmp13_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp13_);
	_data22_->value_entry = _tmp13_;
	_tmp14_ = _data22_->value;
	gtk_entry_set_text (_data22_->value_entry, _tmp14_);
	gtk_widget_set_hexpand ((GtkWidget*) _data22_->value_entry, TRUE);
	_tmp15_ = _data22_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _data22_->value_entry, 1, _tmp15_, 1, 1);
	_tmp16_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp16_);
	delete_button = _tmp16_;
	_tmp17_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp17_);
	image = _tmp17_;
	gtk_container_add ((GtkContainer*) delete_button, (GtkWidget*) image);
	_tmp18_ = _data22_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) delete_button, 3, _tmp18_, 1, 1);
	g_signal_connect_data ((GtkEditable*) _data22_->value_entry, "changed", (GCallback) ___lambda44__gtk_editable_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	g_signal_connect_data (delete_button, "clicked", (GCallback) ___lambda45__gtk_button_clicked, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) _data22_->value_entry, "map", (GCallback) ___lambda46__gtk_widget_map, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_g_object_unref0 (image);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (title_label);
	block22_data_unref (_data22_);
	_data22_ = NULL;
}


static Block23Data* block23_data_ref (Block23Data* _data23_) {
	g_atomic_int_inc (&_data23_->_ref_count_);
	return _data23_;
}


static void block23_data_unref (void * _userdata_) {
	Block23Data* _data23_;
	_data23_ = (Block23Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data23_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data23_->self;
		_g_object_unref0 (_data23_->value_text);
		_g_free0 (_data23_->value);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static void __lambda47_ (Block23Data* _data23_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data23_->self;
	_tmp0_ = _data23_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda47__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self) {
	__lambda47_ (self);
}


static void __lambda48_ (Block23Data* _data23_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data23_->self;
	_tmp0_ = _data23_->row;
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda48__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda48_ (self);
}


static void __lambda49_ (Block23Data* _data23_) {
	ContactsContactEditor * self;
	const gchar* _tmp0_ = NULL;
	self = _data23_->self;
	_tmp0_ = _data23_->value;
	if (g_strcmp0 (_tmp0_, "") == 0) {
		gtk_widget_grab_focus ((GtkWidget*) _data23_->value_text);
	}
}


static void ___lambda49__gtk_widget_map (GtkWidget* _sender, gpointer self) {
	__lambda49_ (self);
}


static void contacts_contact_editor_attach_row_with_text_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block23Data* _data23_;
	const gchar* _tmp0_ = NULL;
	gchar* _tmp1_ = NULL;
	gint _tmp2_ = 0;
	GtkLabel* title_label = NULL;
	const gchar* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkLabel* _tmp6_ = NULL;
	GtkLabel* _tmp7_ = NULL;
	GtkLabel* _tmp8_ = NULL;
	GtkLabel* _tmp9_ = NULL;
	GtkTextDirection _tmp10_ = 0;
	GtkLabel* _tmp13_ = NULL;
	gint _tmp14_ = 0;
	GtkScrolledWindow* sw = NULL;
	GtkScrolledWindow* _tmp15_ = NULL;
	GtkTextView* _tmp16_ = NULL;
	GtkTextBuffer* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	GtkStyleContext* _tmp19_ = NULL;
	gint _tmp20_ = 0;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp21_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp22_ = NULL;
	gint _tmp23_ = 0;
	GtkTextBuffer* _tmp24_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = value;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 (_data23_->value);
	_data23_->value = _tmp1_;
	_tmp2_ = row;
	_data23_->row = _tmp2_;
	_tmp3_ = title;
	_tmp4_ = (GtkLabel*) gtk_label_new (_tmp3_);
	g_object_ref_sink (_tmp4_);
	title_label = _tmp4_;
	_tmp5_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	_tmp7_ = title_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp7_, GTK_ALIGN_START);
	_tmp8_ = title_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp8_, 3);
	_tmp9_ = title_label;
	_tmp10_ = gtk_widget_get_direction ((GtkWidget*) _tmp9_);
	if (_tmp10_ == GTK_TEXT_DIR_LTR) {
		GtkLabel* _tmp11_ = NULL;
		_tmp11_ = title_label;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp11_, 6);
	} else {
		GtkLabel* _tmp12_ = NULL;
		_tmp12_ = title_label;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp12_, 6);
	}
	_tmp13_ = title_label;
	_tmp14_ = _data23_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp13_, 0, _tmp14_, 1, 1);
	_tmp15_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp15_);
	sw = _tmp15_;
	gtk_scrolled_window_set_shadow_type (sw, GTK_SHADOW_OUT);
	gtk_widget_set_size_request ((GtkWidget*) sw, -1, 100);
	_tmp16_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp16_);
	_data23_->value_text = _tmp16_;
	_tmp17_ = gtk_text_view_get_buffer (_data23_->value_text);
	_tmp18_ = _data23_->value;
	gtk_text_buffer_set_text (_tmp17_, _tmp18_, -1);
	gtk_widget_set_hexpand ((GtkWidget*) _data23_->value_text, TRUE);
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _data23_->value_text);
	gtk_style_context_add_class (_tmp19_, "contacts-entry");
	gtk_container_add ((GtkContainer*) sw, (GtkWidget*) _data23_->value_text);
	_tmp20_ = _data23_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) sw, 1, _tmp20_, 1, 1);
	_tmp21_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp21_);
	delete_button = _tmp21_;
	_tmp22_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp22_);
	image = _tmp22_;
	gtk_container_add ((GtkContainer*) delete_button, (GtkWidget*) image);
	gtk_widget_set_valign ((GtkWidget*) delete_button, GTK_ALIGN_START);
	_tmp23_ = _data23_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) delete_button, 3, _tmp23_, 1, 1);
	_tmp24_ = gtk_text_view_get_buffer (_data23_->value_text);
	g_signal_connect_data (_tmp24_, "changed", (GCallback) ___lambda47__gtk_text_buffer_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	g_signal_connect_data (delete_button, "clicked", (GCallback) ___lambda48__gtk_button_clicked, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) _data23_->value_text, "map", (GCallback) ___lambda49__gtk_widget_map, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	_g_object_unref0 (image);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (sw);
	_g_object_unref0 (title_label);
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static Block24Data* block24_data_ref (Block24Data* _data24_) {
	g_atomic_int_inc (&_data24_->_ref_count_);
	return _data24_;
}


static void block24_data_unref (void * _userdata_) {
	Block24Data* _data24_;
	_data24_ = (Block24Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data24_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data24_->self;
		_g_object_unref0 (self);
		g_slice_free (Block24Data, _data24_);
	}
}


static void __lambda50_ (Block24Data* _data24_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = _data24_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda50__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda50_ (self);
}


static void __lambda51_ (Block24Data* _data24_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = _data24_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda51__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	__lambda51_ (self);
}


static void __lambda52_ (Block24Data* _data24_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data24_->self;
	_tmp0_ = _data24_->row;
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda52__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda52_ (self);
}


static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row) {
	Block24Data* _data24_;
	gint _tmp0_ = 0;
	GtkLabel* title_label = NULL;
	const gchar* _tmp1_ = NULL;
	GtkLabel* _tmp2_ = NULL;
	GtkLabel* _tmp3_ = NULL;
	GtkLabel* _tmp4_ = NULL;
	GtkLabel* _tmp5_ = NULL;
	GtkTextDirection _tmp6_ = 0;
	GtkLabel* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	GtkGrid* box = NULL;
	GtkGrid* _tmp11_ = NULL;
	GtkSpinButton* day_spin = NULL;
	GtkSpinButton* _tmp12_ = NULL;
	GDateTime* _tmp13_ = NULL;
	GDateTime* _tmp14_ = NULL;
	GDateTime* _tmp15_ = NULL;
	gint _tmp16_ = 0;
	GtkComboBoxText* combo = NULL;
	GtkComboBoxText* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	const gchar* _tmp19_ = NULL;
	const gchar* _tmp20_ = NULL;
	const gchar* _tmp21_ = NULL;
	const gchar* _tmp22_ = NULL;
	const gchar* _tmp23_ = NULL;
	const gchar* _tmp24_ = NULL;
	const gchar* _tmp25_ = NULL;
	const gchar* _tmp26_ = NULL;
	const gchar* _tmp27_ = NULL;
	const gchar* _tmp28_ = NULL;
	const gchar* _tmp29_ = NULL;
	GDateTime* _tmp30_ = NULL;
	GDateTime* _tmp31_ = NULL;
	GDateTime* _tmp32_ = NULL;
	gint _tmp33_ = 0;
	GtkStyleContext* _tmp34_ = NULL;
	GDateTime* _tmp35_ = NULL;
	GDateTime* _tmp36_ = NULL;
	GDateTime* _tmp37_ = NULL;
	gint _tmp38_ = 0;
	gint _tmp39_ = 0;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp40_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp41_ = NULL;
	gint _tmp42_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (birthday != NULL);
	_data24_ = g_slice_new0 (Block24Data);
	_data24_->_ref_count_ = 1;
	_data24_->self = g_object_ref (self);
	_tmp0_ = row;
	_data24_->row = _tmp0_;
	_tmp1_ = title;
	_tmp2_ = (GtkLabel*) gtk_label_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	title_label = _tmp2_;
	_tmp3_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, FALSE);
	_tmp4_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = title_label;
	_tmp6_ = gtk_widget_get_direction ((GtkWidget*) _tmp5_);
	if (_tmp6_ == GTK_TEXT_DIR_LTR) {
		GtkLabel* _tmp7_ = NULL;
		_tmp7_ = title_label;
		gtk_widget_set_margin_right ((GtkWidget*) _tmp7_, 6);
	} else {
		GtkLabel* _tmp8_ = NULL;
		_tmp8_ = title_label;
		gtk_widget_set_margin_left ((GtkWidget*) _tmp8_, 6);
	}
	_tmp9_ = title_label;
	_tmp10_ = _data24_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp9_, 0, _tmp10_, 1, 1);
	_tmp11_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp11_);
	box = _tmp11_;
	gtk_grid_set_column_spacing (box, (guint) 12);
	_tmp12_ = (GtkSpinButton*) gtk_spin_button_new_with_range (1.0, 31.0, 1.0);
	g_object_ref_sink (_tmp12_);
	day_spin = _tmp12_;
	gtk_spin_button_set_digits (day_spin, (guint) 0);
	gtk_spin_button_set_numeric (day_spin, TRUE);
	_tmp13_ = birthday;
	_tmp14_ = g_date_time_to_local (_tmp13_);
	_tmp15_ = _tmp14_;
	_tmp16_ = g_date_time_get_day_of_month (_tmp15_);
	gtk_spin_button_set_value (day_spin, (gdouble) _tmp16_);
	_g_date_time_unref0 (_tmp15_);
	_tmp17_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	g_object_ref_sink (_tmp17_);
	combo = _tmp17_;
	_tmp18_ = _ ("January");
	gtk_combo_box_text_append_text (combo, _tmp18_);
	_tmp19_ = _ ("February");
	gtk_combo_box_text_append_text (combo, _tmp19_);
	_tmp20_ = _ ("March");
	gtk_combo_box_text_append_text (combo, _tmp20_);
	_tmp21_ = _ ("April");
	gtk_combo_box_text_append_text (combo, _tmp21_);
	_tmp22_ = _ ("May");
	gtk_combo_box_text_append_text (combo, _tmp22_);
	_tmp23_ = _ ("June");
	gtk_combo_box_text_append_text (combo, _tmp23_);
	_tmp24_ = _ ("July");
	gtk_combo_box_text_append_text (combo, _tmp24_);
	_tmp25_ = _ ("August");
	gtk_combo_box_text_append_text (combo, _tmp25_);
	_tmp26_ = _ ("September");
	gtk_combo_box_text_append_text (combo, _tmp26_);
	_tmp27_ = _ ("October");
	gtk_combo_box_text_append_text (combo, _tmp27_);
	_tmp28_ = _ ("November");
	gtk_combo_box_text_append_text (combo, _tmp28_);
	_tmp29_ = _ ("December");
	gtk_combo_box_text_append_text (combo, _tmp29_);
	_tmp30_ = birthday;
	_tmp31_ = g_date_time_to_local (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = g_date_time_get_month (_tmp32_);
	gtk_combo_box_set_active ((GtkComboBox*) combo, _tmp33_ - 1);
	_g_date_time_unref0 (_tmp32_);
	_tmp34_ = gtk_widget_get_style_context ((GtkWidget*) combo);
	gtk_style_context_add_class (_tmp34_, "contacts-combo");
	gtk_widget_set_hexpand ((GtkWidget*) combo, TRUE);
	_tmp35_ = birthday;
	_tmp36_ = g_date_time_to_local (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = g_date_time_get_year (_tmp37_);
	g_object_set_data_full ((GObject*) box, "year", (gpointer) ((gintptr) _tmp38_), NULL);
	_g_date_time_unref0 (_tmp37_);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) day_spin);
	gtk_container_add ((GtkContainer*) box, (GtkWidget*) combo);
	_tmp39_ = _data24_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) box, 1, _tmp39_, 1, 1);
	_tmp40_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp40_);
	delete_button = _tmp40_;
	_tmp41_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp41_);
	image = _tmp41_;
	gtk_container_add ((GtkContainer*) delete_button, (GtkWidget*) image);
	_tmp42_ = _data24_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) delete_button, 3, _tmp42_, 1, 1);
	g_signal_connect_data ((GtkEditable*) day_spin, "changed", (GCallback) ___lambda50__gtk_editable_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	g_signal_connect_data ((GtkComboBox*) combo, "changed", (GCallback) ___lambda51__gtk_combo_box_changed, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	g_signal_connect_data (delete_button, "clicked", (GCallback) ___lambda52__gtk_button_clicked, block24_data_ref (_data24_), (GClosureNotify) block24_data_unref, 0);
	_g_object_unref0 (image);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (combo);
	_g_object_unref0 (day_spin);
	_g_object_unref0 (box);
	_g_object_unref0 (title_label);
	block24_data_unref (_data24_);
	_data24_ = NULL;
}


static Block25Data* block25_data_ref (Block25Data* _data25_) {
	g_atomic_int_inc (&_data25_->_ref_count_);
	return _data25_;
}


static void block25_data_unref (void * _userdata_) {
	Block25Data* _data25_;
	_data25_ = (Block25Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data25_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data25_->self;
		_g_object_unref0 (_data25_->value_address);
		_g_object_unref0 (self);
		g_slice_free (Block25Data, _data25_);
	}
}


static void __lambda53_ (Block25Data* _data25_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data25_->self;
	_tmp0_ = _data25_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda53__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self) {
	__lambda53_ (self);
}


static void __lambda54_ (Block25Data* _data25_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data25_->self;
	_tmp0_ = _data25_->row;
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda54__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self) {
	__lambda54_ (self);
}


static void __lambda55_ (Block25Data* _data25_) {
	ContactsContactEditor * self;
	gint _tmp0_ = 0;
	self = _data25_->self;
	_tmp0_ = _data25_->row;
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda55_ (self);
}


static void __lambda56_ (Block25Data* _data25_) {
	ContactsContactEditor * self;
	self = _data25_->self;
	gtk_widget_grab_focus ((GtkWidget*) _data25_->value_address);
}


static void ___lambda56__gtk_widget_map (GtkWidget* _sender, gpointer self) {
	__lambda56_ (self);
}


static void contacts_contact_editor_attach_row_for_address (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksPostalAddressFieldDetails* details, const gchar* type) {
	Block25Data* _data25_;
	gint _tmp0_ = 0;
	ContactsTypeCombo* combo = NULL;
	ContactsTypeSet* _tmp1_ = NULL;
	ContactsTypeCombo* _tmp2_ = NULL;
	ContactsTypeCombo* _tmp3_ = NULL;
	ContactsTypeCombo* _tmp4_ = NULL;
	FolksPostalAddressFieldDetails* _tmp5_ = NULL;
	const gchar* _tmp6_ = NULL;
	ContactsTypeCombo* _tmp9_ = NULL;
	gint _tmp10_ = 0;
	FolksPostalAddressFieldDetails* _tmp11_ = NULL;
	ContactsAddressEditor* _tmp12_ = NULL;
	gint _tmp13_ = 0;
	GtkButton* delete_button = NULL;
	GtkButton* _tmp14_ = NULL;
	GtkImage* image = NULL;
	GtkImage* _tmp15_ = NULL;
	gint _tmp16_ = 0;
	ContactsTypeCombo* _tmp17_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_set != NULL);
	g_return_if_fail (details != NULL);
	_data25_ = g_slice_new0 (Block25Data);
	_data25_->_ref_count_ = 1;
	_data25_->self = g_object_ref (self);
	_tmp0_ = row;
	_data25_->row = _tmp0_;
	_tmp1_ = type_set;
	_tmp2_ = contacts_typecombo_new (_tmp1_);
	g_object_ref_sink (_tmp2_);
	combo = _tmp2_;
	_tmp3_ = combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp3_, FALSE);
	_tmp4_ = combo;
	_tmp5_ = details;
	contacts_typecombo_set_active (_tmp4_, (FolksAbstractFieldDetails*) _tmp5_);
	_tmp6_ = type;
	if (_tmp6_ != NULL) {
		ContactsTypeCombo* _tmp7_ = NULL;
		const gchar* _tmp8_ = NULL;
		_tmp7_ = combo;
		_tmp8_ = type;
		contacts_typecombo_set_to (_tmp7_, _tmp8_);
	}
	_tmp9_ = combo;
	_tmp10_ = _data25_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp9_, 0, _tmp10_, 1, 1);
	_tmp11_ = details;
	_tmp12_ = contacts_address_editor_new (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_data25_->value_address = _tmp12_;
	_tmp13_ = _data25_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _data25_->value_address, 1, _tmp13_, 1, 1);
	_tmp14_ = (GtkButton*) gtk_button_new ();
	g_object_ref_sink (_tmp14_);
	delete_button = _tmp14_;
	_tmp15_ = (GtkImage*) gtk_image_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	image = _tmp15_;
	gtk_container_add ((GtkContainer*) delete_button, (GtkWidget*) image);
	gtk_widget_set_valign ((GtkWidget*) delete_button, GTK_ALIGN_START);
	_tmp16_ = _data25_->row;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) delete_button, 3, _tmp16_, 1, 1);
	_tmp17_ = combo;
	g_signal_connect_data (_tmp17_, "changed", (GCallback) ___lambda53__contacts_typecombo_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data (_data25_->value_address, "changed", (GCallback) ___lambda54__contacts_address_editor_changed, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data (delete_button, "clicked", (GCallback) ___lambda55__gtk_button_clicked, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	g_signal_connect_data ((GtkWidget*) _data25_->value_address, "map", (GCallback) ___lambda56__gtk_widget_map, block25_data_ref (_data25_), (GClosureNotify) block25_data_unref, 0);
	_g_object_unref0 (image);
	_g_object_unref0 (delete_button);
	_g_object_unref0 (combo);
	block25_data_unref (_data25_);
	_data25_ = NULL;
}


static void contacts_contact_editor_add_edit_row (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, gint* row, gboolean add_empty, const gchar* type) {
	const gchar* _tmp0_ = NULL;
	const gchar* _tmp1_ = NULL;
	GQuark _tmp3_ = 0U;
	static GQuark _tmp2_label0 = 0;
	static GQuark _tmp2_label1 = 0;
	static GQuark _tmp2_label2 = 0;
	static GQuark _tmp2_label3 = 0;
	static GQuark _tmp2_label4 = 0;
	static GQuark _tmp2_label5 = 0;
	static GQuark _tmp2_label6 = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (p != NULL);
	g_return_if_fail (prop_name != NULL);
	_tmp0_ = prop_name;
	_tmp1_ = _tmp0_;
	_tmp3_ = (NULL == _tmp1_) ? 0 : g_quark_from_string (_tmp1_);
	if (_tmp3_ == ((0 != _tmp2_label0) ? _tmp2_label0 : (_tmp2_label0 = g_quark_from_static_string ("email-addresses")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp4_ = NULL;
				gboolean _tmp5_ = FALSE;
				GeeHashMap* _tmp47_ = NULL;
				gboolean _tmp48_ = FALSE;
				gboolean _tmp49_ = FALSE;
				_tmp4_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp4_;
				_tmp5_ = add_empty;
				if (_tmp5_) {
					FolksEmailFieldDetails* detail_field = NULL;
					FolksEmailFieldDetails* _tmp6_ = NULL;
					gint _tmp7_ = 0;
					ContactsTypeSet* _tmp8_ = NULL;
					ContactsTypeSet* _tmp9_ = NULL;
					FolksEmailFieldDetails* _tmp10_ = NULL;
					const gchar* _tmp11_ = NULL;
					GeeHashMap* _tmp12_ = NULL;
					gint _tmp13_ = 0;
					FolksEmailFieldDetails* _tmp14_ = NULL;
					ContactsContactEditorRowData _tmp15_ = {0};
					gint _tmp16_ = 0;
					_tmp6_ = folks_email_field_details_new ("", NULL);
					detail_field = _tmp6_;
					_tmp7_ = *row;
					_tmp8_ = contacts_typeset_get_email ();
					_tmp9_ = _tmp8_;
					_tmp10_ = detail_field;
					_tmp11_ = type;
					contacts_contact_editor_attach_row_with_entry (self, _tmp7_, _tmp9_, (FolksAbstractFieldDetails*) _tmp10_, "", _tmp11_);
					_tmp12_ = rows;
					_tmp13_ = *row;
					_tmp14_ = detail_field;
					_g_object_unref0 (_tmp15_.details);
					_tmp15_.details = (FolksAbstractFieldDetails*) _tmp14_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp12_, (gpointer) ((gintptr) _tmp13_), &_tmp15_);
					_tmp16_ = *row;
					*row = _tmp16_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksEmailDetails* details = NULL;
					FolksPersona* _tmp17_ = NULL;
					FolksEmailDetails* _tmp18_ = NULL;
					FolksEmailDetails* _tmp19_ = NULL;
					_tmp17_ = p;
					_tmp18_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp17_, FOLKS_TYPE_EMAIL_DETAILS) ? ((FolksEmailDetails*) _tmp17_) : NULL);
					details = _tmp18_;
					_tmp19_ = details;
					if (_tmp19_ != NULL) {
						GeeArrayList* emails = NULL;
						FolksEmailDetails* _tmp20_ = NULL;
						GeeSet* _tmp21_ = NULL;
						GeeSet* _tmp22_ = NULL;
						GeeArrayList* _tmp23_ = NULL;
						_tmp20_ = details;
						_tmp21_ = folks_email_details_get_email_addresses (_tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = contacts_contact_sort_fields (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp22_);
						emails = _tmp23_;
						{
							GeeArrayList* _email_list = NULL;
							GeeArrayList* _tmp24_ = NULL;
							GeeArrayList* _tmp25_ = NULL;
							gint _email_size = 0;
							GeeArrayList* _tmp26_ = NULL;
							gint _tmp27_ = 0;
							gint _tmp28_ = 0;
							gint _email_index = 0;
							_tmp24_ = emails;
							_tmp25_ = _g_object_ref0 (_tmp24_);
							_email_list = _tmp25_;
							_tmp26_ = _email_list;
							_tmp27_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp26_);
							_tmp28_ = _tmp27_;
							_email_size = _tmp28_;
							_email_index = -1;
							while (TRUE) {
								gint _tmp29_ = 0;
								gint _tmp30_ = 0;
								gint _tmp31_ = 0;
								FolksEmailFieldDetails* email = NULL;
								GeeArrayList* _tmp32_ = NULL;
								gint _tmp33_ = 0;
								gpointer _tmp34_ = NULL;
								gint _tmp35_ = 0;
								ContactsTypeSet* _tmp36_ = NULL;
								ContactsTypeSet* _tmp37_ = NULL;
								FolksEmailFieldDetails* _tmp38_ = NULL;
								FolksEmailFieldDetails* _tmp39_ = NULL;
								gconstpointer _tmp40_ = NULL;
								const gchar* _tmp41_ = NULL;
								GeeHashMap* _tmp42_ = NULL;
								gint _tmp43_ = 0;
								FolksEmailFieldDetails* _tmp44_ = NULL;
								ContactsContactEditorRowData _tmp45_ = {0};
								gint _tmp46_ = 0;
								_tmp29_ = _email_index;
								_email_index = _tmp29_ + 1;
								_tmp30_ = _email_index;
								_tmp31_ = _email_size;
								if (!(_tmp30_ < _tmp31_)) {
									break;
								}
								_tmp32_ = _email_list;
								_tmp33_ = _email_index;
								_tmp34_ = gee_abstract_list_get ((GeeAbstractList*) _tmp32_, _tmp33_);
								email = (FolksEmailFieldDetails*) _tmp34_;
								_tmp35_ = *row;
								_tmp36_ = contacts_typeset_get_email ();
								_tmp37_ = _tmp36_;
								_tmp38_ = email;
								_tmp39_ = email;
								_tmp40_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp39_);
								_tmp41_ = _tmp40_;
								contacts_contact_editor_attach_row_with_entry (self, _tmp35_, _tmp37_, (FolksAbstractFieldDetails*) _tmp38_, (const gchar*) _tmp41_, NULL);
								_tmp42_ = rows;
								_tmp43_ = *row;
								_tmp44_ = email;
								_g_object_unref0 (_tmp45_.details);
								_tmp45_.details = (FolksAbstractFieldDetails*) _tmp44_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp42_, (gpointer) ((gintptr) _tmp43_), &_tmp45_);
								_tmp46_ = *row;
								*row = _tmp46_ + 1;
								_g_object_unref0 (email);
							}
							_g_object_unref0 (_email_list);
						}
						_g_object_unref0 (emails);
					}
					_g_object_unref0 (details);
				}
				_tmp47_ = rows;
				_tmp48_ = gee_map_get_is_empty ((GeeMap*) _tmp47_);
				_tmp49_ = _tmp48_;
				if (!_tmp49_) {
					GeeHashMap* _tmp50_ = NULL;
					FolksPersona* _tmp51_ = NULL;
					gpointer _tmp52_ = NULL;
					GeeHashMap* _tmp53_ = NULL;
					const gchar* _tmp54_ = NULL;
					gboolean _tmp55_ = FALSE;
					gboolean _tmp56_ = FALSE;
					_tmp50_ = self->priv->writable_personas;
					_tmp51_ = p;
					_tmp52_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp50_, _tmp51_);
					_tmp53_ = (GeeHashMap*) _tmp52_;
					_tmp54_ = prop_name;
					_tmp55_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp53_, _tmp54_);
					_tmp56_ = _tmp55_;
					_g_object_unref0 (_tmp53_);
					if (_tmp56_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp57_ = NULL;
							GeeSet* _tmp58_ = NULL;
							GeeSet* _tmp59_ = NULL;
							GeeSet* _tmp60_ = NULL;
							GeeIterator* _tmp61_ = NULL;
							GeeIterator* _tmp62_ = NULL;
							_tmp57_ = rows;
							_tmp58_ = gee_abstract_map_get_entries ((GeeMap*) _tmp57_);
							_tmp59_ = _tmp58_;
							_tmp60_ = _tmp59_;
							_tmp61_ = gee_iterable_iterator ((GeeIterable*) _tmp60_);
							_tmp62_ = _tmp61_;
							_g_object_unref0 (_tmp60_);
							_entry_it = _tmp62_;
							while (TRUE) {
								GeeIterator* _tmp63_ = NULL;
								gboolean _tmp64_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp65_ = NULL;
								gpointer _tmp66_ = NULL;
								GeeHashMap* _tmp67_ = NULL;
								FolksPersona* _tmp68_ = NULL;
								gpointer _tmp69_ = NULL;
								GeeHashMap* _tmp70_ = NULL;
								const gchar* _tmp71_ = NULL;
								gpointer _tmp72_ = NULL;
								ContactsContactEditorField* _tmp73_ = NULL;
								GeeHashMap* _tmp74_ = NULL;
								GeeMapEntry* _tmp75_ = NULL;
								gconstpointer _tmp76_ = NULL;
								gint _tmp77_ = 0;
								GeeMapEntry* _tmp78_ = NULL;
								gconstpointer _tmp79_ = NULL;
								ContactsContactEditorRowData* _tmp80_ = NULL;
								_tmp63_ = _entry_it;
								_tmp64_ = gee_iterator_next (_tmp63_);
								if (!_tmp64_) {
									break;
								}
								_tmp65_ = _entry_it;
								_tmp66_ = gee_iterator_get (_tmp65_);
								entry = (GeeMapEntry*) _tmp66_;
								_tmp67_ = self->priv->writable_personas;
								_tmp68_ = p;
								_tmp69_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp67_, _tmp68_);
								_tmp70_ = (GeeHashMap*) _tmp69_;
								_tmp71_ = prop_name;
								_tmp72_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp70_, _tmp71_);
								_tmp73_ = (ContactsContactEditorField*) _tmp72_;
								_tmp74_ = (*_tmp73_).rows;
								_tmp75_ = entry;
								_tmp76_ = gee_map_entry_get_key (_tmp75_);
								_tmp77_ = _tmp76_;
								_tmp78_ = entry;
								_tmp79_ = gee_map_entry_get_value (_tmp78_);
								_tmp80_ = _tmp79_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp74_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp77_))), (ContactsContactEditorRowData*) _tmp80_);
								_contacts_contact_editor_field_free0 (_tmp73_);
								_g_object_unref0 (_tmp70_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp81_ = NULL;
						FolksPersona* _tmp82_ = NULL;
						gpointer _tmp83_ = NULL;
						GeeHashMap* _tmp84_ = NULL;
						const gchar* _tmp85_ = NULL;
						GeeHashMap* _tmp86_ = NULL;
						ContactsContactEditorField _tmp87_ = {0};
						_tmp81_ = self->priv->writable_personas;
						_tmp82_ = p;
						_tmp83_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp81_, _tmp82_);
						_tmp84_ = (GeeHashMap*) _tmp83_;
						_tmp85_ = prop_name;
						_tmp86_ = rows;
						_tmp87_.changed = FALSE;
						_g_object_unref0 (_tmp87_.rows);
						_tmp87_.rows = _tmp86_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp84_, _tmp85_, &_tmp87_);
						_g_object_unref0 (_tmp84_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label1) ? _tmp2_label1 : (_tmp2_label1 = g_quark_from_static_string ("phone-numbers")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp88_ = NULL;
				gboolean _tmp89_ = FALSE;
				GeeHashMap* _tmp132_ = NULL;
				gboolean _tmp133_ = FALSE;
				gboolean _tmp134_ = FALSE;
				_tmp88_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp88_;
				_tmp89_ = add_empty;
				if (_tmp89_) {
					FolksPhoneFieldDetails* detail_field = NULL;
					FolksPhoneFieldDetails* _tmp90_ = NULL;
					gint _tmp91_ = 0;
					ContactsTypeSet* _tmp92_ = NULL;
					ContactsTypeSet* _tmp93_ = NULL;
					FolksPhoneFieldDetails* _tmp94_ = NULL;
					const gchar* _tmp95_ = NULL;
					GeeHashMap* _tmp96_ = NULL;
					gint _tmp97_ = 0;
					FolksPhoneFieldDetails* _tmp98_ = NULL;
					ContactsContactEditorRowData _tmp99_ = {0};
					gint _tmp100_ = 0;
					_tmp90_ = folks_phone_field_details_new ("", NULL);
					detail_field = _tmp90_;
					_tmp91_ = *row;
					_tmp92_ = contacts_typeset_get_phone ();
					_tmp93_ = _tmp92_;
					_tmp94_ = detail_field;
					_tmp95_ = type;
					contacts_contact_editor_attach_row_with_entry (self, _tmp91_, _tmp93_, (FolksAbstractFieldDetails*) _tmp94_, "", _tmp95_);
					_tmp96_ = rows;
					_tmp97_ = *row;
					_tmp98_ = detail_field;
					_g_object_unref0 (_tmp99_.details);
					_tmp99_.details = (FolksAbstractFieldDetails*) _tmp98_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp96_, (gpointer) ((gintptr) _tmp97_), &_tmp99_);
					_tmp100_ = *row;
					*row = _tmp100_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksPhoneDetails* details = NULL;
					FolksPersona* _tmp101_ = NULL;
					FolksPhoneDetails* _tmp102_ = NULL;
					FolksPhoneDetails* _tmp103_ = NULL;
					_tmp101_ = p;
					_tmp102_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp101_, FOLKS_TYPE_PHONE_DETAILS) ? ((FolksPhoneDetails*) _tmp101_) : NULL);
					details = _tmp102_;
					_tmp103_ = details;
					if (_tmp103_ != NULL) {
						GeeArrayList* phones = NULL;
						FolksPhoneDetails* _tmp104_ = NULL;
						GeeSet* _tmp105_ = NULL;
						GeeSet* _tmp106_ = NULL;
						GeeArrayList* _tmp107_ = NULL;
						_tmp104_ = details;
						_tmp105_ = folks_phone_details_get_phone_numbers (_tmp104_);
						_tmp106_ = _tmp105_;
						_tmp107_ = contacts_contact_sort_fields (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GeeCollection*) _tmp106_);
						phones = _tmp107_;
						{
							GeeArrayList* _phone_list = NULL;
							GeeArrayList* _tmp108_ = NULL;
							GeeArrayList* _tmp109_ = NULL;
							gint _phone_size = 0;
							GeeArrayList* _tmp110_ = NULL;
							gint _tmp111_ = 0;
							gint _tmp112_ = 0;
							gint _phone_index = 0;
							_tmp108_ = phones;
							_tmp109_ = _g_object_ref0 (_tmp108_);
							_phone_list = _tmp109_;
							_tmp110_ = _phone_list;
							_tmp111_ = gee_abstract_collection_get_size ((GeeCollection*) _tmp110_);
							_tmp112_ = _tmp111_;
							_phone_size = _tmp112_;
							_phone_index = -1;
							while (TRUE) {
								gint _tmp113_ = 0;
								gint _tmp114_ = 0;
								gint _tmp115_ = 0;
								FolksPhoneFieldDetails* phone = NULL;
								GeeArrayList* _tmp116_ = NULL;
								gint _tmp117_ = 0;
								gpointer _tmp118_ = NULL;
								gint _tmp119_ = 0;
								ContactsTypeSet* _tmp120_ = NULL;
								ContactsTypeSet* _tmp121_ = NULL;
								FolksPhoneFieldDetails* _tmp122_ = NULL;
								FolksPhoneFieldDetails* _tmp123_ = NULL;
								gconstpointer _tmp124_ = NULL;
								const gchar* _tmp125_ = NULL;
								const gchar* _tmp126_ = NULL;
								GeeHashMap* _tmp127_ = NULL;
								gint _tmp128_ = 0;
								FolksPhoneFieldDetails* _tmp129_ = NULL;
								ContactsContactEditorRowData _tmp130_ = {0};
								gint _tmp131_ = 0;
								_tmp113_ = _phone_index;
								_phone_index = _tmp113_ + 1;
								_tmp114_ = _phone_index;
								_tmp115_ = _phone_size;
								if (!(_tmp114_ < _tmp115_)) {
									break;
								}
								_tmp116_ = _phone_list;
								_tmp117_ = _phone_index;
								_tmp118_ = gee_abstract_list_get ((GeeAbstractList*) _tmp116_, _tmp117_);
								phone = (FolksPhoneFieldDetails*) _tmp118_;
								_tmp119_ = *row;
								_tmp120_ = contacts_typeset_get_phone ();
								_tmp121_ = _tmp120_;
								_tmp122_ = phone;
								_tmp123_ = phone;
								_tmp124_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp123_);
								_tmp125_ = _tmp124_;
								_tmp126_ = type;
								contacts_contact_editor_attach_row_with_entry (self, _tmp119_, _tmp121_, (FolksAbstractFieldDetails*) _tmp122_, (const gchar*) _tmp125_, _tmp126_);
								_tmp127_ = rows;
								_tmp128_ = *row;
								_tmp129_ = phone;
								_g_object_unref0 (_tmp130_.details);
								_tmp130_.details = (FolksAbstractFieldDetails*) _tmp129_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp127_, (gpointer) ((gintptr) _tmp128_), &_tmp130_);
								_tmp131_ = *row;
								*row = _tmp131_ + 1;
								_g_object_unref0 (phone);
							}
							_g_object_unref0 (_phone_list);
						}
						_g_object_unref0 (phones);
					}
					_g_object_unref0 (details);
				}
				_tmp132_ = rows;
				_tmp133_ = gee_map_get_is_empty ((GeeMap*) _tmp132_);
				_tmp134_ = _tmp133_;
				if (!_tmp134_) {
					GeeHashMap* _tmp135_ = NULL;
					FolksPersona* _tmp136_ = NULL;
					gpointer _tmp137_ = NULL;
					GeeHashMap* _tmp138_ = NULL;
					const gchar* _tmp139_ = NULL;
					gboolean _tmp140_ = FALSE;
					gboolean _tmp141_ = FALSE;
					_tmp135_ = self->priv->writable_personas;
					_tmp136_ = p;
					_tmp137_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp135_, _tmp136_);
					_tmp138_ = (GeeHashMap*) _tmp137_;
					_tmp139_ = prop_name;
					_tmp140_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp138_, _tmp139_);
					_tmp141_ = _tmp140_;
					_g_object_unref0 (_tmp138_);
					if (_tmp141_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp142_ = NULL;
							GeeSet* _tmp143_ = NULL;
							GeeSet* _tmp144_ = NULL;
							GeeSet* _tmp145_ = NULL;
							GeeIterator* _tmp146_ = NULL;
							GeeIterator* _tmp147_ = NULL;
							_tmp142_ = rows;
							_tmp143_ = gee_abstract_map_get_entries ((GeeMap*) _tmp142_);
							_tmp144_ = _tmp143_;
							_tmp145_ = _tmp144_;
							_tmp146_ = gee_iterable_iterator ((GeeIterable*) _tmp145_);
							_tmp147_ = _tmp146_;
							_g_object_unref0 (_tmp145_);
							_entry_it = _tmp147_;
							while (TRUE) {
								GeeIterator* _tmp148_ = NULL;
								gboolean _tmp149_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp150_ = NULL;
								gpointer _tmp151_ = NULL;
								GeeHashMap* _tmp152_ = NULL;
								FolksPersona* _tmp153_ = NULL;
								gpointer _tmp154_ = NULL;
								GeeHashMap* _tmp155_ = NULL;
								const gchar* _tmp156_ = NULL;
								gpointer _tmp157_ = NULL;
								ContactsContactEditorField* _tmp158_ = NULL;
								GeeHashMap* _tmp159_ = NULL;
								GeeMapEntry* _tmp160_ = NULL;
								gconstpointer _tmp161_ = NULL;
								gint _tmp162_ = 0;
								GeeMapEntry* _tmp163_ = NULL;
								gconstpointer _tmp164_ = NULL;
								ContactsContactEditorRowData* _tmp165_ = NULL;
								_tmp148_ = _entry_it;
								_tmp149_ = gee_iterator_next (_tmp148_);
								if (!_tmp149_) {
									break;
								}
								_tmp150_ = _entry_it;
								_tmp151_ = gee_iterator_get (_tmp150_);
								entry = (GeeMapEntry*) _tmp151_;
								_tmp152_ = self->priv->writable_personas;
								_tmp153_ = p;
								_tmp154_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp152_, _tmp153_);
								_tmp155_ = (GeeHashMap*) _tmp154_;
								_tmp156_ = prop_name;
								_tmp157_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp155_, _tmp156_);
								_tmp158_ = (ContactsContactEditorField*) _tmp157_;
								_tmp159_ = (*_tmp158_).rows;
								_tmp160_ = entry;
								_tmp161_ = gee_map_entry_get_key (_tmp160_);
								_tmp162_ = _tmp161_;
								_tmp163_ = entry;
								_tmp164_ = gee_map_entry_get_value (_tmp163_);
								_tmp165_ = _tmp164_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp159_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp162_))), (ContactsContactEditorRowData*) _tmp165_);
								_contacts_contact_editor_field_free0 (_tmp158_);
								_g_object_unref0 (_tmp155_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp166_ = NULL;
						FolksPersona* _tmp167_ = NULL;
						gpointer _tmp168_ = NULL;
						GeeHashMap* _tmp169_ = NULL;
						const gchar* _tmp170_ = NULL;
						GeeHashMap* _tmp171_ = NULL;
						ContactsContactEditorField _tmp172_ = {0};
						_tmp166_ = self->priv->writable_personas;
						_tmp167_ = p;
						_tmp168_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp166_, _tmp167_);
						_tmp169_ = (GeeHashMap*) _tmp168_;
						_tmp170_ = prop_name;
						_tmp171_ = rows;
						_tmp172_.changed = FALSE;
						_g_object_unref0 (_tmp172_.rows);
						_tmp172_.rows = _tmp171_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp169_, _tmp170_, &_tmp172_);
						_g_object_unref0 (_tmp169_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label2) ? _tmp2_label2 : (_tmp2_label2 = g_quark_from_static_string ("urls")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp173_ = NULL;
				gboolean _tmp174_ = FALSE;
				GeeHashMap* _tmp206_ = NULL;
				gboolean _tmp207_ = FALSE;
				gboolean _tmp208_ = FALSE;
				_tmp173_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp173_;
				_tmp174_ = add_empty;
				if (_tmp174_) {
					FolksUrlFieldDetails* detail_field = NULL;
					FolksUrlFieldDetails* _tmp175_ = NULL;
					const gchar* _tmp176_ = NULL;
					FolksUrlFieldDetails* _tmp177_ = NULL;
					gint _tmp178_ = 0;
					GeeHashMap* _tmp179_ = NULL;
					gint _tmp180_ = 0;
					FolksUrlFieldDetails* _tmp181_ = NULL;
					ContactsContactEditorRowData _tmp182_ = {0};
					gint _tmp183_ = 0;
					_tmp175_ = folks_url_field_details_new ("", NULL);
					detail_field = _tmp175_;
					_tmp176_ = _ ("Website");
					_tmp177_ = detail_field;
					_tmp178_ = *row;
					contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp176_, (FolksAbstractFieldDetails*) _tmp177_, "", _tmp178_);
					_tmp179_ = rows;
					_tmp180_ = *row;
					_tmp181_ = detail_field;
					_g_object_unref0 (_tmp182_.details);
					_tmp182_.details = (FolksAbstractFieldDetails*) _tmp181_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp179_, (gpointer) ((gintptr) _tmp180_), &_tmp182_);
					_tmp183_ = *row;
					*row = _tmp183_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksUrlDetails* url_details = NULL;
					FolksPersona* _tmp184_ = NULL;
					FolksUrlDetails* _tmp185_ = NULL;
					FolksUrlDetails* _tmp186_ = NULL;
					_tmp184_ = p;
					_tmp185_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp184_, FOLKS_TYPE_URL_DETAILS) ? ((FolksUrlDetails*) _tmp184_) : NULL);
					url_details = _tmp185_;
					_tmp186_ = url_details;
					if (_tmp186_ != NULL) {
						{
							GeeIterator* _url_it = NULL;
							FolksUrlDetails* _tmp187_ = NULL;
							GeeSet* _tmp188_ = NULL;
							GeeSet* _tmp189_ = NULL;
							GeeIterator* _tmp190_ = NULL;
							_tmp187_ = url_details;
							_tmp188_ = folks_url_details_get_urls (_tmp187_);
							_tmp189_ = _tmp188_;
							_tmp190_ = gee_iterable_iterator ((GeeIterable*) _tmp189_);
							_url_it = _tmp190_;
							while (TRUE) {
								GeeIterator* _tmp191_ = NULL;
								gboolean _tmp192_ = FALSE;
								FolksUrlFieldDetails* url = NULL;
								GeeIterator* _tmp193_ = NULL;
								gpointer _tmp194_ = NULL;
								const gchar* _tmp195_ = NULL;
								FolksUrlFieldDetails* _tmp196_ = NULL;
								FolksUrlFieldDetails* _tmp197_ = NULL;
								gconstpointer _tmp198_ = NULL;
								const gchar* _tmp199_ = NULL;
								gint _tmp200_ = 0;
								GeeHashMap* _tmp201_ = NULL;
								gint _tmp202_ = 0;
								FolksUrlFieldDetails* _tmp203_ = NULL;
								ContactsContactEditorRowData _tmp204_ = {0};
								gint _tmp205_ = 0;
								_tmp191_ = _url_it;
								_tmp192_ = gee_iterator_next (_tmp191_);
								if (!_tmp192_) {
									break;
								}
								_tmp193_ = _url_it;
								_tmp194_ = gee_iterator_get (_tmp193_);
								url = (FolksUrlFieldDetails*) _tmp194_;
								_tmp195_ = _ ("Website");
								_tmp196_ = url;
								_tmp197_ = url;
								_tmp198_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp197_);
								_tmp199_ = _tmp198_;
								_tmp200_ = *row;
								contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp195_, (FolksAbstractFieldDetails*) _tmp196_, (const gchar*) _tmp199_, _tmp200_);
								_tmp201_ = rows;
								_tmp202_ = *row;
								_tmp203_ = url;
								_g_object_unref0 (_tmp204_.details);
								_tmp204_.details = (FolksAbstractFieldDetails*) _tmp203_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp201_, (gpointer) ((gintptr) _tmp202_), &_tmp204_);
								_tmp205_ = *row;
								*row = _tmp205_ + 1;
								_g_object_unref0 (url);
							}
							_g_object_unref0 (_url_it);
						}
					}
					_g_object_unref0 (url_details);
				}
				_tmp206_ = rows;
				_tmp207_ = gee_map_get_is_empty ((GeeMap*) _tmp206_);
				_tmp208_ = _tmp207_;
				if (!_tmp208_) {
					GeeHashMap* _tmp209_ = NULL;
					FolksPersona* _tmp210_ = NULL;
					gpointer _tmp211_ = NULL;
					GeeHashMap* _tmp212_ = NULL;
					const gchar* _tmp213_ = NULL;
					gboolean _tmp214_ = FALSE;
					gboolean _tmp215_ = FALSE;
					_tmp209_ = self->priv->writable_personas;
					_tmp210_ = p;
					_tmp211_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp209_, _tmp210_);
					_tmp212_ = (GeeHashMap*) _tmp211_;
					_tmp213_ = prop_name;
					_tmp214_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp212_, _tmp213_);
					_tmp215_ = _tmp214_;
					_g_object_unref0 (_tmp212_);
					if (_tmp215_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp216_ = NULL;
							GeeSet* _tmp217_ = NULL;
							GeeSet* _tmp218_ = NULL;
							GeeSet* _tmp219_ = NULL;
							GeeIterator* _tmp220_ = NULL;
							GeeIterator* _tmp221_ = NULL;
							_tmp216_ = rows;
							_tmp217_ = gee_abstract_map_get_entries ((GeeMap*) _tmp216_);
							_tmp218_ = _tmp217_;
							_tmp219_ = _tmp218_;
							_tmp220_ = gee_iterable_iterator ((GeeIterable*) _tmp219_);
							_tmp221_ = _tmp220_;
							_g_object_unref0 (_tmp219_);
							_entry_it = _tmp221_;
							while (TRUE) {
								GeeIterator* _tmp222_ = NULL;
								gboolean _tmp223_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp224_ = NULL;
								gpointer _tmp225_ = NULL;
								GeeHashMap* _tmp226_ = NULL;
								FolksPersona* _tmp227_ = NULL;
								gpointer _tmp228_ = NULL;
								GeeHashMap* _tmp229_ = NULL;
								const gchar* _tmp230_ = NULL;
								gpointer _tmp231_ = NULL;
								ContactsContactEditorField* _tmp232_ = NULL;
								GeeHashMap* _tmp233_ = NULL;
								GeeMapEntry* _tmp234_ = NULL;
								gconstpointer _tmp235_ = NULL;
								gint _tmp236_ = 0;
								GeeMapEntry* _tmp237_ = NULL;
								gconstpointer _tmp238_ = NULL;
								ContactsContactEditorRowData* _tmp239_ = NULL;
								_tmp222_ = _entry_it;
								_tmp223_ = gee_iterator_next (_tmp222_);
								if (!_tmp223_) {
									break;
								}
								_tmp224_ = _entry_it;
								_tmp225_ = gee_iterator_get (_tmp224_);
								entry = (GeeMapEntry*) _tmp225_;
								_tmp226_ = self->priv->writable_personas;
								_tmp227_ = p;
								_tmp228_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp226_, _tmp227_);
								_tmp229_ = (GeeHashMap*) _tmp228_;
								_tmp230_ = prop_name;
								_tmp231_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp229_, _tmp230_);
								_tmp232_ = (ContactsContactEditorField*) _tmp231_;
								_tmp233_ = (*_tmp232_).rows;
								_tmp234_ = entry;
								_tmp235_ = gee_map_entry_get_key (_tmp234_);
								_tmp236_ = _tmp235_;
								_tmp237_ = entry;
								_tmp238_ = gee_map_entry_get_value (_tmp237_);
								_tmp239_ = _tmp238_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp233_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp236_))), (ContactsContactEditorRowData*) _tmp239_);
								_contacts_contact_editor_field_free0 (_tmp232_);
								_g_object_unref0 (_tmp229_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp240_ = NULL;
						FolksPersona* _tmp241_ = NULL;
						gpointer _tmp242_ = NULL;
						GeeHashMap* _tmp243_ = NULL;
						const gchar* _tmp244_ = NULL;
						GeeHashMap* _tmp245_ = NULL;
						ContactsContactEditorField _tmp246_ = {0};
						_tmp240_ = self->priv->writable_personas;
						_tmp241_ = p;
						_tmp242_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp240_, _tmp241_);
						_tmp243_ = (GeeHashMap*) _tmp242_;
						_tmp244_ = prop_name;
						_tmp245_ = rows;
						_tmp246_.changed = FALSE;
						_g_object_unref0 (_tmp246_.rows);
						_tmp246_.rows = _tmp245_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp243_, _tmp244_, &_tmp246_);
						_g_object_unref0 (_tmp243_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label3) ? _tmp2_label3 : (_tmp2_label3 = g_quark_from_static_string ("nickname")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp247_ = NULL;
				gboolean _tmp248_ = FALSE;
				GeeHashMap* _tmp271_ = NULL;
				gboolean _tmp272_ = FALSE;
				gboolean _tmp273_ = FALSE;
				_tmp247_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp247_;
				_tmp248_ = add_empty;
				if (_tmp248_) {
					const gchar* _tmp249_ = NULL;
					gint _tmp250_ = 0;
					GeeHashMap* _tmp251_ = NULL;
					gint _tmp252_ = 0;
					ContactsContactEditorRowData _tmp253_ = {0};
					gint _tmp254_ = 0;
					_tmp249_ = _ ("Nickname");
					_tmp250_ = *row;
					contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp249_, NULL, "", _tmp250_);
					_tmp251_ = rows;
					_tmp252_ = *row;
					_g_object_unref0 (_tmp253_.details);
					_tmp253_.details = NULL;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp251_, (gpointer) ((gintptr) _tmp252_), &_tmp253_);
					_tmp254_ = *row;
					*row = _tmp254_ + 1;
				} else {
					FolksNameDetails* name_details = NULL;
					FolksPersona* _tmp255_ = NULL;
					FolksNameDetails* _tmp256_ = NULL;
					FolksNameDetails* _tmp257_ = NULL;
					_tmp255_ = p;
					_tmp256_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp255_, FOLKS_TYPE_NAME_DETAILS) ? ((FolksNameDetails*) _tmp255_) : NULL);
					name_details = _tmp256_;
					_tmp257_ = name_details;
					if (_tmp257_ != NULL) {
						FolksNameDetails* _tmp258_ = NULL;
						const gchar* _tmp259_ = NULL;
						const gchar* _tmp260_ = NULL;
						gboolean _tmp261_ = FALSE;
						_tmp258_ = name_details;
						_tmp259_ = folks_name_details_get_nickname (_tmp258_);
						_tmp260_ = _tmp259_;
						_tmp261_ = contacts_is_set (_tmp260_);
						if (_tmp261_) {
							const gchar* _tmp262_ = NULL;
							FolksNameDetails* _tmp263_ = NULL;
							const gchar* _tmp264_ = NULL;
							const gchar* _tmp265_ = NULL;
							gint _tmp266_ = 0;
							GeeHashMap* _tmp267_ = NULL;
							gint _tmp268_ = 0;
							ContactsContactEditorRowData _tmp269_ = {0};
							gint _tmp270_ = 0;
							_tmp262_ = _ ("Nickname");
							_tmp263_ = name_details;
							_tmp264_ = folks_name_details_get_nickname (_tmp263_);
							_tmp265_ = _tmp264_;
							_tmp266_ = *row;
							contacts_contact_editor_attach_row_with_entry_labeled (self, _tmp262_, NULL, _tmp265_, _tmp266_);
							_tmp267_ = rows;
							_tmp268_ = *row;
							_g_object_unref0 (_tmp269_.details);
							_tmp269_.details = NULL;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp267_, (gpointer) ((gintptr) _tmp268_), &_tmp269_);
							_tmp270_ = *row;
							*row = _tmp270_ + 1;
						}
					}
					_g_object_unref0 (name_details);
				}
				_tmp271_ = rows;
				_tmp272_ = gee_map_get_is_empty ((GeeMap*) _tmp271_);
				_tmp273_ = _tmp272_;
				if (!_tmp273_) {
					GeeHashMap* _tmp274_ = NULL;
					FolksPersona* _tmp275_ = NULL;
					gpointer _tmp276_ = NULL;
					GeeHashMap* _tmp277_ = NULL;
					const gchar* _tmp278_ = NULL;
					gboolean _tmp279_ = FALSE;
					gboolean _tmp280_ = FALSE;
					_tmp274_ = self->priv->writable_personas;
					_tmp275_ = p;
					_tmp276_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp274_, _tmp275_);
					_tmp277_ = (GeeHashMap*) _tmp276_;
					_tmp278_ = prop_name;
					_tmp279_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp277_, _tmp278_);
					_tmp280_ = _tmp279_;
					_g_object_unref0 (_tmp277_);
					if (_tmp280_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp281_ = NULL;
							GeeSet* _tmp282_ = NULL;
							GeeSet* _tmp283_ = NULL;
							GeeSet* _tmp284_ = NULL;
							GeeIterator* _tmp285_ = NULL;
							GeeIterator* _tmp286_ = NULL;
							_tmp281_ = rows;
							_tmp282_ = gee_abstract_map_get_entries ((GeeMap*) _tmp281_);
							_tmp283_ = _tmp282_;
							_tmp284_ = _tmp283_;
							_tmp285_ = gee_iterable_iterator ((GeeIterable*) _tmp284_);
							_tmp286_ = _tmp285_;
							_g_object_unref0 (_tmp284_);
							_entry_it = _tmp286_;
							while (TRUE) {
								GeeIterator* _tmp287_ = NULL;
								gboolean _tmp288_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp289_ = NULL;
								gpointer _tmp290_ = NULL;
								GeeHashMap* _tmp291_ = NULL;
								FolksPersona* _tmp292_ = NULL;
								gpointer _tmp293_ = NULL;
								GeeHashMap* _tmp294_ = NULL;
								const gchar* _tmp295_ = NULL;
								gpointer _tmp296_ = NULL;
								ContactsContactEditorField* _tmp297_ = NULL;
								GeeHashMap* _tmp298_ = NULL;
								GeeMapEntry* _tmp299_ = NULL;
								gconstpointer _tmp300_ = NULL;
								gint _tmp301_ = 0;
								GeeMapEntry* _tmp302_ = NULL;
								gconstpointer _tmp303_ = NULL;
								ContactsContactEditorRowData* _tmp304_ = NULL;
								_tmp287_ = _entry_it;
								_tmp288_ = gee_iterator_next (_tmp287_);
								if (!_tmp288_) {
									break;
								}
								_tmp289_ = _entry_it;
								_tmp290_ = gee_iterator_get (_tmp289_);
								entry = (GeeMapEntry*) _tmp290_;
								_tmp291_ = self->priv->writable_personas;
								_tmp292_ = p;
								_tmp293_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp291_, _tmp292_);
								_tmp294_ = (GeeHashMap*) _tmp293_;
								_tmp295_ = prop_name;
								_tmp296_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp294_, _tmp295_);
								_tmp297_ = (ContactsContactEditorField*) _tmp296_;
								_tmp298_ = (*_tmp297_).rows;
								_tmp299_ = entry;
								_tmp300_ = gee_map_entry_get_key (_tmp299_);
								_tmp301_ = _tmp300_;
								_tmp302_ = entry;
								_tmp303_ = gee_map_entry_get_value (_tmp302_);
								_tmp304_ = _tmp303_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp298_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp301_))), (ContactsContactEditorRowData*) _tmp304_);
								_contacts_contact_editor_field_free0 (_tmp297_);
								_g_object_unref0 (_tmp294_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp305_ = NULL;
						FolksPersona* _tmp306_ = NULL;
						gpointer _tmp307_ = NULL;
						GeeHashMap* _tmp308_ = NULL;
						const gchar* _tmp309_ = NULL;
						GeeHashMap* _tmp310_ = NULL;
						ContactsContactEditorField _tmp311_ = {0};
						_tmp305_ = self->priv->writable_personas;
						_tmp306_ = p;
						_tmp307_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp305_, _tmp306_);
						_tmp308_ = (GeeHashMap*) _tmp307_;
						_tmp309_ = prop_name;
						_tmp310_ = rows;
						_tmp311_.changed = FALSE;
						_g_object_unref0 (_tmp311_.rows);
						_tmp311_.rows = _tmp310_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp308_, _tmp309_, &_tmp311_);
						_g_object_unref0 (_tmp308_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label4) ? _tmp2_label4 : (_tmp2_label4 = g_quark_from_static_string ("birthday")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp312_ = NULL;
				gboolean _tmp313_ = FALSE;
				GeeHashMap* _tmp337_ = NULL;
				gboolean _tmp338_ = FALSE;
				gboolean _tmp339_ = FALSE;
				_tmp312_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp312_;
				_tmp313_ = add_empty;
				if (_tmp313_) {
					GDateTime* today = NULL;
					GDateTime* _tmp314_ = NULL;
					const gchar* _tmp315_ = NULL;
					GDateTime* _tmp316_ = NULL;
					gint _tmp317_ = 0;
					GeeHashMap* _tmp318_ = NULL;
					gint _tmp319_ = 0;
					ContactsContactEditorRowData _tmp320_ = {0};
					gint _tmp321_ = 0;
					_tmp314_ = g_date_time_new_now_local ();
					today = _tmp314_;
					_tmp315_ = _ ("Birthday");
					_tmp316_ = today;
					_tmp317_ = *row;
					contacts_contact_editor_attach_row_for_birthday (self, _tmp315_, NULL, _tmp316_, _tmp317_);
					_tmp318_ = rows;
					_tmp319_ = *row;
					_g_object_unref0 (_tmp320_.details);
					_tmp320_.details = NULL;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp318_, (gpointer) ((gintptr) _tmp319_), &_tmp320_);
					_tmp321_ = *row;
					*row = _tmp321_ + 1;
					_g_date_time_unref0 (today);
				} else {
					FolksBirthdayDetails* birthday_details = NULL;
					FolksPersona* _tmp322_ = NULL;
					FolksBirthdayDetails* _tmp323_ = NULL;
					FolksBirthdayDetails* _tmp324_ = NULL;
					_tmp322_ = p;
					_tmp323_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp322_, FOLKS_TYPE_BIRTHDAY_DETAILS) ? ((FolksBirthdayDetails*) _tmp322_) : NULL);
					birthday_details = _tmp323_;
					_tmp324_ = birthday_details;
					if (_tmp324_ != NULL) {
						FolksBirthdayDetails* _tmp325_ = NULL;
						GDateTime* _tmp326_ = NULL;
						GDateTime* _tmp327_ = NULL;
						_tmp325_ = birthday_details;
						_tmp326_ = folks_birthday_details_get_birthday (_tmp325_);
						_tmp327_ = _tmp326_;
						if (_tmp327_ != NULL) {
							const gchar* _tmp328_ = NULL;
							FolksBirthdayDetails* _tmp329_ = NULL;
							GDateTime* _tmp330_ = NULL;
							GDateTime* _tmp331_ = NULL;
							gint _tmp332_ = 0;
							GeeHashMap* _tmp333_ = NULL;
							gint _tmp334_ = 0;
							ContactsContactEditorRowData _tmp335_ = {0};
							gint _tmp336_ = 0;
							_tmp328_ = _ ("Birthday");
							_tmp329_ = birthday_details;
							_tmp330_ = folks_birthday_details_get_birthday (_tmp329_);
							_tmp331_ = _tmp330_;
							_tmp332_ = *row;
							contacts_contact_editor_attach_row_for_birthday (self, _tmp328_, NULL, _tmp331_, _tmp332_);
							_tmp333_ = rows;
							_tmp334_ = *row;
							_g_object_unref0 (_tmp335_.details);
							_tmp335_.details = NULL;
							gee_abstract_map_set ((GeeAbstractMap*) _tmp333_, (gpointer) ((gintptr) _tmp334_), &_tmp335_);
							_tmp336_ = *row;
							*row = _tmp336_ + 1;
						}
					}
					_g_object_unref0 (birthday_details);
				}
				_tmp337_ = rows;
				_tmp338_ = gee_map_get_is_empty ((GeeMap*) _tmp337_);
				_tmp339_ = _tmp338_;
				if (!_tmp339_) {
					GeeHashMap* _tmp340_ = NULL;
					FolksPersona* _tmp341_ = NULL;
					gpointer _tmp342_ = NULL;
					GeeHashMap* _tmp343_ = NULL;
					const gchar* _tmp344_ = NULL;
					gboolean _tmp345_ = FALSE;
					GeeHashMap* _tmp346_ = NULL;
					ContactsContactEditorField _tmp347_ = {0};
					_tmp340_ = self->priv->writable_personas;
					_tmp341_ = p;
					_tmp342_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp340_, _tmp341_);
					_tmp343_ = (GeeHashMap*) _tmp342_;
					_tmp344_ = prop_name;
					_tmp345_ = add_empty;
					_tmp346_ = rows;
					_tmp347_.changed = _tmp345_;
					_g_object_unref0 (_tmp347_.rows);
					_tmp347_.rows = _tmp346_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp343_, _tmp344_, &_tmp347_);
					_g_object_unref0 (_tmp343_);
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label5) ? _tmp2_label5 : (_tmp2_label5 = g_quark_from_static_string ("notes")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp348_ = NULL;
				gboolean _tmp349_ = FALSE;
				GeeHashMap* _tmp384_ = NULL;
				gboolean _tmp385_ = FALSE;
				gboolean _tmp386_ = FALSE;
				_tmp348_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp348_;
				_tmp349_ = add_empty;
				if (_tmp349_) {
					FolksNoteFieldDetails* detail_field = NULL;
					FolksNoteFieldDetails* _tmp350_ = NULL;
					const gchar* _tmp351_ = NULL;
					FolksNoteFieldDetails* _tmp352_ = NULL;
					gint _tmp353_ = 0;
					GeeHashMap* _tmp354_ = NULL;
					gint _tmp355_ = 0;
					FolksNoteFieldDetails* _tmp356_ = NULL;
					ContactsContactEditorRowData _tmp357_ = {0};
					gint _tmp358_ = 0;
					_tmp350_ = folks_note_field_details_new ("", NULL, NULL);
					detail_field = _tmp350_;
					_tmp351_ = _ ("Note");
					_tmp352_ = detail_field;
					_tmp353_ = *row;
					contacts_contact_editor_attach_row_with_text_labeled (self, _tmp351_, (FolksAbstractFieldDetails*) _tmp352_, "", _tmp353_);
					_tmp354_ = rows;
					_tmp355_ = *row;
					_tmp356_ = detail_field;
					_g_object_unref0 (_tmp357_.details);
					_tmp357_.details = (FolksAbstractFieldDetails*) _tmp356_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp354_, (gpointer) ((gintptr) _tmp355_), &_tmp357_);
					_tmp358_ = *row;
					*row = _tmp358_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksNoteDetails* note_details = NULL;
					FolksPersona* _tmp359_ = NULL;
					FolksNoteDetails* _tmp360_ = NULL;
					gboolean _tmp361_ = FALSE;
					FolksNoteDetails* _tmp362_ = NULL;
					gboolean _tmp364_ = FALSE;
					_tmp359_ = p;
					_tmp360_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp359_, FOLKS_TYPE_NOTE_DETAILS) ? ((FolksNoteDetails*) _tmp359_) : NULL);
					note_details = _tmp360_;
					_tmp362_ = note_details;
					if (_tmp362_ != NULL) {
						_tmp361_ = TRUE;
					} else {
						gboolean _tmp363_ = FALSE;
						_tmp363_ = add_empty;
						_tmp361_ = _tmp363_;
					}
					_tmp364_ = _tmp361_;
					if (_tmp364_) {
						{
							GeeIterator* _note_it = NULL;
							FolksNoteDetails* _tmp365_ = NULL;
							GeeSet* _tmp366_ = NULL;
							GeeSet* _tmp367_ = NULL;
							GeeIterator* _tmp368_ = NULL;
							_tmp365_ = note_details;
							_tmp366_ = folks_note_details_get_notes (_tmp365_);
							_tmp367_ = _tmp366_;
							_tmp368_ = gee_iterable_iterator ((GeeIterable*) _tmp367_);
							_note_it = _tmp368_;
							while (TRUE) {
								GeeIterator* _tmp369_ = NULL;
								gboolean _tmp370_ = FALSE;
								FolksNoteFieldDetails* note = NULL;
								GeeIterator* _tmp371_ = NULL;
								gpointer _tmp372_ = NULL;
								const gchar* _tmp373_ = NULL;
								FolksNoteFieldDetails* _tmp374_ = NULL;
								FolksNoteFieldDetails* _tmp375_ = NULL;
								gconstpointer _tmp376_ = NULL;
								const gchar* _tmp377_ = NULL;
								gint _tmp378_ = 0;
								GeeHashMap* _tmp379_ = NULL;
								gint _tmp380_ = 0;
								FolksNoteFieldDetails* _tmp381_ = NULL;
								ContactsContactEditorRowData _tmp382_ = {0};
								gint _tmp383_ = 0;
								_tmp369_ = _note_it;
								_tmp370_ = gee_iterator_next (_tmp369_);
								if (!_tmp370_) {
									break;
								}
								_tmp371_ = _note_it;
								_tmp372_ = gee_iterator_get (_tmp371_);
								note = (FolksNoteFieldDetails*) _tmp372_;
								_tmp373_ = _ ("Note");
								_tmp374_ = note;
								_tmp375_ = note;
								_tmp376_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp375_);
								_tmp377_ = _tmp376_;
								_tmp378_ = *row;
								contacts_contact_editor_attach_row_with_text_labeled (self, _tmp373_, (FolksAbstractFieldDetails*) _tmp374_, (const gchar*) _tmp377_, _tmp378_);
								_tmp379_ = rows;
								_tmp380_ = *row;
								_tmp381_ = note;
								_g_object_unref0 (_tmp382_.details);
								_tmp382_.details = (FolksAbstractFieldDetails*) _tmp381_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp379_, (gpointer) ((gintptr) _tmp380_), &_tmp382_);
								_tmp383_ = *row;
								*row = _tmp383_ + 1;
								_g_object_unref0 (note);
							}
							_g_object_unref0 (_note_it);
						}
					}
					_g_object_unref0 (note_details);
				}
				_tmp384_ = rows;
				_tmp385_ = gee_map_get_is_empty ((GeeMap*) _tmp384_);
				_tmp386_ = _tmp385_;
				if (!_tmp386_) {
					GeeHashMap* _tmp387_ = NULL;
					FolksPersona* _tmp388_ = NULL;
					gpointer _tmp389_ = NULL;
					GeeHashMap* _tmp390_ = NULL;
					const gchar* _tmp391_ = NULL;
					gboolean _tmp392_ = FALSE;
					gboolean _tmp393_ = FALSE;
					_tmp387_ = self->priv->writable_personas;
					_tmp388_ = p;
					_tmp389_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp387_, _tmp388_);
					_tmp390_ = (GeeHashMap*) _tmp389_;
					_tmp391_ = prop_name;
					_tmp392_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp390_, _tmp391_);
					_tmp393_ = _tmp392_;
					_g_object_unref0 (_tmp390_);
					if (_tmp393_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp394_ = NULL;
							GeeSet* _tmp395_ = NULL;
							GeeSet* _tmp396_ = NULL;
							GeeSet* _tmp397_ = NULL;
							GeeIterator* _tmp398_ = NULL;
							GeeIterator* _tmp399_ = NULL;
							_tmp394_ = rows;
							_tmp395_ = gee_abstract_map_get_entries ((GeeMap*) _tmp394_);
							_tmp396_ = _tmp395_;
							_tmp397_ = _tmp396_;
							_tmp398_ = gee_iterable_iterator ((GeeIterable*) _tmp397_);
							_tmp399_ = _tmp398_;
							_g_object_unref0 (_tmp397_);
							_entry_it = _tmp399_;
							while (TRUE) {
								GeeIterator* _tmp400_ = NULL;
								gboolean _tmp401_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp402_ = NULL;
								gpointer _tmp403_ = NULL;
								GeeHashMap* _tmp404_ = NULL;
								FolksPersona* _tmp405_ = NULL;
								gpointer _tmp406_ = NULL;
								GeeHashMap* _tmp407_ = NULL;
								const gchar* _tmp408_ = NULL;
								gpointer _tmp409_ = NULL;
								ContactsContactEditorField* _tmp410_ = NULL;
								GeeHashMap* _tmp411_ = NULL;
								GeeMapEntry* _tmp412_ = NULL;
								gconstpointer _tmp413_ = NULL;
								gint _tmp414_ = 0;
								GeeMapEntry* _tmp415_ = NULL;
								gconstpointer _tmp416_ = NULL;
								ContactsContactEditorRowData* _tmp417_ = NULL;
								_tmp400_ = _entry_it;
								_tmp401_ = gee_iterator_next (_tmp400_);
								if (!_tmp401_) {
									break;
								}
								_tmp402_ = _entry_it;
								_tmp403_ = gee_iterator_get (_tmp402_);
								entry = (GeeMapEntry*) _tmp403_;
								_tmp404_ = self->priv->writable_personas;
								_tmp405_ = p;
								_tmp406_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp404_, _tmp405_);
								_tmp407_ = (GeeHashMap*) _tmp406_;
								_tmp408_ = prop_name;
								_tmp409_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp407_, _tmp408_);
								_tmp410_ = (ContactsContactEditorField*) _tmp409_;
								_tmp411_ = (*_tmp410_).rows;
								_tmp412_ = entry;
								_tmp413_ = gee_map_entry_get_key (_tmp412_);
								_tmp414_ = _tmp413_;
								_tmp415_ = entry;
								_tmp416_ = gee_map_entry_get_value (_tmp415_);
								_tmp417_ = _tmp416_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp411_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp414_))), (ContactsContactEditorRowData*) _tmp417_);
								_contacts_contact_editor_field_free0 (_tmp410_);
								_g_object_unref0 (_tmp407_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp418_ = NULL;
						FolksPersona* _tmp419_ = NULL;
						gpointer _tmp420_ = NULL;
						GeeHashMap* _tmp421_ = NULL;
						const gchar* _tmp422_ = NULL;
						GeeHashMap* _tmp423_ = NULL;
						ContactsContactEditorField _tmp424_ = {0};
						_tmp418_ = self->priv->writable_personas;
						_tmp419_ = p;
						_tmp420_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp418_, _tmp419_);
						_tmp421_ = (GeeHashMap*) _tmp420_;
						_tmp422_ = prop_name;
						_tmp423_ = rows;
						_tmp424_.changed = FALSE;
						_g_object_unref0 (_tmp424_.rows);
						_tmp424_.rows = _tmp423_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp421_, _tmp422_, &_tmp424_);
						_g_object_unref0 (_tmp421_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	} else if (_tmp3_ == ((0 != _tmp2_label6) ? _tmp2_label6 : (_tmp2_label6 = g_quark_from_static_string ("postal-addresses")))) {
		switch (0) {
			default:
			{
				GeeHashMap* rows = NULL;
				GeeHashMap* _tmp425_ = NULL;
				gboolean _tmp426_ = FALSE;
				GeeHashMap* _tmp462_ = NULL;
				gboolean _tmp463_ = FALSE;
				gboolean _tmp464_ = FALSE;
				_tmp425_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				rows = _tmp425_;
				_tmp426_ = add_empty;
				if (_tmp426_) {
					FolksPostalAddressFieldDetails* detail_field = NULL;
					FolksPostalAddress* _tmp427_ = NULL;
					FolksPostalAddress* _tmp428_ = NULL;
					FolksPostalAddressFieldDetails* _tmp429_ = NULL;
					FolksPostalAddressFieldDetails* _tmp430_ = NULL;
					gint _tmp431_ = 0;
					ContactsTypeSet* _tmp432_ = NULL;
					ContactsTypeSet* _tmp433_ = NULL;
					FolksPostalAddressFieldDetails* _tmp434_ = NULL;
					const gchar* _tmp435_ = NULL;
					GeeHashMap* _tmp436_ = NULL;
					gint _tmp437_ = 0;
					FolksPostalAddressFieldDetails* _tmp438_ = NULL;
					ContactsContactEditorRowData _tmp439_ = {0};
					gint _tmp440_ = 0;
					_tmp427_ = folks_postal_address_new (NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
					_tmp428_ = _tmp427_;
					_tmp429_ = folks_postal_address_field_details_new (_tmp428_, NULL);
					_tmp430_ = _tmp429_;
					_g_object_unref0 (_tmp428_);
					detail_field = _tmp430_;
					_tmp431_ = *row;
					_tmp432_ = contacts_typeset_get_general ();
					_tmp433_ = _tmp432_;
					_tmp434_ = detail_field;
					_tmp435_ = type;
					contacts_contact_editor_attach_row_for_address (self, _tmp431_, _tmp433_, _tmp434_, _tmp435_);
					_tmp436_ = rows;
					_tmp437_ = *row;
					_tmp438_ = detail_field;
					_g_object_unref0 (_tmp439_.details);
					_tmp439_.details = (FolksAbstractFieldDetails*) _tmp438_;
					gee_abstract_map_set ((GeeAbstractMap*) _tmp436_, (gpointer) ((gintptr) _tmp437_), &_tmp439_);
					_tmp440_ = *row;
					*row = _tmp440_ + 1;
					_g_object_unref0 (detail_field);
				} else {
					FolksPostalAddressDetails* address_details = NULL;
					FolksPersona* _tmp441_ = NULL;
					FolksPostalAddressDetails* _tmp442_ = NULL;
					FolksPostalAddressDetails* _tmp443_ = NULL;
					_tmp441_ = p;
					_tmp442_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp441_, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS) ? ((FolksPostalAddressDetails*) _tmp441_) : NULL);
					address_details = _tmp442_;
					_tmp443_ = address_details;
					if (_tmp443_ != NULL) {
						{
							GeeIterator* _addr_it = NULL;
							FolksPostalAddressDetails* _tmp444_ = NULL;
							GeeSet* _tmp445_ = NULL;
							GeeSet* _tmp446_ = NULL;
							GeeIterator* _tmp447_ = NULL;
							_tmp444_ = address_details;
							_tmp445_ = folks_postal_address_details_get_postal_addresses (_tmp444_);
							_tmp446_ = _tmp445_;
							_tmp447_ = gee_iterable_iterator ((GeeIterable*) _tmp446_);
							_addr_it = _tmp447_;
							while (TRUE) {
								GeeIterator* _tmp448_ = NULL;
								gboolean _tmp449_ = FALSE;
								FolksPostalAddressFieldDetails* addr = NULL;
								GeeIterator* _tmp450_ = NULL;
								gpointer _tmp451_ = NULL;
								gint _tmp452_ = 0;
								ContactsTypeSet* _tmp453_ = NULL;
								ContactsTypeSet* _tmp454_ = NULL;
								FolksPostalAddressFieldDetails* _tmp455_ = NULL;
								const gchar* _tmp456_ = NULL;
								GeeHashMap* _tmp457_ = NULL;
								gint _tmp458_ = 0;
								FolksPostalAddressFieldDetails* _tmp459_ = NULL;
								ContactsContactEditorRowData _tmp460_ = {0};
								gint _tmp461_ = 0;
								_tmp448_ = _addr_it;
								_tmp449_ = gee_iterator_next (_tmp448_);
								if (!_tmp449_) {
									break;
								}
								_tmp450_ = _addr_it;
								_tmp451_ = gee_iterator_get (_tmp450_);
								addr = (FolksPostalAddressFieldDetails*) _tmp451_;
								_tmp452_ = *row;
								_tmp453_ = contacts_typeset_get_general ();
								_tmp454_ = _tmp453_;
								_tmp455_ = addr;
								_tmp456_ = type;
								contacts_contact_editor_attach_row_for_address (self, _tmp452_, _tmp454_, _tmp455_, _tmp456_);
								_tmp457_ = rows;
								_tmp458_ = *row;
								_tmp459_ = addr;
								_g_object_unref0 (_tmp460_.details);
								_tmp460_.details = (FolksAbstractFieldDetails*) _tmp459_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp457_, (gpointer) ((gintptr) _tmp458_), &_tmp460_);
								_tmp461_ = *row;
								*row = _tmp461_ + 1;
								_g_object_unref0 (addr);
							}
							_g_object_unref0 (_addr_it);
						}
					}
					_g_object_unref0 (address_details);
				}
				_tmp462_ = rows;
				_tmp463_ = gee_map_get_is_empty ((GeeMap*) _tmp462_);
				_tmp464_ = _tmp463_;
				if (!_tmp464_) {
					GeeHashMap* _tmp465_ = NULL;
					FolksPersona* _tmp466_ = NULL;
					gpointer _tmp467_ = NULL;
					GeeHashMap* _tmp468_ = NULL;
					const gchar* _tmp469_ = NULL;
					gboolean _tmp470_ = FALSE;
					gboolean _tmp471_ = FALSE;
					_tmp465_ = self->priv->writable_personas;
					_tmp466_ = p;
					_tmp467_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp465_, _tmp466_);
					_tmp468_ = (GeeHashMap*) _tmp467_;
					_tmp469_ = prop_name;
					_tmp470_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp468_, _tmp469_);
					_tmp471_ = _tmp470_;
					_g_object_unref0 (_tmp468_);
					if (_tmp471_) {
						{
							GeeIterator* _entry_it = NULL;
							GeeHashMap* _tmp472_ = NULL;
							GeeSet* _tmp473_ = NULL;
							GeeSet* _tmp474_ = NULL;
							GeeSet* _tmp475_ = NULL;
							GeeIterator* _tmp476_ = NULL;
							GeeIterator* _tmp477_ = NULL;
							_tmp472_ = rows;
							_tmp473_ = gee_abstract_map_get_entries ((GeeMap*) _tmp472_);
							_tmp474_ = _tmp473_;
							_tmp475_ = _tmp474_;
							_tmp476_ = gee_iterable_iterator ((GeeIterable*) _tmp475_);
							_tmp477_ = _tmp476_;
							_g_object_unref0 (_tmp475_);
							_entry_it = _tmp477_;
							while (TRUE) {
								GeeIterator* _tmp478_ = NULL;
								gboolean _tmp479_ = FALSE;
								GeeMapEntry* entry = NULL;
								GeeIterator* _tmp480_ = NULL;
								gpointer _tmp481_ = NULL;
								GeeHashMap* _tmp482_ = NULL;
								FolksPersona* _tmp483_ = NULL;
								gpointer _tmp484_ = NULL;
								GeeHashMap* _tmp485_ = NULL;
								const gchar* _tmp486_ = NULL;
								gpointer _tmp487_ = NULL;
								ContactsContactEditorField* _tmp488_ = NULL;
								GeeHashMap* _tmp489_ = NULL;
								GeeMapEntry* _tmp490_ = NULL;
								gconstpointer _tmp491_ = NULL;
								gint _tmp492_ = 0;
								GeeMapEntry* _tmp493_ = NULL;
								gconstpointer _tmp494_ = NULL;
								ContactsContactEditorRowData* _tmp495_ = NULL;
								_tmp478_ = _entry_it;
								_tmp479_ = gee_iterator_next (_tmp478_);
								if (!_tmp479_) {
									break;
								}
								_tmp480_ = _entry_it;
								_tmp481_ = gee_iterator_get (_tmp480_);
								entry = (GeeMapEntry*) _tmp481_;
								_tmp482_ = self->priv->writable_personas;
								_tmp483_ = p;
								_tmp484_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp482_, _tmp483_);
								_tmp485_ = (GeeHashMap*) _tmp484_;
								_tmp486_ = prop_name;
								_tmp487_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp485_, _tmp486_);
								_tmp488_ = (ContactsContactEditorField*) _tmp487_;
								_tmp489_ = (*_tmp488_).rows;
								_tmp490_ = entry;
								_tmp491_ = gee_map_entry_get_key (_tmp490_);
								_tmp492_ = _tmp491_;
								_tmp493_ = entry;
								_tmp494_ = gee_map_entry_get_value (_tmp493_);
								_tmp495_ = _tmp494_;
								gee_abstract_map_set ((GeeAbstractMap*) _tmp489_, (gpointer) ((gintptr) ((gint) ((gintptr) _tmp492_))), (ContactsContactEditorRowData*) _tmp495_);
								_contacts_contact_editor_field_free0 (_tmp488_);
								_g_object_unref0 (_tmp485_);
								_g_object_unref0 (entry);
							}
							_g_object_unref0 (_entry_it);
						}
					} else {
						GeeHashMap* _tmp496_ = NULL;
						FolksPersona* _tmp497_ = NULL;
						gpointer _tmp498_ = NULL;
						GeeHashMap* _tmp499_ = NULL;
						const gchar* _tmp500_ = NULL;
						GeeHashMap* _tmp501_ = NULL;
						ContactsContactEditorField _tmp502_ = {0};
						_tmp496_ = self->priv->writable_personas;
						_tmp497_ = p;
						_tmp498_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp496_, _tmp497_);
						_tmp499_ = (GeeHashMap*) _tmp498_;
						_tmp500_ = prop_name;
						_tmp501_ = rows;
						_tmp502_.changed = FALSE;
						_g_object_unref0 (_tmp502_.rows);
						_tmp502_.rows = _tmp501_;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp499_, _tmp500_, &_tmp502_);
						_g_object_unref0 (_tmp499_);
					}
				}
				_g_object_unref0 (rows);
				break;
			}
		}
	}
}


static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx) {
	gint _tmp55_ = 0;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _field_maps_it = NULL;
		GeeHashMap* _tmp0_ = NULL;
		GeeCollection* _tmp1_ = NULL;
		GeeCollection* _tmp2_ = NULL;
		GeeCollection* _tmp3_ = NULL;
		GeeIterator* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_field_maps_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_ = NULL;
			gboolean _tmp7_ = FALSE;
			GeeHashMap* field_maps = NULL;
			GeeIterator* _tmp8_ = NULL;
			gpointer _tmp9_ = NULL;
			_tmp6_ = _field_maps_it;
			_tmp7_ = gee_iterator_next (_tmp6_);
			if (!_tmp7_) {
				break;
			}
			_tmp8_ = _field_maps_it;
			_tmp9_ = gee_iterator_get (_tmp8_);
			field_maps = (GeeHashMap*) _tmp9_;
			{
				GeeIterator* _field_it = NULL;
				GeeHashMap* _tmp10_ = NULL;
				GeeCollection* _tmp11_ = NULL;
				GeeCollection* _tmp12_ = NULL;
				GeeCollection* _tmp13_ = NULL;
				GeeIterator* _tmp14_ = NULL;
				GeeIterator* _tmp15_ = NULL;
				_tmp10_ = field_maps;
				_tmp11_ = gee_abstract_map_get_values ((GeeMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_field_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_ = NULL;
					gboolean _tmp17_ = FALSE;
					ContactsContactEditorField* field = NULL;
					GeeIterator* _tmp18_ = NULL;
					gpointer _tmp19_ = NULL;
					_tmp16_ = _field_it;
					_tmp17_ = gee_iterator_next (_tmp16_);
					if (!_tmp17_) {
						break;
					}
					_tmp18_ = _field_it;
					_tmp19_ = gee_iterator_get (_tmp18_);
					field = (ContactsContactEditorField*) _tmp19_;
					{
						GeeIterator* _row_it = NULL;
						ContactsContactEditorField* _tmp20_ = NULL;
						GeeHashMap* _tmp21_ = NULL;
						GeeSet* _tmp22_ = NULL;
						GeeSet* _tmp23_ = NULL;
						GeeSet* _tmp24_ = NULL;
						GeeIterator* _tmp25_ = NULL;
						GeeIterator* _tmp26_ = NULL;
						_tmp20_ = field;
						_tmp21_ = (*_tmp20_).rows;
						_tmp22_ = gee_abstract_map_get_keys ((GeeMap*) _tmp21_);
						_tmp23_ = _tmp22_;
						_tmp24_ = _tmp23_;
						_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
						_tmp26_ = _tmp25_;
						_g_object_unref0 (_tmp24_);
						_row_it = _tmp26_;
						while (TRUE) {
							GeeIterator* _tmp27_ = NULL;
							gboolean _tmp28_ = FALSE;
							gint row = 0;
							GeeIterator* _tmp29_ = NULL;
							gpointer _tmp30_ = NULL;
							gint _tmp31_ = 0;
							gint _tmp32_ = 0;
							_tmp27_ = _row_it;
							_tmp28_ = gee_iterator_next (_tmp27_);
							if (!_tmp28_) {
								break;
							}
							_tmp29_ = _row_it;
							_tmp30_ = gee_iterator_get (_tmp29_);
							row = (gint) ((gintptr) _tmp30_);
							_tmp31_ = row;
							_tmp32_ = idx;
							if (_tmp31_ >= _tmp32_) {
								GeeHashMap* new_rows = NULL;
								GeeHashMap* _tmp33_ = NULL;
								ContactsContactEditorField* _tmp52_ = NULL;
								GeeHashMap* _tmp53_ = NULL;
								GeeHashMap* _tmp54_ = NULL;
								_tmp33_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
								new_rows = _tmp33_;
								{
									GeeIterator* _old_row_it = NULL;
									ContactsContactEditorField* _tmp34_ = NULL;
									GeeHashMap* _tmp35_ = NULL;
									GeeSet* _tmp36_ = NULL;
									GeeSet* _tmp37_ = NULL;
									GeeSet* _tmp38_ = NULL;
									GeeIterator* _tmp39_ = NULL;
									GeeIterator* _tmp40_ = NULL;
									_tmp34_ = field;
									_tmp35_ = (*_tmp34_).rows;
									_tmp36_ = gee_abstract_map_get_keys ((GeeMap*) _tmp35_);
									_tmp37_ = _tmp36_;
									_tmp38_ = _tmp37_;
									_tmp39_ = gee_iterable_iterator ((GeeIterable*) _tmp38_);
									_tmp40_ = _tmp39_;
									_g_object_unref0 (_tmp38_);
									_old_row_it = _tmp40_;
									while (TRUE) {
										GeeIterator* _tmp41_ = NULL;
										gboolean _tmp42_ = FALSE;
										gint old_row = 0;
										GeeIterator* _tmp43_ = NULL;
										gpointer _tmp44_ = NULL;
										GeeHashMap* _tmp45_ = NULL;
										gint _tmp46_ = 0;
										ContactsContactEditorField* _tmp47_ = NULL;
										GeeHashMap* _tmp48_ = NULL;
										gint _tmp49_ = 0;
										gpointer _tmp50_ = NULL;
										ContactsContactEditorRowData* _tmp51_ = NULL;
										_tmp41_ = _old_row_it;
										_tmp42_ = gee_iterator_next (_tmp41_);
										if (!_tmp42_) {
											break;
										}
										_tmp43_ = _old_row_it;
										_tmp44_ = gee_iterator_get (_tmp43_);
										old_row = (gint) ((gintptr) _tmp44_);
										_tmp45_ = new_rows;
										_tmp46_ = old_row;
										_tmp47_ = field;
										_tmp48_ = (*_tmp47_).rows;
										_tmp49_ = old_row;
										_tmp50_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp48_, (gpointer) ((gintptr) _tmp49_));
										_tmp51_ = (ContactsContactEditorRowData*) _tmp50_;
										gee_abstract_map_set ((GeeAbstractMap*) _tmp45_, (gpointer) ((gintptr) (_tmp46_ + 1)), _tmp51_);
										_contacts_contact_editor_row_data_free0 (_tmp51_);
									}
									_g_object_unref0 (_old_row_it);
								}
								_tmp52_ = field;
								_tmp53_ = new_rows;
								_tmp54_ = _g_object_ref0 (_tmp53_);
								_g_object_unref0 ((*_tmp52_).rows);
								(*_tmp52_).rows = _tmp54_;
								_g_object_unref0 (new_rows);
								break;
							}
						}
						_g_object_unref0 (_row_it);
					}
					_contacts_contact_editor_field_free0 (field);
				}
				_g_object_unref0 (_field_it);
			}
			_g_object_unref0 (field_maps);
		}
		_g_object_unref0 (_field_maps_it);
	}
	_tmp55_ = idx;
	gtk_grid_insert_row ((GtkGrid*) self, _tmp55_);
}


ContactsContactEditor* contacts_contact_editor_construct (GType object_type) {
	ContactsContactEditor * self = NULL;
	GeeHashMap* _tmp0_ = NULL;
	self = (ContactsContactEditor*) g_object_new (object_type, NULL);
	gtk_grid_set_row_spacing ((GtkGrid*) self, (guint) 12);
	gtk_grid_set_column_spacing ((GtkGrid*) self, (guint) 12);
	_tmp0_ = gee_hash_map_new (FOLKS_TYPE_PERSONA, (GBoxedCopyFunc) g_object_ref, g_object_unref, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->writable_personas);
	self->priv->writable_personas = _tmp0_;
	return self;
}


ContactsContactEditor* contacts_contact_editor_new (void) {
	return contacts_contact_editor_construct (CONTACTS_TYPE_CONTACT_EDITOR);
}


static Block26Data* block26_data_ref (Block26Data* _data26_) {
	g_atomic_int_inc (&_data26_->_ref_count_);
	return _data26_;
}


static void block26_data_unref (void * _userdata_) {
	Block26Data* _data26_;
	_data26_ = (Block26Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data26_->_ref_count_)) {
		ContactsContactEditor * self;
		self = _data26_->self;
		_g_object_unref0 (_data26_->name_entry);
		_g_object_unref0 (_data26_->image_frame);
		_g_object_unref0 (_data26_->c);
		_g_object_unref0 (self);
		g_slice_free (Block26Data, _data26_);
	}
}


static void __lambda57_ (Block26Data* _data26_) {
	ContactsContactEditor * self;
	ContactsContact* _tmp0_ = NULL;
	ContactsContactFrame* _tmp1_ = NULL;
	self = _data26_->self;
	_tmp0_ = _data26_->c;
	_tmp1_ = _data26_->image_frame;
	contacts_change_avatar (_tmp0_, _tmp1_);
}


static void ___lambda57__contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
	__lambda57_ (self);
}


static void __lambda72_ (Block26Data* _data26_, GtkWidget* w) {
	ContactsContactEditor * self;
	GtkWidget* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	FolksIndividual* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	self = _data26_->self;
	g_return_if_fail (w != NULL);
	_tmp0_ = w;
	_tmp1_ = _data26_->c;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = _data26_->c;
	contacts_contact_frame_set_image (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, CONTACTS_TYPE_CONTACT_FRAME) ? ((ContactsContactFrame*) _tmp0_) : NULL, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ___lambda72__gtk_callback (GtkWidget* widget, gpointer self) {
	__lambda72_ (self, widget);
}


static void __lambda73_ (Block26Data* _data26_) {
	ContactsContactEditor * self;
	GtkEntry* _tmp0_ = NULL;
	self = _data26_->self;
	_tmp0_ = _data26_->name_entry;
	g_object_set_data_full ((GObject*) _tmp0_, "changed", (gpointer) ((gintptr) TRUE), NULL);
}


static void ___lambda73__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda73_ (self);
}


void contacts_contact_editor_update (ContactsContactEditor* self, ContactsContact* c) {
	Block26Data* _data26_;
	ContactsContact* _tmp0_ = NULL;
	ContactsContact* _tmp1_ = NULL;
	ContactsContact* _tmp2_ = NULL;
	ContactsContact* _tmp3_ = NULL;
	ContactsContactFrame* _tmp4_ = NULL;
	ContactsContactFrame* _tmp5_ = NULL;
	ContactsContactFrame* _tmp6_ = NULL;
	ContactsContactFrame* _tmp7_ = NULL;
	GtkWidget* _tmp8_ = NULL;
	ContactsContactFrame* _tmp9_ = NULL;
	ContactsContact* _tmp10_ = NULL;
	ContactsContactFrame* _tmp11_ = NULL;
	ContactsContactFrame* _tmp12_ = NULL;
	GtkEntry* _tmp13_ = NULL;
	GtkEntry* _tmp14_ = NULL;
	GtkEntry* _tmp15_ = NULL;
	GtkEntry* _tmp16_ = NULL;
	ContactsContact* _tmp17_ = NULL;
	const gchar* _tmp18_ = NULL;
	const gchar* _tmp19_ = NULL;
	GtkEntry* _tmp20_ = NULL;
	GtkEntry* _tmp21_ = NULL;
	GtkEntry* _tmp22_ = NULL;
	gint i = 0;
	gint last_store_position = 0;
	gboolean is_first_persona = FALSE;
	GeeList* personas = NULL;
	ContactsContact* _tmp23_ = NULL;
	GeeList* _tmp24_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_data26_ = g_slice_new0 (Block26Data);
	_data26_->_ref_count_ = 1;
	_data26_->self = g_object_ref (self);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (_data26_->c);
	_data26_->c = _tmp1_;
	_tmp2_ = _data26_->c;
	_tmp3_ = _g_object_ref0 (_tmp2_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = _tmp3_;
	_tmp4_ = contacts_contact_frame_new (PROFILE_SIZE, TRUE);
	g_object_ref_sink (_tmp4_);
	_data26_->image_frame = _tmp4_;
	_tmp5_ = _data26_->image_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp5_, FALSE);
	_tmp6_ = _data26_->image_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp6_, GTK_ALIGN_START);
	_tmp7_ = _data26_->image_frame;
	_tmp8_ = gtk_bin_get_child ((GtkBin*) _tmp7_);
	gtk_button_set_relief (G_TYPE_CHECK_INSTANCE_TYPE (_tmp8_, GTK_TYPE_BUTTON) ? ((GtkButton*) _tmp8_) : NULL, GTK_RELIEF_NORMAL);
	_tmp9_ = _data26_->image_frame;
	g_signal_connect_data (_tmp9_, "clicked", (GCallback) ___lambda57__contacts_contact_frame_clicked, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	_tmp10_ = _data26_->c;
	_tmp11_ = _data26_->image_frame;
	contacts_contact_keep_widget_uptodate (_tmp10_, (GtkWidget*) _tmp11_, ___lambda72__gtk_callback, block26_data_ref (_data26_), block26_data_unref);
	_tmp12_ = _data26_->image_frame;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp12_, 0, 0, 1, 3);
	_tmp13_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp13_);
	_data26_->name_entry = _tmp13_;
	_tmp14_ = _data26_->name_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
	_tmp15_ = _data26_->name_entry;
	gtk_widget_set_valign ((GtkWidget*) _tmp15_, GTK_ALIGN_CENTER);
	_tmp16_ = _data26_->name_entry;
	_tmp17_ = _data26_->c;
	_tmp18_ = contacts_contact_get_display_name (_tmp17_);
	_tmp19_ = _tmp18_;
	gtk_entry_set_text (_tmp16_, _tmp19_);
	_tmp20_ = _data26_->name_entry;
	g_object_set_data_full ((GObject*) _tmp20_, "changed", (gpointer) ((gintptr) FALSE), NULL);
	_tmp21_ = _data26_->name_entry;
	gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp21_, 1, 0, 3, 3);
	_tmp22_ = _data26_->name_entry;
	g_signal_connect_data ((GtkEditable*) _tmp22_, "changed", (GCallback) ___lambda73__gtk_editable_changed, block26_data_ref (_data26_), (GClosureNotify) block26_data_unref, 0);
	i = 3;
	last_store_position = 0;
	is_first_persona = TRUE;
	_tmp23_ = _data26_->c;
	_tmp24_ = contacts_contact_get_personas_for_display (_tmp23_);
	personas = _tmp24_;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp25_ = NULL;
		GeeList* _tmp26_ = NULL;
		gint _p_size = 0;
		GeeList* _tmp27_ = NULL;
		gint _tmp28_ = 0;
		gint _tmp29_ = 0;
		gint _p_index = 0;
		_tmp25_ = personas;
		_tmp26_ = _g_object_ref0 (_tmp25_);
		_p_list = _tmp26_;
		_tmp27_ = _p_list;
		_tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
		_tmp29_ = _tmp28_;
		_p_size = _tmp29_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp30_ = 0;
			gint _tmp31_ = 0;
			gint _tmp32_ = 0;
			FolksPersona* p = NULL;
			GeeList* _tmp33_ = NULL;
			gint _tmp34_ = 0;
			gpointer _tmp35_ = NULL;
			gboolean _tmp36_ = FALSE;
			gchar** rw_props = NULL;
			FolksPersona* _tmp54_ = NULL;
			gchar** _tmp55_ = NULL;
			gint _tmp55__length1 = 0;
			gchar** _tmp56_ = NULL;
			gint _tmp56__length1 = 0;
			gint _tmp57_ = 0;
			gchar** _tmp58_ = NULL;
			gint rw_props_length1 = 0;
			gint _rw_props_size_ = 0;
			gchar** _tmp59_ = NULL;
			gint _tmp59__length1 = 0;
			gboolean _tmp68_ = FALSE;
			gint _tmp70_ = 0;
			gint _tmp71_ = 0;
			gint _tmp72_ = 0;
			_tmp30_ = _p_index;
			_p_index = _tmp30_ + 1;
			_tmp31_ = _p_index;
			_tmp32_ = _p_size;
			if (!(_tmp31_ < _tmp32_)) {
				break;
			}
			_tmp33_ = _p_list;
			_tmp34_ = _p_index;
			_tmp35_ = gee_list_get (_tmp33_, _tmp34_);
			p = (FolksPersona*) _tmp35_;
			_tmp36_ = is_first_persona;
			if (!_tmp36_) {
				GtkLabel* store_name = NULL;
				GtkLabel* _tmp37_ = NULL;
				GtkLabel* _tmp38_ = NULL;
				FolksPersona* _tmp39_ = NULL;
				gchar* _tmp40_ = NULL;
				gchar* _tmp41_ = NULL;
				gchar* _tmp42_ = NULL;
				gchar* _tmp43_ = NULL;
				GtkLabel* _tmp44_ = NULL;
				GtkLabel* _tmp45_ = NULL;
				GtkLabel* _tmp46_ = NULL;
				GtkTextDirection _tmp47_ = 0;
				GtkLabel* _tmp50_ = NULL;
				gint _tmp51_ = 0;
				gint _tmp52_ = 0;
				gint _tmp53_ = 0;
				_tmp37_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp37_);
				store_name = _tmp37_;
				_tmp38_ = store_name;
				_tmp39_ = p;
				_tmp40_ = contacts_contact_format_persona_store_name_for_contact (_tmp39_);
				_tmp41_ = _tmp40_;
				_tmp42_ = g_markup_printf_escaped ("<span font='16px bold'>%s</span>", _tmp41_);
				_tmp43_ = _tmp42_;
				gtk_label_set_markup (_tmp38_, _tmp43_);
				_g_free0 (_tmp43_);
				_g_free0 (_tmp41_);
				_tmp44_ = store_name;
				gtk_widget_set_halign ((GtkWidget*) _tmp44_, GTK_ALIGN_START);
				_tmp45_ = store_name;
				g_object_set ((GtkMisc*) _tmp45_, "xalign", 0.0f, NULL);
				_tmp46_ = store_name;
				_tmp47_ = gtk_widget_get_direction ((GtkWidget*) _tmp46_);
				if (_tmp47_ == GTK_TEXT_DIR_LTR) {
					GtkLabel* _tmp48_ = NULL;
					_tmp48_ = store_name;
					gtk_widget_set_margin_left ((GtkWidget*) _tmp48_, 6);
				} else {
					GtkLabel* _tmp49_ = NULL;
					_tmp49_ = store_name;
					gtk_widget_set_margin_right ((GtkWidget*) _tmp49_, 6);
				}
				_tmp50_ = store_name;
				_tmp51_ = i;
				gtk_grid_attach ((GtkGrid*) self, (GtkWidget*) _tmp50_, 0, _tmp51_, 2, 1);
				_tmp52_ = i;
				i = _tmp52_ + 1;
				_tmp53_ = i;
				last_store_position = _tmp53_;
				_g_object_unref0 (store_name);
			}
			_tmp54_ = p;
			_tmp55_ = folks_persona_get_writeable_properties (_tmp54_, &_tmp55__length1);
			_tmp56_ = _tmp55_;
			_tmp56__length1 = _tmp55__length1;
			_tmp58_ = contacts_contact_sort_persona_properties (_tmp56_, _tmp56__length1, &_tmp57_);
			rw_props = _tmp58_;
			rw_props_length1 = _tmp57_;
			_rw_props_size_ = rw_props_length1;
			_tmp59_ = rw_props;
			_tmp59__length1 = rw_props_length1;
			if (_tmp59__length1 != 0) {
				GeeHashMap* _tmp60_ = NULL;
				FolksPersona* _tmp61_ = NULL;
				GeeHashMap* _tmp62_ = NULL;
				GeeHashMap* _tmp63_ = NULL;
				gchar** _tmp64_ = NULL;
				gint _tmp64__length1 = 0;
				_tmp60_ = self->priv->writable_personas;
				_tmp61_ = p;
				_tmp62_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				_tmp63_ = _tmp62_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp60_, _tmp61_, _tmp63_);
				_g_object_unref0 (_tmp63_);
				_tmp64_ = rw_props;
				_tmp64__length1 = rw_props_length1;
				{
					gchar** prop_collection = NULL;
					gint prop_collection_length1 = 0;
					gint _prop_collection_size_ = 0;
					gint prop_it = 0;
					prop_collection = _tmp64_;
					prop_collection_length1 = _tmp64__length1;
					for (prop_it = 0; prop_it < _tmp64__length1; prop_it = prop_it + 1) {
						gchar* _tmp65_ = NULL;
						gchar* prop = NULL;
						_tmp65_ = g_strdup (prop_collection[prop_it]);
						prop = _tmp65_;
						{
							FolksPersona* _tmp66_ = NULL;
							const gchar* _tmp67_ = NULL;
							_tmp66_ = p;
							_tmp67_ = prop;
							contacts_contact_editor_add_edit_row (self, _tmp66_, _tmp67_, &i, FALSE, NULL);
							_g_free0 (prop);
						}
					}
				}
			}
			_tmp68_ = is_first_persona;
			if (_tmp68_) {
				gint _tmp69_ = 0;
				_tmp69_ = i;
				self->priv->last_row = _tmp69_ - 1;
			}
			_tmp70_ = i;
			if (_tmp70_ != 3) {
				is_first_persona = FALSE;
			}
			_tmp71_ = i;
			_tmp72_ = last_store_position;
			if (_tmp71_ == _tmp72_) {
				gint _tmp73_ = 0;
				gint _tmp74_ = 0;
				GtkWidget* _tmp75_ = NULL;
				_tmp73_ = i;
				i = _tmp73_ - 1;
				_tmp74_ = i;
				_tmp75_ = gtk_grid_get_child_at ((GtkGrid*) self, 0, _tmp74_);
				gtk_widget_destroy (_tmp75_);
			}
			rw_props = (_vala_array_free (rw_props, rw_props_length1, (GDestroyNotify) g_free), NULL);
			_g_object_unref0 (p);
		}
		_g_object_unref0 (_p_list);
	}
	_g_object_unref0 (personas);
	block26_data_unref (_data26_);
	_data26_ = NULL;
}


void contacts_contact_editor_clear (ContactsContactEditor* self) {
	GList* _tmp0_ = NULL;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_container_get_children ((GtkContainer*) self);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp0_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				GtkWidget* _tmp1_ = NULL;
				_tmp1_ = w;
				gtk_widget_destroy (_tmp1_);
			}
		}
		_g_list_free0 (w_collection);
	}
}


GeeHashMap* contacts_contact_editor_properties_changed (ContactsContactEditor* self) {
	GeeHashMap* result = NULL;
	GeeHashMap* props_set = NULL;
	GeeHashMap* _tmp0_ = NULL;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_PROPERTY_DATA, (GBoxedCopyFunc) contacts_contact_editor_property_data_dup, contacts_contact_editor_property_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	props_set = _tmp0_;
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp1_ = NULL;
		GeeSet* _tmp2_ = NULL;
		GeeSet* _tmp3_ = NULL;
		GeeSet* _tmp4_ = NULL;
		GeeIterator* _tmp5_ = NULL;
		GeeIterator* _tmp6_ = NULL;
		_tmp1_ = self->priv->writable_personas;
		_tmp2_ = gee_abstract_map_get_entries ((GeeMap*) _tmp1_);
		_tmp3_ = _tmp2_;
		_tmp4_ = _tmp3_;
		_tmp5_ = gee_iterable_iterator ((GeeIterable*) _tmp4_);
		_tmp6_ = _tmp5_;
		_g_object_unref0 (_tmp4_);
		_entry_it = _tmp6_;
		while (TRUE) {
			GeeIterator* _tmp7_ = NULL;
			gboolean _tmp8_ = FALSE;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp9_ = NULL;
			gpointer _tmp10_ = NULL;
			_tmp7_ = _entry_it;
			_tmp8_ = gee_iterator_next (_tmp7_);
			if (!_tmp8_) {
				break;
			}
			_tmp9_ = _entry_it;
			_tmp10_ = gee_iterator_get (_tmp9_);
			entry = (GeeMapEntry*) _tmp10_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeMapEntry* _tmp11_ = NULL;
				gconstpointer _tmp12_ = NULL;
				GeeHashMap* _tmp13_ = NULL;
				GeeSet* _tmp14_ = NULL;
				GeeSet* _tmp15_ = NULL;
				GeeSet* _tmp16_ = NULL;
				GeeIterator* _tmp17_ = NULL;
				GeeIterator* _tmp18_ = NULL;
				_tmp11_ = entry;
				_tmp12_ = gee_map_entry_get_value (_tmp11_);
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_abstract_map_get_entries ((GeeMap*) ((GeeHashMap*) _tmp13_));
				_tmp15_ = _tmp14_;
				_tmp16_ = _tmp15_;
				_tmp17_ = gee_iterable_iterator ((GeeIterable*) _tmp16_);
				_tmp18_ = _tmp17_;
				_g_object_unref0 (_tmp16_);
				_field_entry_it = _tmp18_;
				while (TRUE) {
					GeeIterator* _tmp19_ = NULL;
					gboolean _tmp20_ = FALSE;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp21_ = NULL;
					gpointer _tmp22_ = NULL;
					gboolean _tmp23_ = FALSE;
					GeeMapEntry* _tmp24_ = NULL;
					gconstpointer _tmp25_ = NULL;
					ContactsContactEditorField* _tmp26_ = NULL;
					gboolean _tmp27_ = FALSE;
					gboolean _tmp33_ = FALSE;
					_tmp19_ = _field_entry_it;
					_tmp20_ = gee_iterator_next (_tmp19_);
					if (!_tmp20_) {
						break;
					}
					_tmp21_ = _field_entry_it;
					_tmp22_ = gee_iterator_get (_tmp21_);
					field_entry = (GeeMapEntry*) _tmp22_;
					_tmp24_ = field_entry;
					_tmp25_ = gee_map_entry_get_value (_tmp24_);
					_tmp26_ = _tmp25_;
					_tmp27_ = (*((ContactsContactEditorField*) _tmp26_)).changed;
					if (_tmp27_) {
						GeeHashMap* _tmp28_ = NULL;
						GeeMapEntry* _tmp29_ = NULL;
						gconstpointer _tmp30_ = NULL;
						const gchar* _tmp31_ = NULL;
						gboolean _tmp32_ = FALSE;
						_tmp28_ = props_set;
						_tmp29_ = field_entry;
						_tmp30_ = gee_map_entry_get_key (_tmp29_);
						_tmp31_ = _tmp30_;
						_tmp32_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp28_, (const gchar*) _tmp31_);
						_tmp23_ = !_tmp32_;
					} else {
						_tmp23_ = FALSE;
					}
					_tmp33_ = _tmp23_;
					if (_tmp33_) {
						ContactsContactEditorPropertyData p = {0};
						GeeMapEntry* _tmp34_ = NULL;
						gconstpointer _tmp35_ = NULL;
						FolksPersona* _tmp36_ = NULL;
						FolksPersona* _tmp37_ = NULL;
						GeeMapEntry* _tmp38_ = NULL;
						gconstpointer _tmp39_ = NULL;
						const gchar* _tmp40_ = NULL;
						const gchar* _tmp41_ = NULL;
						GQuark _tmp43_ = 0U;
						static GQuark _tmp42_label0 = 0;
						static GQuark _tmp42_label1 = 0;
						static GQuark _tmp42_label2 = 0;
						static GQuark _tmp42_label3 = 0;
						static GQuark _tmp42_label4 = 0;
						static GQuark _tmp42_label5 = 0;
						static GQuark _tmp42_label6 = 0;
						GeeHashMap* _tmp79_ = NULL;
						GeeMapEntry* _tmp80_ = NULL;
						gconstpointer _tmp81_ = NULL;
						const gchar* _tmp82_ = NULL;
						ContactsContactEditorPropertyData _tmp83_ = {0};
						memset (&p, 0, sizeof (ContactsContactEditorPropertyData));
						_tmp34_ = entry;
						_tmp35_ = gee_map_entry_get_key (_tmp34_);
						_tmp36_ = _tmp35_;
						_tmp37_ = _g_object_ref0 ((FolksPersona*) _tmp36_);
						_g_object_unref0 (p.persona);
						p.persona = _tmp37_;
						_tmp38_ = field_entry;
						_tmp39_ = gee_map_entry_get_key (_tmp38_);
						_tmp40_ = _tmp39_;
						_tmp41_ = (const gchar*) _tmp40_;
						_tmp43_ = (NULL == _tmp41_) ? 0 : g_quark_from_string (_tmp41_);
						if (_tmp43_ == ((0 != _tmp42_label0) ? _tmp42_label0 : (_tmp42_label0 = g_quark_from_static_string ("email-addresses")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp44_ = NULL;
									gconstpointer _tmp45_ = NULL;
									ContactsContactEditorField* _tmp46_ = NULL;
									GeeHashMap* _tmp47_ = NULL;
									GValue _tmp48_ = {0};
									_tmp44_ = field_entry;
									_tmp45_ = gee_map_entry_get_value (_tmp44_);
									_tmp46_ = _tmp45_;
									_tmp47_ = (*((ContactsContactEditorField*) _tmp46_)).rows;
									contacts_contact_editor_get_value_from_emails (self, _tmp47_, &_tmp48_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp48_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label1) ? _tmp42_label1 : (_tmp42_label1 = g_quark_from_static_string ("phone-numbers")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp49_ = NULL;
									gconstpointer _tmp50_ = NULL;
									ContactsContactEditorField* _tmp51_ = NULL;
									GeeHashMap* _tmp52_ = NULL;
									GValue _tmp53_ = {0};
									_tmp49_ = field_entry;
									_tmp50_ = gee_map_entry_get_value (_tmp49_);
									_tmp51_ = _tmp50_;
									_tmp52_ = (*((ContactsContactEditorField*) _tmp51_)).rows;
									contacts_contact_editor_get_value_from_phones (self, _tmp52_, &_tmp53_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp53_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label2) ? _tmp42_label2 : (_tmp42_label2 = g_quark_from_static_string ("urls")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp54_ = NULL;
									gconstpointer _tmp55_ = NULL;
									ContactsContactEditorField* _tmp56_ = NULL;
									GeeHashMap* _tmp57_ = NULL;
									GValue _tmp58_ = {0};
									_tmp54_ = field_entry;
									_tmp55_ = gee_map_entry_get_value (_tmp54_);
									_tmp56_ = _tmp55_;
									_tmp57_ = (*((ContactsContactEditorField*) _tmp56_)).rows;
									contacts_contact_editor_get_value_from_urls (self, _tmp57_, &_tmp58_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp58_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label3) ? _tmp42_label3 : (_tmp42_label3 = g_quark_from_static_string ("nickname")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp59_ = NULL;
									gconstpointer _tmp60_ = NULL;
									ContactsContactEditorField* _tmp61_ = NULL;
									GeeHashMap* _tmp62_ = NULL;
									GValue _tmp63_ = {0};
									_tmp59_ = field_entry;
									_tmp60_ = gee_map_entry_get_value (_tmp59_);
									_tmp61_ = _tmp60_;
									_tmp62_ = (*((ContactsContactEditorField*) _tmp61_)).rows;
									contacts_contact_editor_get_value_from_nickname (self, _tmp62_, &_tmp63_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp63_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label4) ? _tmp42_label4 : (_tmp42_label4 = g_quark_from_static_string ("birthday")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp64_ = NULL;
									gconstpointer _tmp65_ = NULL;
									ContactsContactEditorField* _tmp66_ = NULL;
									GeeHashMap* _tmp67_ = NULL;
									GValue _tmp68_ = {0};
									_tmp64_ = field_entry;
									_tmp65_ = gee_map_entry_get_value (_tmp64_);
									_tmp66_ = _tmp65_;
									_tmp67_ = (*((ContactsContactEditorField*) _tmp66_)).rows;
									contacts_contact_editor_get_value_from_birthday (self, _tmp67_, &_tmp68_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp68_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label5) ? _tmp42_label5 : (_tmp42_label5 = g_quark_from_static_string ("notes")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp69_ = NULL;
									gconstpointer _tmp70_ = NULL;
									ContactsContactEditorField* _tmp71_ = NULL;
									GeeHashMap* _tmp72_ = NULL;
									GValue _tmp73_ = {0};
									_tmp69_ = field_entry;
									_tmp70_ = gee_map_entry_get_value (_tmp69_);
									_tmp71_ = _tmp70_;
									_tmp72_ = (*((ContactsContactEditorField*) _tmp71_)).rows;
									contacts_contact_editor_get_value_from_notes (self, _tmp72_, &_tmp73_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp73_;
									break;
								}
							}
						} else if (_tmp43_ == ((0 != _tmp42_label6) ? _tmp42_label6 : (_tmp42_label6 = g_quark_from_static_string ("postal-addresses")))) {
							switch (0) {
								default:
								{
									GeeMapEntry* _tmp74_ = NULL;
									gconstpointer _tmp75_ = NULL;
									ContactsContactEditorField* _tmp76_ = NULL;
									GeeHashMap* _tmp77_ = NULL;
									GValue _tmp78_ = {0};
									_tmp74_ = field_entry;
									_tmp75_ = gee_map_entry_get_value (_tmp74_);
									_tmp76_ = _tmp75_;
									_tmp77_ = (*((ContactsContactEditorField*) _tmp76_)).rows;
									contacts_contact_editor_get_value_from_addresses (self, _tmp77_, &_tmp78_);
									G_IS_VALUE (&p.value) ? (g_value_unset (&p.value), NULL) : NULL;
									p.value = _tmp78_;
									break;
								}
							}
						}
						_tmp79_ = props_set;
						_tmp80_ = field_entry;
						_tmp81_ = gee_map_entry_get_key (_tmp80_);
						_tmp82_ = _tmp81_;
						_tmp83_ = p;
						gee_abstract_map_set ((GeeAbstractMap*) _tmp79_, (const gchar*) _tmp82_, &_tmp83_);
						contacts_contact_editor_property_data_destroy (&p);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	result = props_set;
	return result;
}


gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self) {
	gboolean result = FALSE;
	GtkEntry* name_entry = NULL;
	GtkWidget* _tmp0_ = NULL;
	GtkEntry* _tmp1_ = NULL;
	gconstpointer _tmp2_ = NULL;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, 0);
	_tmp1_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp0_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp0_) : NULL);
	name_entry = _tmp1_;
	_tmp2_ = g_object_get_data ((GObject*) name_entry, "changed");
	result = (gboolean) ((gintptr) _tmp2_);
	_g_object_unref0 (name_entry);
	return result;
}


void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result) {
	GValue v = {0};
	GValue _tmp0_ = {0};
	GtkEntry* name_entry = NULL;
	GtkWidget* _tmp1_ = NULL;
	GtkEntry* _tmp2_ = NULL;
	const gchar* _tmp3_ = NULL;
	g_return_if_fail (self != NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	v = _tmp0_;
	_tmp1_ = gtk_grid_get_child_at ((GtkGrid*) self, 1, 0);
	_tmp2_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp1_, GTK_TYPE_ENTRY) ? ((GtkEntry*) _tmp1_) : NULL);
	name_entry = _tmp2_;
	_tmp3_ = gtk_entry_get_text (name_entry);
	g_value_set_string (&v, _tmp3_);
	*result = v;
	_g_object_unref0 (name_entry);
	return;
}


void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type) {
	FolksPersona* persona = NULL;
	FolksPersona* _tmp0_ = NULL;
	gint next_idx = 0;
	gint _tmp44_ = 0;
	gint _tmp45_ = 0;
	gint _tmp48_ = 0;
	gint _tmp49_ = 0;
	FolksPersona* _tmp50_ = NULL;
	const gchar* _tmp51_ = NULL;
	const gchar* _tmp52_ = NULL;
	gint _tmp53_ = 0;
	g_return_if_fail (self != NULL);
	g_return_if_fail (prop_name != NULL);
	_tmp0_ = p;
	if (_tmp0_ == NULL) {
		ContactsContact* _tmp1_ = NULL;
		ContactsFakePersona* _tmp2_ = NULL;
		GeeHashMap* _tmp3_ = NULL;
		FolksPersona* _tmp4_ = NULL;
		GeeHashMap* _tmp5_ = NULL;
		GeeHashMap* _tmp6_ = NULL;
		_tmp1_ = self->priv->contact;
		_tmp2_ = contacts_fake_persona_new (_tmp1_);
		_g_object_unref0 (persona);
		persona = (FolksPersona*) _tmp2_;
		_tmp3_ = self->priv->writable_personas;
		_tmp4_ = persona;
		_tmp5_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
		_tmp6_ = _tmp5_;
		gee_abstract_map_set ((GeeAbstractMap*) _tmp3_, _tmp4_, _tmp6_);
		_g_object_unref0 (_tmp6_);
	} else {
		FolksPersona* _tmp7_ = NULL;
		FolksPersona* _tmp8_ = NULL;
		_tmp7_ = p;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (persona);
		persona = _tmp8_;
	}
	next_idx = 0;
	{
		GeeIterator* _fields_it = NULL;
		GeeHashMap* _tmp9_ = NULL;
		GeeCollection* _tmp10_ = NULL;
		GeeCollection* _tmp11_ = NULL;
		GeeCollection* _tmp12_ = NULL;
		GeeIterator* _tmp13_ = NULL;
		GeeIterator* _tmp14_ = NULL;
		_tmp9_ = self->priv->writable_personas;
		_tmp10_ = gee_abstract_map_get_values ((GeeMap*) _tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = _tmp11_;
		_tmp13_ = gee_iterable_iterator ((GeeIterable*) _tmp12_);
		_tmp14_ = _tmp13_;
		_g_object_unref0 (_tmp12_);
		_fields_it = _tmp14_;
		while (TRUE) {
			GeeIterator* _tmp15_ = NULL;
			gboolean _tmp16_ = FALSE;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp17_ = NULL;
			gpointer _tmp18_ = NULL;
			GeeHashMap* _tmp19_ = NULL;
			const gchar* _tmp20_ = NULL;
			gboolean _tmp21_ = FALSE;
			_tmp15_ = _fields_it;
			_tmp16_ = gee_iterator_next (_tmp15_);
			if (!_tmp16_) {
				break;
			}
			_tmp17_ = _fields_it;
			_tmp18_ = gee_iterator_get (_tmp17_);
			fields = (GeeHashMap*) _tmp18_;
			_tmp19_ = fields;
			_tmp20_ = prop_name;
			_tmp21_ = gee_abstract_map_has_key ((GeeAbstractMap*) _tmp19_, _tmp20_);
			if (_tmp21_) {
				{
					GeeIterator* _idx_it = NULL;
					GeeHashMap* _tmp22_ = NULL;
					const gchar* _tmp23_ = NULL;
					gpointer _tmp24_ = NULL;
					ContactsContactEditorField* _tmp25_ = NULL;
					GeeHashMap* _tmp26_ = NULL;
					GeeSet* _tmp27_ = NULL;
					GeeSet* _tmp28_ = NULL;
					GeeSet* _tmp29_ = NULL;
					GeeIterator* _tmp30_ = NULL;
					GeeIterator* _tmp31_ = NULL;
					_tmp22_ = fields;
					_tmp23_ = prop_name;
					_tmp24_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp22_, _tmp23_);
					_tmp25_ = (ContactsContactEditorField*) _tmp24_;
					_tmp26_ = (*_tmp25_).rows;
					_tmp27_ = gee_abstract_map_get_keys ((GeeMap*) _tmp26_);
					_tmp28_ = _tmp27_;
					_tmp29_ = _tmp28_;
					_tmp30_ = gee_iterable_iterator ((GeeIterable*) _tmp29_);
					_tmp31_ = _tmp30_;
					_g_object_unref0 (_tmp29_);
					_contacts_contact_editor_field_free0 (_tmp25_);
					_idx_it = _tmp31_;
					while (TRUE) {
						GeeIterator* _tmp32_ = NULL;
						gboolean _tmp33_ = FALSE;
						gint idx = 0;
						GeeIterator* _tmp34_ = NULL;
						gpointer _tmp35_ = NULL;
						gint _tmp36_ = 0;
						gint _tmp37_ = 0;
						_tmp32_ = _idx_it;
						_tmp33_ = gee_iterator_next (_tmp32_);
						if (!_tmp33_) {
							break;
						}
						_tmp34_ = _idx_it;
						_tmp35_ = gee_iterator_get (_tmp34_);
						idx = (gint) ((gintptr) _tmp35_);
						_tmp36_ = idx;
						_tmp37_ = self->priv->last_row;
						if (_tmp36_ < _tmp37_) {
							gint _tmp38_ = 0;
							gint _tmp39_ = 0;
							gint _tmp40_ = 0;
							gint _tmp43_ = 0;
							_tmp39_ = idx;
							_tmp40_ = next_idx;
							if (_tmp39_ > _tmp40_) {
								gint _tmp41_ = 0;
								_tmp41_ = idx;
								_tmp38_ = _tmp41_;
							} else {
								gint _tmp42_ = 0;
								_tmp42_ = next_idx;
								_tmp38_ = _tmp42_;
							}
							_tmp43_ = _tmp38_;
							next_idx = _tmp43_;
						}
					}
					_g_object_unref0 (_idx_it);
				}
				_g_object_unref0 (fields);
				break;
			}
			_g_object_unref0 (fields);
		}
		_g_object_unref0 (_fields_it);
	}
	_tmp45_ = next_idx;
	if (_tmp45_ == 0) {
		gint _tmp46_ = 0;
		_tmp46_ = self->priv->last_row;
		_tmp44_ = _tmp46_;
	} else {
		gint _tmp47_ = 0;
		_tmp47_ = next_idx;
		_tmp44_ = _tmp47_;
	}
	_tmp48_ = _tmp44_;
	next_idx = _tmp48_ + 1;
	_tmp49_ = next_idx;
	contacts_contact_editor_insert_row_at (self, _tmp49_);
	_tmp50_ = persona;
	_tmp51_ = prop_name;
	_tmp52_ = type;
	contacts_contact_editor_add_edit_row (self, _tmp50_, _tmp51_, &next_idx, TRUE, _tmp52_);
	_tmp53_ = self->priv->last_row;
	self->priv->last_row = _tmp53_ + 1;
	gtk_widget_show_all ((GtkWidget*) self);
	_g_object_unref0 (persona);
}


void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest) {
	FolksPersona* _tmp0_ = NULL;
	FolksPersona* _tmp1_ = NULL;
	GValue _tmp2_ = {0};
	GValue _tmp3_ = {0};
	_tmp0_ = (*self).persona;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 ((*dest).persona);
	(*dest).persona = _tmp1_;
	_tmp2_ = (*self).value;
	if (G_IS_VALUE (&_tmp2_)) {
		g_value_init (&_tmp3_, G_VALUE_TYPE (&_tmp2_));
		g_value_copy (&_tmp2_, &_tmp3_);
	} else {
		_tmp3_ = _tmp2_;
	}
	G_IS_VALUE (&(*dest).value) ? (g_value_unset (&(*dest).value), NULL) : NULL;
	(*dest).value = _tmp3_;
}


void contacts_contact_editor_property_data_destroy (ContactsContactEditorPropertyData* self) {
	_g_object_unref0 ((*self).persona);
	G_IS_VALUE (&(*self).value) ? (g_value_unset (&(*self).value), NULL) : NULL;
}


ContactsContactEditorPropertyData* contacts_contact_editor_property_data_dup (const ContactsContactEditorPropertyData* self) {
	ContactsContactEditorPropertyData* dup;
	dup = g_new0 (ContactsContactEditorPropertyData, 1);
	contacts_contact_editor_property_data_copy (self, dup);
	return dup;
}


void contacts_contact_editor_property_data_free (ContactsContactEditorPropertyData* self) {
	contacts_contact_editor_property_data_destroy (self);
	g_free (self);
}


GType contacts_contact_editor_property_data_get_type (void) {
	static volatile gsize contacts_contact_editor_property_data_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_property_data_type_id__volatile)) {
		GType contacts_contact_editor_property_data_type_id;
		contacts_contact_editor_property_data_type_id = g_boxed_type_register_static ("ContactsContactEditorPropertyData", (GBoxedCopyFunc) contacts_contact_editor_property_data_dup, (GBoxedFreeFunc) contacts_contact_editor_property_data_free);
		g_once_init_leave (&contacts_contact_editor_property_data_type_id__volatile, contacts_contact_editor_property_data_type_id);
	}
	return contacts_contact_editor_property_data_type_id__volatile;
}


static void contacts_contact_editor_row_data_copy (const ContactsContactEditorRowData* self, ContactsContactEditorRowData* dest) {
	FolksAbstractFieldDetails* _tmp0_ = NULL;
	FolksAbstractFieldDetails* _tmp1_ = NULL;
	_tmp0_ = (*self).details;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 ((*dest).details);
	(*dest).details = _tmp1_;
}


static void contacts_contact_editor_row_data_destroy (ContactsContactEditorRowData* self) {
	_g_object_unref0 ((*self).details);
}


static ContactsContactEditorRowData* contacts_contact_editor_row_data_dup (const ContactsContactEditorRowData* self) {
	ContactsContactEditorRowData* dup;
	dup = g_new0 (ContactsContactEditorRowData, 1);
	contacts_contact_editor_row_data_copy (self, dup);
	return dup;
}


static void contacts_contact_editor_row_data_free (ContactsContactEditorRowData* self) {
	contacts_contact_editor_row_data_destroy (self);
	g_free (self);
}


static GType contacts_contact_editor_row_data_get_type (void) {
	static volatile gsize contacts_contact_editor_row_data_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_row_data_type_id__volatile)) {
		GType contacts_contact_editor_row_data_type_id;
		contacts_contact_editor_row_data_type_id = g_boxed_type_register_static ("ContactsContactEditorRowData", (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, (GBoxedFreeFunc) contacts_contact_editor_row_data_free);
		g_once_init_leave (&contacts_contact_editor_row_data_type_id__volatile, contacts_contact_editor_row_data_type_id);
	}
	return contacts_contact_editor_row_data_type_id__volatile;
}


static void contacts_contact_editor_field_copy (const ContactsContactEditorField* self, ContactsContactEditorField* dest) {
	gboolean _tmp0_ = FALSE;
	GeeHashMap* _tmp1_ = NULL;
	GeeHashMap* _tmp2_ = NULL;
	_tmp0_ = (*self).changed;
	(*dest).changed = _tmp0_;
	_tmp1_ = (*self).rows;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_g_object_unref0 ((*dest).rows);
	(*dest).rows = _tmp2_;
}


static void contacts_contact_editor_field_destroy (ContactsContactEditorField* self) {
	_g_object_unref0 ((*self).rows);
}


static ContactsContactEditorField* contacts_contact_editor_field_dup (const ContactsContactEditorField* self) {
	ContactsContactEditorField* dup;
	dup = g_new0 (ContactsContactEditorField, 1);
	contacts_contact_editor_field_copy (self, dup);
	return dup;
}


static void contacts_contact_editor_field_free (ContactsContactEditorField* self) {
	contacts_contact_editor_field_destroy (self);
	g_free (self);
}


static GType contacts_contact_editor_field_get_type (void) {
	static volatile gsize contacts_contact_editor_field_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_field_type_id__volatile)) {
		GType contacts_contact_editor_field_type_id;
		contacts_contact_editor_field_type_id = g_boxed_type_register_static ("ContactsContactEditorField", (GBoxedCopyFunc) contacts_contact_editor_field_dup, (GBoxedFreeFunc) contacts_contact_editor_field_free);
		g_once_init_leave (&contacts_contact_editor_field_type_id__volatile, contacts_contact_editor_field_type_id);
	}
	return contacts_contact_editor_field_type_id__volatile;
}


static void contacts_contact_editor_class_init (ContactsContactEditorClass * klass) {
	contacts_contact_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactEditorPrivate));
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_editor_finalize;
}


static void contacts_contact_editor_instance_init (ContactsContactEditor * self) {
	self->priv = CONTACTS_CONTACT_EDITOR_GET_PRIVATE (self);
}


static void contacts_contact_editor_finalize (GObject* obj) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	_g_object_unref0 (self->priv->contact);
	_g_object_unref0 (self->priv->writable_personas);
	G_OBJECT_CLASS (contacts_contact_editor_parent_class)->finalize (obj);
}


GType contacts_contact_editor_get_type (void) {
	static volatile gsize contacts_contact_editor_type_id__volatile = 0;
	if (g_once_init_enter (&contacts_contact_editor_type_id__volatile)) {
		static const GTypeInfo g_define_type_info = { sizeof (ContactsContactEditorClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) contacts_contact_editor_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (ContactsContactEditor), 0, (GInstanceInitFunc) contacts_contact_editor_instance_init, NULL };
		GType contacts_contact_editor_type_id;
		contacts_contact_editor_type_id = g_type_register_static (GTK_TYPE_GRID, "ContactsContactEditor", &g_define_type_info, 0);
		g_once_init_leave (&contacts_contact_editor_type_id__volatile, contacts_contact_editor_type_id);
	}
	return contacts_contact_editor_type_id__volatile;
}


static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	if ((array != NULL) && (destroy_func != NULL)) {
		int i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}


static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}



