/* contacts-contact-editor.c generated by valac 0.36.4, 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 <glib/gi18n-lib.h>
#include <gee.h>
#include <float.h>
#include <math.h>
#include <atk/atk.h>
#include <gio/gio.h>
#include <gdk-pixbuf/gdk-pixbuf.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))
enum  {
	CONTACTS_ADDRESS_EDITOR_CHANGED_SIGNAL,
	CONTACTS_ADDRESS_EDITOR_LAST_SIGNAL
};
static guint contacts_address_editor_signals[CONTACTS_ADDRESS_EDITOR_LAST_SIGNAL] = {0};

#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_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;

#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 _Block19Data Block19Data;
typedef struct _Block20Data Block20Data;
typedef struct _Block21Data Block21Data;
typedef struct _Block22Data Block22Data;
typedef struct _Block23Data Block23Data;
#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 TYPE_CENTER (center_get_type ())
#define CENTER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TYPE_CENTER, Center))
#define CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TYPE_CENTER, CenterClass))
#define IS_CENTER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TYPE_CENTER))
#define IS_CENTER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TYPE_CENTER))
#define CENTER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TYPE_CENTER, CenterClass))

typedef struct _Center Center;
typedef struct _CenterClass CenterClass;
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;

#define CONTACTS_TYPE_AVATAR_DIALOG (contacts_avatar_dialog_get_type ())
#define CONTACTS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialog))
#define CONTACTS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))
#define CONTACTS_IS_AVATAR_DIALOG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_IS_AVATAR_DIALOG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_AVATAR_DIALOG))
#define CONTACTS_AVATAR_DIALOG_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_AVATAR_DIALOG, ContactsAvatarDialogClass))

typedef struct _ContactsAvatarDialog ContactsAvatarDialog;
typedef struct _ContactsAvatarDialogClass ContactsAvatarDialogClass;

#define CONTACTS_TYPE_WINDOW (contacts_window_get_type ())
#define CONTACTS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CONTACTS_TYPE_WINDOW, ContactsWindow))
#define CONTACTS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CONTACTS_TYPE_WINDOW, ContactsWindowClass))
#define CONTACTS_IS_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CONTACTS_TYPE_WINDOW))
#define CONTACTS_IS_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CONTACTS_TYPE_WINDOW))
#define CONTACTS_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CONTACTS_TYPE_WINDOW, ContactsWindowClass))

typedef struct _ContactsWindow ContactsWindow;
typedef struct _ContactsWindowClass ContactsWindowClass;

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

struct _ContactsAddressEditorClass {
	GtkBoxClass parent_class;
};

struct _ContactsContactEditor {
	GtkGrid parent_instance;
	ContactsContactEditorPrivate * priv;
	GtkButton* linked_button;
	GtkButton* remove_button;
};

struct _ContactsContactEditorClass {
	GtkGridClass parent_class;
};

struct _ContactsContactEditorRowData {
	FolksAbstractFieldDetails* details;
};

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

struct _ContactsContactEditorPrivate {
	ContactsContact* contact;
	GtkGrid* container_grid;
	GtkWidget* focus_widget;
	GtkEntry* name_entry;
	ContactsContactFrame* avatar_frame;
	GtkScrolledWindow* main_sw;
	GtkMenuButton* add_detail_button;
	gint last_row;
	GeeHashMap* writable_personas;
	gboolean _has_birthday_row;
	gboolean _has_nickname_row;
	gboolean _has_notes_row;
};

struct _Block19Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsTypeCombo* combo;
	GtkEntry* value_entry;
	GtkButton* delete_button;
};

struct _Block20Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkEntry* value_entry;
	GtkButton* delete_button;
};

struct _Block21Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkScrolledWindow* sw;
	GtkButton* delete_button;
};

typedef void (*ContactsContactEditorAdjustingDateFn) (void* user_data);
struct _Block22Data {
	int _ref_count_;
	ContactsContactEditor* self;
	GtkSpinButton* day_spin;
	GtkComboBoxText* month_combo;
	GtkSpinButton* year_spin;
	GtkButton* delete_button;
	ContactsContactEditorAdjustingDateFn fn;
	gpointer fn_target;
	GDestroyNotify fn_target_destroy_notify;
};

struct _Block23Data {
	int _ref_count_;
	ContactsContactEditor* self;
	ContactsTypeCombo* combo;
	ContactsAddressEditor* value_address;
	GtkButton* delete_button;
};

struct _ContactsContact {
	GObject parent_instance;
	ContactsContactPrivate * priv;
	ContactsStore* store;
	gboolean is_main;
	FolksIndividual* individual;
	FolksPersona* fake_persona;
};

struct _ContactsContactClass {
	GObjectClass parent_class;
};

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


static gpointer contacts_address_editor_parent_class = NULL;
extern gchar** contacts_address_editor_postal_element_names;
extern gint contacts_address_editor_postal_element_names_length1;
gchar** contacts_address_editor_postal_element_names = NULL;
gint contacts_address_editor_postal_element_names_length1 = 0;
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;
GType contacts_contact_frame_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,
	CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW,
	CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW,
	CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW
};
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 Block19Data* block19_data_ref (Block19Data* _data19_);
static void block19_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);
ContactsTypeSet* contacts_typeset_get_email (void);
ContactsTypeSet* contacts_typeset_get_phone (void);
static void __lambda40_ (Block19Data* _data19_);
static gint contacts_contact_editor_get_current_row (ContactsContactEditor* self, GtkWidget* child);
static void ___lambda40__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda41_ (Block19Data* _data19_);
static void ___lambda41__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda42_ (Block19Data* _data19_);
static void ___lambda42__gtk_button_clicked (GtkButton* _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 Block20Data* block20_data_ref (Block20Data* _data20_);
static void block20_data_unref (void * _userdata_);
static void __lambda43_ (Block20Data* _data20_);
static void ___lambda43__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda44_ (Block20Data* _data20_);
static void ___lambda44__gtk_button_clicked (GtkButton* _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 Block21Data* block21_data_ref (Block21Data* _data21_);
static void block21_data_unref (void * _userdata_);
static void __lambda45_ (Block21Data* _data21_);
static void ___lambda45__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self);
static void __lambda46_ (Block21Data* _data21_);
static void contacts_contact_editor_set_has_notes_row (ContactsContactEditor* self, gboolean value);
static void ___lambda46__gtk_button_clicked (GtkButton* _sender, gpointer self);
static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row);
static Block22Data* block22_data_ref (Block22Data* _data22_);
static void block22_data_unref (void * _userdata_);
static void __lambda47_ (Block22Data* _data22_);
static gboolean _vala_int_array_contains (gint * stack, int stack_length, gint needle);
static void ___lambda47__contacts_contact_editor_adjusting_date_fn (gpointer self);
static void __lambda48_ (Block22Data* _data22_);
static void ___lambda48__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda49_ (Block22Data* _data22_);
static void ___lambda49__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self);
static void __lambda50_ (Block22Data* _data22_);
static void ___lambda50__gtk_editable_changed (GtkEditable* _sender, gpointer self);
static void __lambda51_ (Block22Data* _data22_);
static void contacts_contact_editor_set_has_birthday_row (ContactsContactEditor* self, gboolean value);
static void ___lambda51__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 Block23Data* block23_data_ref (Block23Data* _data23_);
static void block23_data_unref (void * _userdata_);
static void __lambda52_ (Block23Data* _data23_);
static void ___lambda52__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self);
static void __lambda53_ (Block23Data* _data23_);
static void ___lambda53__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self);
static void __lambda54_ (Block23Data* _data23_);
static void ___lambda54__gtk_button_clicked (GtkButton* _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);
GeeArrayList* contacts_contact_sort_fields (GType t_type, GBoxedCopyFunc t_dup_func, GDestroyNotify t_destroy_func, GeeCollection* fields);
gboolean contacts_is_set (const gchar* str);
static void contacts_contact_editor_set_has_nickname_row (ContactsContactEditor* self, gboolean value);
static void ____lambda55_ (ContactsContactEditor* self);
static void _____lambda55__gtk_button_clicked (GtkButton* _sender, gpointer self);
ContactsTypeSet* contacts_typeset_get_general (void);
static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx);
static void contacts_contact_editor_size_allocate_cb (ContactsContactEditor* self, GtkAllocation* alloc);
ContactsContactEditor* contacts_contact_editor_new (GSimpleActionGroup* editor_actions);
ContactsContactEditor* contacts_contact_editor_construct (GType object_type, GSimpleActionGroup* editor_actions);
GType center_get_type (void) G_GNUC_CONST;
Center* center_new (void);
Center* center_construct (GType object_type);
void center_set_max_width (Center* self, gint value);
void center_set_xalign (Center* self, gdouble value);
static void _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self);
void contacts_contact_editor_edit (ContactsContactEditor* self, ContactsContact* c);
gboolean contacts_contact_can_remove_personas (ContactsContact* self);
GType contacts_store_get_type (void) G_GNUC_CONST;
static void contacts_contact_editor_create_avatar_frame (ContactsContactEditor* self);
static void contacts_contact_editor_create_name_entry (ContactsContactEditor* 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_set_new_contact (ContactsContactEditor* self);
void contacts_contact_editor_add_new_row_for_property (ContactsContactEditor* self, FolksPersona* p, const gchar* prop_name, const gchar* type);
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);
FolksPersona* contacts_contact_find_persona_from_uid (ContactsContact* self, const gchar* uid);
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;
#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 contacts_contact_editor_on_avatar_frame_clicked (ContactsContactEditor* self);
static void _contacts_contact_editor_on_avatar_frame_clicked_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 ___lambda64_ (ContactsContactEditor* self, GtkWidget* w);
void contacts_contact_frame_set_image (ContactsContactFrame* self, FolksAvatarDetails* details, ContactsContact* contact);
static void ____lambda64__gtk_callback (GtkWidget* widget, gpointer self);
GType contacts_avatar_dialog_get_type (void) G_GNUC_CONST;
GType contacts_window_get_type (void) G_GNUC_CONST;
ContactsAvatarDialog* contacts_avatar_dialog_new (ContactsWindow* main_window, ContactsContact* contact);
ContactsAvatarDialog* contacts_avatar_dialog_construct (GType object_type, ContactsWindow* main_window, ContactsContact* contact);
static void __lambda63_ (ContactsContactEditor* self, GIcon* icon);
void contacts_contact_frame_set_pixbuf (ContactsContactFrame* self, GdkPixbuf* a_pixbuf);
static void ___lambda63__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self);
gboolean contacts_contact_editor_avatar_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_avatar_value (ContactsContactEditor* self, GValue* result);
const gchar* contacts_contact_get_display_name (ContactsContact* self);
static void __lambda65_ (ContactsContactEditor* self);
static void ___lambda65__gtk_editable_changed (GtkEditable* _sender, gpointer self);
gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self);
void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result);
gboolean contacts_contact_editor_get_has_birthday_row (ContactsContactEditor* self);
gboolean contacts_contact_editor_get_has_nickname_row (ContactsContactEditor* self);
gboolean contacts_contact_editor_get_has_notes_row (ContactsContactEditor* self);
static void contacts_contact_editor_finalize (GObject * obj);
static void _vala_contacts_contact_editor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
static void _vala_contacts_contact_editor_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
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 gint _vala_array_length (gpointer array);

const gchar* CONTACTS_ADDRESS_EDITOR_postal_element_props[7] = {"street", "extension", "locality", "region", "postal_code", "po_box", "country"};
static const gchar* CONTACTS_CONTACT_EDITOR_DEFAULT_PROPS_NEW_CONTACT[3] = {"email-addresses.personal", "phone-numbers.cell", "postal-addresses.home"};

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


static void _____lambda39_ (ContactsAddressEditor* self) {
	g_signal_emit (self, contacts_address_editor_signals[CONTACTS_ADDRESS_EDITOR_CHANGED_SIGNAL], 0);
}


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


ContactsAddressEditor* contacts_address_editor_construct (GType object_type, FolksPostalAddressFieldDetails* _details) {
	ContactsAddressEditor * self = NULL;
	FolksPostalAddressFieldDetails* _tmp0_;
	FolksPostalAddressFieldDetails* _tmp1_;
	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) {
				gint _tmp4_;
				gchar* postal_part = NULL;
				FolksPostalAddressFieldDetails* _tmp5_;
				gconstpointer _tmp6_;
				FolksPostalAddress* _tmp7_;
				gint _tmp8_;
				const gchar* _tmp9_;
				gint _tmp10_;
				GtkEntry* _tmp11_;
				GtkEntry* _tmp12_;
				gint _tmp13_;
				GtkEntry* _tmp14_;
				gint _tmp15_;
				GtkEntry* _tmp16_;
				gchar** _tmp17_;
				gint _tmp17__length1;
				gint _tmp18_;
				const gchar* _tmp19_;
				const gchar* _tmp20_;
				gint _tmp24_;
				GtkEntry* _tmp25_;
				GtkStyleContext* _tmp26_;
				gint _tmp27_;
				GtkEntry* _tmp28_;
				GtkStyleContext* _tmp29_;
				gint _tmp30_;
				GtkEntry* _tmp31_;
				gint _tmp32_;
				GtkEntry* _tmp33_;
				if (!_tmp2_) {
					gint _tmp3_;
					_tmp3_ = i;
					i = _tmp3_ + 1;
				}
				_tmp2_ = FALSE;
				_tmp4_ = i;
				if (!(_tmp4_ < 7)) {
					break;
				}
				_tmp5_ = self->details;
				_tmp6_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp5_);
				_tmp7_ = _tmp6_;
				_tmp8_ = i;
				_tmp9_ = CONTACTS_ADDRESS_EDITOR_postal_element_props[_tmp8_];
				g_object_get ((GObject*) ((FolksPostalAddress*) _tmp7_), _tmp9_, &postal_part, NULL);
				_tmp10_ = i;
				_tmp11_ = (GtkEntry*) gtk_entry_new ();
				g_object_ref_sink (_tmp11_);
				_g_object_unref0 (self->entries[_tmp10_]);
				self->entries[_tmp10_] = _tmp11_;
				_tmp12_ = self->entries[_tmp10_];
				_tmp13_ = i;
				_tmp14_ = self->entries[_tmp13_];
				gtk_widget_set_hexpand ((GtkWidget*) _tmp14_, TRUE);
				_tmp15_ = i;
				_tmp16_ = self->entries[_tmp15_];
				_tmp17_ = contacts_address_editor_postal_element_names;
				_tmp17__length1 = contacts_address_editor_postal_element_names_length1;
				_tmp18_ = i;
				_tmp19_ = _tmp17_[_tmp18_];
				g_object_set ((GObject*) _tmp16_, "placeholder-text", _tmp19_, NULL);
				_tmp20_ = postal_part;
				if (_tmp20_ != NULL) {
					gint _tmp21_;
					GtkEntry* _tmp22_;
					const gchar* _tmp23_;
					_tmp21_ = i;
					_tmp22_ = self->entries[_tmp21_];
					_tmp23_ = postal_part;
					gtk_entry_set_text (_tmp22_, _tmp23_);
				}
				_tmp24_ = i;
				_tmp25_ = self->entries[_tmp24_];
				_tmp26_ = gtk_widget_get_style_context ((GtkWidget*) _tmp25_);
				gtk_style_context_add_class (_tmp26_, "contacts-entry");
				_tmp27_ = i;
				_tmp28_ = self->entries[_tmp27_];
				_tmp29_ = gtk_widget_get_style_context ((GtkWidget*) _tmp28_);
				gtk_style_context_add_class (_tmp29_, "contacts-postal-entry");
				_tmp30_ = i;
				_tmp31_ = self->entries[_tmp30_];
				gtk_container_add ((GtkContainer*) self, (GtkWidget*) _tmp31_);
				_tmp32_ = i;
				_tmp33_ = self->entries[_tmp32_];
				g_signal_connect_object ((GtkEditable*) _tmp33_, "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_;
	self = (ContactsAddressEditor*) base;
	_tmp0_ = self->entries[0];
	gtk_widget_grab_focus ((GtkWidget*) _tmp0_);
}


static void contacts_address_editor_class_init (ContactsAddressEditorClass * klass) {
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	gchar** _tmp7_;
	contacts_address_editor_parent_class = g_type_class_peek_parent (klass);
	((GtkWidgetClass *) klass)->grab_focus = (void (*) (GtkWidget *)) contacts_address_editor_real_grab_focus;
	G_OBJECT_CLASS (klass)->finalize = contacts_address_editor_finalize;
	contacts_address_editor_signals[CONTACTS_ADDRESS_EDITOR_CHANGED_SIGNAL] = g_signal_new ("changed", CONTACTS_TYPE_ADDRESS_EDITOR, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	_tmp0_ = g_strdup (_ ("Street"));
	_tmp1_ = g_strdup (_ ("Extension"));
	_tmp2_ = g_strdup (_ ("City"));
	_tmp3_ = g_strdup (_ ("State/Province"));
	_tmp4_ = g_strdup (_ ("Zip/Postal Code"));
	_tmp5_ = g_strdup (_ ("PO box"));
	_tmp6_ = g_strdup (_ ("Country"));
	_tmp7_ = g_new0 (gchar*, 7 + 1);
	_tmp7_[0] = _tmp0_;
	_tmp7_[1] = _tmp1_;
	_tmp7_[2] = _tmp2_;
	_tmp7_[3] = _tmp3_;
	_tmp7_[4] = _tmp4_;
	_tmp7_[5] = _tmp5_;
	_tmp7_[6] = _tmp6_;
	contacts_address_editor_postal_element_names = _tmp7_;
	contacts_address_editor_postal_element_names_length1 = 7;
}


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_box_get_type (), "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_;
	GValue new_value = {0};
	GeeHashSet* _tmp41_;
	GType _tmp42_;
	GValue _tmp43_ = {0};
	GeeHashSet* _tmp44_;
	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, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			ContactsTypeCombo* _tmp16_;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp17_;
			GeeMapEntry* _tmp18_;
			gconstpointer _tmp19_;
			gint _tmp20_;
			GtkWidget* _tmp21_;
			GtkEntry* _tmp22_;
			GtkEntry* _tmp23_;
			const gchar* _tmp24_;
			ContactsTypeCombo* _tmp25_;
			GeeMapEntry* _tmp26_;
			gconstpointer _tmp27_;
			ContactsContactEditorRowData* _tmp28_;
			FolksAbstractFieldDetails* _tmp29_;
			FolksEmailFieldDetails* details = NULL;
			GtkEntry* _tmp30_;
			const gchar* _tmp31_;
			GeeMapEntry* _tmp32_;
			gconstpointer _tmp33_;
			ContactsContactEditorRowData* _tmp34_;
			FolksAbstractFieldDetails* _tmp35_;
			GeeMultiMap* _tmp36_;
			GeeMultiMap* _tmp37_;
			FolksEmailFieldDetails* _tmp38_;
			GeeHashSet* _tmp39_;
			FolksEmailFieldDetails* _tmp40_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp21_) : NULL);
			entry = _tmp22_;
			_tmp23_ = entry;
			_tmp24_ = gtk_entry_get_text (_tmp23_);
			if (g_strcmp0 (_tmp24_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (combo);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp25_ = combo;
			_tmp26_ = row_entry;
			_tmp27_ = gee_map_entry_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = (*((ContactsContactEditorRowData*) _tmp28_)).details;
			contacts_typecombo_update_details (_tmp25_, _tmp29_);
			_tmp30_ = entry;
			_tmp31_ = gtk_entry_get_text (_tmp30_);
			_tmp32_ = row_entry;
			_tmp33_ = gee_map_entry_get_value (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = (*((ContactsContactEditorRowData*) _tmp34_)).details;
			_tmp36_ = folks_abstract_field_details_get_parameters (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_email_field_details_new (_tmp31_, _tmp37_);
			details = _tmp38_;
			_tmp39_ = new_details;
			_tmp40_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp41_ = new_details;
	_tmp42_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp41_);
	g_value_init (&_tmp43_, _tmp42_);
	new_value = _tmp43_;
	_tmp44_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp44_);
	*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_;
	GValue new_value = {0};
	GeeHashSet* _tmp41_;
	GType _tmp42_;
	GValue _tmp43_ = {0};
	GeeHashSet* _tmp44_;
	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, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			ContactsTypeCombo* _tmp16_;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp17_;
			GeeMapEntry* _tmp18_;
			gconstpointer _tmp19_;
			gint _tmp20_;
			GtkWidget* _tmp21_;
			GtkEntry* _tmp22_;
			GtkEntry* _tmp23_;
			const gchar* _tmp24_;
			ContactsTypeCombo* _tmp25_;
			GeeMapEntry* _tmp26_;
			gconstpointer _tmp27_;
			ContactsContactEditorRowData* _tmp28_;
			FolksAbstractFieldDetails* _tmp29_;
			FolksPhoneFieldDetails* details = NULL;
			GtkEntry* _tmp30_;
			const gchar* _tmp31_;
			GeeMapEntry* _tmp32_;
			gconstpointer _tmp33_;
			ContactsContactEditorRowData* _tmp34_;
			FolksAbstractFieldDetails* _tmp35_;
			GeeMultiMap* _tmp36_;
			GeeMultiMap* _tmp37_;
			FolksPhoneFieldDetails* _tmp38_;
			GeeHashSet* _tmp39_;
			FolksPhoneFieldDetails* _tmp40_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp21_) : NULL);
			entry = _tmp22_;
			_tmp23_ = entry;
			_tmp24_ = gtk_entry_get_text (_tmp23_);
			if (g_strcmp0 (_tmp24_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (combo);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp25_ = combo;
			_tmp26_ = row_entry;
			_tmp27_ = gee_map_entry_get_value (_tmp26_);
			_tmp28_ = _tmp27_;
			_tmp29_ = (*((ContactsContactEditorRowData*) _tmp28_)).details;
			contacts_typecombo_update_details (_tmp25_, _tmp29_);
			_tmp30_ = entry;
			_tmp31_ = gtk_entry_get_text (_tmp30_);
			_tmp32_ = row_entry;
			_tmp33_ = gee_map_entry_get_value (_tmp32_);
			_tmp34_ = _tmp33_;
			_tmp35_ = (*((ContactsContactEditorRowData*) _tmp34_)).details;
			_tmp36_ = folks_abstract_field_details_get_parameters (_tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_phone_field_details_new (_tmp31_, _tmp37_);
			details = _tmp38_;
			_tmp39_ = new_details;
			_tmp40_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp39_, _tmp40_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (combo);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp41_ = new_details;
	_tmp42_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp41_);
	g_value_init (&_tmp43_, _tmp42_);
	new_value = _tmp43_;
	_tmp44_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp44_);
	*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_;
	GValue new_value = {0};
	GeeHashSet* _tmp30_;
	GType _tmp31_;
	GValue _tmp32_ = {0};
	GeeHashSet* _tmp33_;
	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, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			GtkEntry* _tmp16_;
			GtkEntry* _tmp17_;
			const gchar* _tmp18_;
			FolksUrlFieldDetails* details = NULL;
			GtkEntry* _tmp19_;
			const gchar* _tmp20_;
			GeeMapEntry* _tmp21_;
			gconstpointer _tmp22_;
			ContactsContactEditorRowData* _tmp23_;
			FolksAbstractFieldDetails* _tmp24_;
			GeeMultiMap* _tmp25_;
			GeeMultiMap* _tmp26_;
			FolksUrlFieldDetails* _tmp27_;
			GeeHashSet* _tmp28_;
			FolksUrlFieldDetails* _tmp29_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp15_) : NULL);
			entry = _tmp16_;
			_tmp17_ = entry;
			_tmp18_ = gtk_entry_get_text (_tmp17_);
			if (g_strcmp0 (_tmp18_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp19_ = entry;
			_tmp20_ = gtk_entry_get_text (_tmp19_);
			_tmp21_ = row_entry;
			_tmp22_ = gee_map_entry_get_value (_tmp21_);
			_tmp23_ = _tmp22_;
			_tmp24_ = (*((ContactsContactEditorRowData*) _tmp23_)).details;
			_tmp25_ = folks_abstract_field_details_get_parameters (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = folks_url_field_details_new (_tmp20_, _tmp26_);
			details = _tmp27_;
			_tmp28_ = new_details;
			_tmp29_ = details;
			gee_abstract_collection_add ((GeeAbstractCollection*) _tmp28_, _tmp29_);
			_g_object_unref0 (details);
			_g_object_unref0 (entry);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp30_ = new_details;
	_tmp31_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp30_);
	g_value_init (&_tmp32_, _tmp31_);
	new_value = _tmp32_;
	_tmp33_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp33_);
	*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_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GtkEntry* entry = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			GtkEntry* _tmp16_;
			GtkEntry* _tmp17_;
			const gchar* _tmp18_;
			GtkEntry* _tmp19_;
			const gchar* _tmp20_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_entry_get_type ()) ? ((GtkEntry*) _tmp15_) : NULL);
			entry = _tmp16_;
			_tmp17_ = entry;
			_tmp18_ = gtk_entry_get_text (_tmp17_);
			if (g_strcmp0 (_tmp18_, "") == 0) {
				_g_object_unref0 (entry);
				_g_object_unref0 (row_entry);
				continue;
			}
			_tmp19_ = entry;
			_tmp20_ = gtk_entry_get_text (_tmp19_);
			g_value_set_string (&new_value, _tmp20_);
			_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_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GtkGrid* box = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			GtkGrid* _tmp16_;
			GtkSpinButton* day_spin = NULL;
			GtkGrid* _tmp17_;
			GtkWidget* _tmp18_;
			GtkSpinButton* _tmp19_;
			GtkComboBoxText* combo = NULL;
			GtkGrid* _tmp20_;
			GtkWidget* _tmp21_;
			GtkComboBoxText* _tmp22_;
			GtkSpinButton* year_spin = NULL;
			GtkGrid* _tmp23_;
			GtkWidget* _tmp24_;
			GtkSpinButton* _tmp25_;
			GDateTime* bday = NULL;
			GtkSpinButton* _tmp26_;
			gint _tmp27_;
			GtkComboBoxText* _tmp28_;
			gint _tmp29_;
			GtkSpinButton* _tmp30_;
			gint _tmp31_;
			GDateTime* _tmp32_;
			GDateTime* _tmp33_;
			GDateTime* _tmp34_;
			GDateTime* _tmp35_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_grid_get_type ()) ? ((GtkGrid*) _tmp15_) : NULL);
			box = _tmp16_;
			_tmp17_ = box;
			_tmp18_ = gtk_grid_get_child_at (_tmp17_, 0, 0);
			_tmp19_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp18_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp18_) : NULL);
			day_spin = _tmp19_;
			_tmp20_ = box;
			_tmp21_ = gtk_grid_get_child_at (_tmp20_, 1, 0);
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, gtk_combo_box_text_get_type ()) ? ((GtkComboBoxText*) _tmp21_) : NULL);
			combo = _tmp22_;
			_tmp23_ = box;
			_tmp24_ = gtk_grid_get_child_at (_tmp23_, 2, 0);
			_tmp25_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp24_, gtk_spin_button_get_type ()) ? ((GtkSpinButton*) _tmp24_) : NULL);
			year_spin = _tmp25_;
			_tmp26_ = year_spin;
			_tmp27_ = gtk_spin_button_get_value_as_int (_tmp26_);
			_tmp28_ = combo;
			_tmp29_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp28_);
			_tmp30_ = day_spin;
			_tmp31_ = gtk_spin_button_get_value_as_int (_tmp30_);
			_tmp32_ = g_date_time_new_local (_tmp27_, _tmp29_ + 1, _tmp31_, 0, 0, (gdouble) 0);
			bday = _tmp32_;
			_tmp33_ = bday;
			_tmp34_ = g_date_time_to_utc (_tmp33_);
			_g_date_time_unref0 (bday);
			bday = _tmp34_;
			_tmp35_ = bday;
			g_value_set_boxed (&new_value, _tmp35_);
			_g_date_time_unref0 (bday);
			_g_object_unref0 (year_spin);
			_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_;
	GValue new_value = {0};
	GeeHashSet* _tmp40_;
	GType _tmp41_;
	GValue _tmp42_ = {0};
	GeeHashSet* _tmp43_;
	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, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			GtkTextView* text = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			GtkWidget* _tmp16_;
			GtkTextView* _tmp17_;
			GtkTextIter start = {0};
			GtkTextIter end = {0};
			GtkTextView* _tmp18_;
			GtkTextBuffer* _tmp19_;
			GtkTextIter _tmp20_ = {0};
			GtkTextView* _tmp21_;
			GtkTextBuffer* _tmp22_;
			GtkTextIter _tmp23_ = {0};
			gchar* value = NULL;
			GtkTextView* _tmp24_;
			GtkTextBuffer* _tmp25_;
			GtkTextIter _tmp26_;
			GtkTextIter _tmp27_;
			gchar* _tmp28_;
			const gchar* _tmp29_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 1, (gint) ((gintptr) _tmp14_));
			_tmp16_ = gtk_bin_get_child (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, gtk_bin_get_type ()) ? ((GtkBin*) _tmp15_) : NULL);
			_tmp17_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp16_, gtk_text_view_get_type ()) ? ((GtkTextView*) _tmp16_) : NULL);
			text = _tmp17_;
			_tmp18_ = text;
			_tmp19_ = gtk_text_view_get_buffer (_tmp18_);
			gtk_text_buffer_get_start_iter (_tmp19_, &_tmp20_);
			start = _tmp20_;
			_tmp21_ = text;
			_tmp22_ = gtk_text_view_get_buffer (_tmp21_);
			gtk_text_buffer_get_end_iter (_tmp22_, &_tmp23_);
			end = _tmp23_;
			_tmp24_ = text;
			_tmp25_ = gtk_text_view_get_buffer (_tmp24_);
			_tmp26_ = start;
			_tmp27_ = end;
			_tmp28_ = gtk_text_buffer_get_text (_tmp25_, &_tmp26_, &_tmp27_, TRUE);
			value = _tmp28_;
			_tmp29_ = value;
			if (g_strcmp0 (_tmp29_, "") != 0) {
				FolksNoteFieldDetails* details = NULL;
				const gchar* _tmp30_;
				GeeMapEntry* _tmp31_;
				gconstpointer _tmp32_;
				ContactsContactEditorRowData* _tmp33_;
				FolksAbstractFieldDetails* _tmp34_;
				GeeMultiMap* _tmp35_;
				GeeMultiMap* _tmp36_;
				FolksNoteFieldDetails* _tmp37_;
				GeeHashSet* _tmp38_;
				FolksNoteFieldDetails* _tmp39_;
				_tmp30_ = value;
				_tmp31_ = row_entry;
				_tmp32_ = gee_map_entry_get_value (_tmp31_);
				_tmp33_ = _tmp32_;
				_tmp34_ = (*((ContactsContactEditorRowData*) _tmp33_)).details;
				_tmp35_ = folks_abstract_field_details_get_parameters (_tmp34_);
				_tmp36_ = _tmp35_;
				_tmp37_ = folks_note_field_details_new (_tmp30_, _tmp36_, NULL);
				details = _tmp37_;
				_tmp38_ = new_details;
				_tmp39_ = details;
				gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp39_);
				_g_object_unref0 (details);
			}
			_g_free0 (value);
			_g_object_unref0 (text);
			_g_object_unref0 (row_entry);
		}
		_g_object_unref0 (_row_entry_it);
	}
	_tmp40_ = new_details;
	_tmp41_ = G_TYPE_FROM_INSTANCE ((GObject*) _tmp40_);
	g_value_init (&_tmp42_, _tmp41_);
	new_value = _tmp42_;
	_tmp43_ = new_details;
	g_value_set_object (&new_value, (GObject*) _tmp43_);
	*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_;
	GValue new_value = {0};
	GeeHashSet* _tmp102_;
	GType _tmp103_;
	GValue _tmp104_ = {0};
	GeeHashSet* _tmp105_;
	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, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL);
	new_details = _tmp0_;
	{
		GeeIterator* _row_entry_it = NULL;
		GeeHashMap* _tmp1_;
		GeeSet* _tmp2_;
		GeeSet* _tmp3_;
		GeeSet* _tmp4_;
		GeeIterator* _tmp5_;
		GeeIterator* _tmp6_;
		_tmp1_ = rows;
		_tmp2_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
			gboolean _tmp8_;
			GeeMapEntry* row_entry = NULL;
			GeeIterator* _tmp9_;
			gpointer _tmp10_;
			ContactsTypeCombo* combo = NULL;
			GtkGrid* _tmp11_;
			GeeMapEntry* _tmp12_;
			gconstpointer _tmp13_;
			gint _tmp14_;
			GtkWidget* _tmp15_;
			ContactsTypeCombo* _tmp16_;
			ContactsAddressEditor* addr_editor = NULL;
			GtkGrid* _tmp17_;
			GeeMapEntry* _tmp18_;
			gconstpointer _tmp19_;
			gint _tmp20_;
			GtkWidget* _tmp21_;
			ContactsAddressEditor* _tmp22_;
			ContactsTypeCombo* _tmp23_;
			GeeMapEntry* _tmp24_;
			gconstpointer _tmp25_;
			ContactsContactEditorRowData* _tmp26_;
			FolksAbstractFieldDetails* _tmp27_;
			FolksPostalAddress* new_value = NULL;
			ContactsAddressEditor* _tmp28_;
			FolksPostalAddressFieldDetails* _tmp29_;
			gconstpointer _tmp30_;
			FolksPostalAddress* _tmp31_;
			const gchar* _tmp32_;
			const gchar* _tmp33_;
			ContactsAddressEditor* _tmp34_;
			FolksPostalAddressFieldDetails* _tmp35_;
			gconstpointer _tmp36_;
			FolksPostalAddress* _tmp37_;
			const gchar* _tmp38_;
			const gchar* _tmp39_;
			ContactsAddressEditor* _tmp40_;
			FolksPostalAddressFieldDetails* _tmp41_;
			gconstpointer _tmp42_;
			FolksPostalAddress* _tmp43_;
			const gchar* _tmp44_;
			const gchar* _tmp45_;
			ContactsAddressEditor* _tmp46_;
			FolksPostalAddressFieldDetails* _tmp47_;
			gconstpointer _tmp48_;
			FolksPostalAddress* _tmp49_;
			const gchar* _tmp50_;
			const gchar* _tmp51_;
			ContactsAddressEditor* _tmp52_;
			FolksPostalAddressFieldDetails* _tmp53_;
			gconstpointer _tmp54_;
			FolksPostalAddress* _tmp55_;
			const gchar* _tmp56_;
			const gchar* _tmp57_;
			ContactsAddressEditor* _tmp58_;
			FolksPostalAddressFieldDetails* _tmp59_;
			gconstpointer _tmp60_;
			FolksPostalAddress* _tmp61_;
			const gchar* _tmp62_;
			const gchar* _tmp63_;
			ContactsAddressEditor* _tmp64_;
			FolksPostalAddressFieldDetails* _tmp65_;
			gconstpointer _tmp66_;
			FolksPostalAddress* _tmp67_;
			const gchar* _tmp68_;
			const gchar* _tmp69_;
			ContactsAddressEditor* _tmp70_;
			FolksPostalAddressFieldDetails* _tmp71_;
			gconstpointer _tmp72_;
			FolksPostalAddress* _tmp73_;
			const gchar* _tmp74_;
			const gchar* _tmp75_;
			ContactsAddressEditor* _tmp76_;
			FolksPostalAddressFieldDetails* _tmp77_;
			const gchar* _tmp78_;
			const gchar* _tmp79_;
			FolksPostalAddress* _tmp80_;
			FolksPostalAddressFieldDetails* details = NULL;
			FolksPostalAddress* _tmp92_;
			GeeMapEntry* _tmp93_;
			gconstpointer _tmp94_;
			ContactsContactEditorRowData* _tmp95_;
			FolksAbstractFieldDetails* _tmp96_;
			GeeMultiMap* _tmp97_;
			GeeMultiMap* _tmp98_;
			FolksPostalAddressFieldDetails* _tmp99_;
			GeeHashSet* _tmp100_;
			FolksPostalAddressFieldDetails* _tmp101_;
			_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_ = self->priv->container_grid;
			_tmp12_ = row_entry;
			_tmp13_ = gee_map_entry_get_key (_tmp12_);
			_tmp14_ = _tmp13_;
			_tmp15_ = gtk_grid_get_child_at (_tmp11_, 0, (gint) ((gintptr) _tmp14_));
			_tmp16_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp15_, CONTACTS_TYPE_TYPECOMBO) ? ((ContactsTypeCombo*) _tmp15_) : NULL);
			combo = _tmp16_;
			_tmp17_ = self->priv->container_grid;
			_tmp18_ = row_entry;
			_tmp19_ = gee_map_entry_get_key (_tmp18_);
			_tmp20_ = _tmp19_;
			_tmp21_ = gtk_grid_get_child_at (_tmp17_, 1, (gint) ((gintptr) _tmp20_));
			_tmp22_ = _g_object_ref0 (G_TYPE_CHECK_INSTANCE_TYPE (_tmp21_, CONTACTS_TYPE_ADDRESS_EDITOR) ? ((ContactsAddressEditor*) _tmp21_) : NULL);
			addr_editor = _tmp22_;
			_tmp23_ = combo;
			_tmp24_ = row_entry;
			_tmp25_ = gee_map_entry_get_value (_tmp24_);
			_tmp26_ = _tmp25_;
			_tmp27_ = (*((ContactsContactEditorRowData*) _tmp26_)).details;
			contacts_typecombo_update_details (_tmp23_, _tmp27_);
			_tmp28_ = addr_editor;
			_tmp29_ = _tmp28_->details;
			_tmp30_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp29_);
			_tmp31_ = _tmp30_;
			_tmp32_ = folks_postal_address_get_po_box ((FolksPostalAddress*) _tmp31_);
			_tmp33_ = _tmp32_;
			_tmp34_ = addr_editor;
			_tmp35_ = _tmp34_->details;
			_tmp36_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp35_);
			_tmp37_ = _tmp36_;
			_tmp38_ = folks_postal_address_get_extension ((FolksPostalAddress*) _tmp37_);
			_tmp39_ = _tmp38_;
			_tmp40_ = addr_editor;
			_tmp41_ = _tmp40_->details;
			_tmp42_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp41_);
			_tmp43_ = _tmp42_;
			_tmp44_ = folks_postal_address_get_street ((FolksPostalAddress*) _tmp43_);
			_tmp45_ = _tmp44_;
			_tmp46_ = addr_editor;
			_tmp47_ = _tmp46_->details;
			_tmp48_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp47_);
			_tmp49_ = _tmp48_;
			_tmp50_ = folks_postal_address_get_locality ((FolksPostalAddress*) _tmp49_);
			_tmp51_ = _tmp50_;
			_tmp52_ = addr_editor;
			_tmp53_ = _tmp52_->details;
			_tmp54_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp53_);
			_tmp55_ = _tmp54_;
			_tmp56_ = folks_postal_address_get_region ((FolksPostalAddress*) _tmp55_);
			_tmp57_ = _tmp56_;
			_tmp58_ = addr_editor;
			_tmp59_ = _tmp58_->details;
			_tmp60_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp59_);
			_tmp61_ = _tmp60_;
			_tmp62_ = folks_postal_address_get_postal_code ((FolksPostalAddress*) _tmp61_);
			_tmp63_ = _tmp62_;
			_tmp64_ = addr_editor;
			_tmp65_ = _tmp64_->details;
			_tmp66_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp65_);
			_tmp67_ = _tmp66_;
			_tmp68_ = folks_postal_address_get_country ((FolksPostalAddress*) _tmp67_);
			_tmp69_ = _tmp68_;
			_tmp70_ = addr_editor;
			_tmp71_ = _tmp70_->details;
			_tmp72_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp71_);
			_tmp73_ = _tmp72_;
			_tmp74_ = folks_postal_address_get_address_format ((FolksPostalAddress*) _tmp73_);
			_tmp75_ = _tmp74_;
			_tmp76_ = addr_editor;
			_tmp77_ = _tmp76_->details;
			_tmp78_ = folks_abstract_field_details_get_id ((FolksAbstractFieldDetails*) _tmp77_);
			_tmp79_ = _tmp78_;
			_tmp80_ = folks_postal_address_new (_tmp33_, _tmp39_, _tmp45_, _tmp51_, _tmp57_, _tmp63_, _tmp69_, _tmp75_, _tmp79_);
			new_value = _tmp80_;
			{
				gint i = 0;
				i = 0;
				{
					gboolean _tmp81_ = FALSE;
					_tmp81_ = TRUE;
					while (TRUE) {
						gint _tmp83_;
						ContactsAddressEditor* _tmp84_;
						FolksPostalAddress* _tmp85_;
						gint _tmp86_;
						const gchar* _tmp87_;
						ContactsAddressEditor* _tmp88_;
						gint _tmp89_;
						GtkEntry* _tmp90_;
						const gchar* _tmp91_;
						if (!_tmp81_) {
							gint _tmp82_;
							_tmp82_ = i;
							i = _tmp82_ + 1;
						}
						_tmp81_ = FALSE;
						_tmp83_ = i;
						_tmp84_ = addr_editor;
						if (!(_tmp83_ < 7)) {
							break;
						}
						_tmp85_ = new_value;
						_tmp86_ = i;
						_tmp87_ = CONTACTS_ADDRESS_EDITOR_postal_element_props[_tmp86_];
						_tmp88_ = addr_editor;
						_tmp89_ = i;
						_tmp90_ = _tmp88_->entries[_tmp89_];
						_tmp91_ = gtk_entry_get_text (_tmp90_);
						g_object_set ((GObject*) _tmp85_, _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_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			_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_;
				GeeSet* _tmp11_;
				GeeSet* _tmp12_;
				GeeSet* _tmp13_;
				GeeIterator* _tmp14_;
				GeeIterator* _tmp15_;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_entry_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_;
					gboolean _tmp17_;
					GeeMapEntry* entry = NULL;
					GeeIterator* _tmp18_;
					gpointer _tmp19_;
					GeeMapEntry* _tmp20_;
					gconstpointer _tmp21_;
					ContactsContactEditorField* _tmp22_;
					GeeHashMap* _tmp23_;
					GeeSet* _tmp24_;
					GeeSet* _tmp25_;
					GeeSet* _tmp26_;
					gint _tmp27_;
					gboolean _tmp28_;
					gboolean _tmp29_;
					_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 ((GeeAbstractMap*) _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_;
						gconstpointer _tmp31_;
						ContactsContactEditorField* _tmp32_;
						gboolean _tmp33_;
						GeeMapEntry* _tmp34_;
						gconstpointer _tmp35_;
						ContactsContactEditorField* _tmp36_;
						_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_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp0_);
		_tmp2_ = _tmp1_;
		_tmp3_ = _tmp2_;
		_tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
		_tmp5_ = _tmp4_;
		_g_object_unref0 (_tmp3_);
		_fields_it = _tmp5_;
		while (TRUE) {
			GeeIterator* _tmp6_;
			gboolean _tmp7_;
			GeeHashMap* fields = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			_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_;
				GeeSet* _tmp11_;
				GeeSet* _tmp12_;
				GeeSet* _tmp13_;
				GeeIterator* _tmp14_;
				GeeIterator* _tmp15_;
				_tmp10_ = fields;
				_tmp11_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _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_;
					gboolean _tmp17_;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp18_;
					gpointer _tmp19_;
					_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_;
						gconstpointer _tmp21_;
						ContactsContactEditorField* _tmp22_;
						GeeHashMap* _tmp23_;
						GeeSet* _tmp24_;
						GeeSet* _tmp25_;
						GeeSet* _tmp26_;
						GeeIterator* _tmp27_;
						GeeIterator* _tmp28_;
						_tmp20_ = field_entry;
						_tmp21_ = gee_map_entry_get_value (_tmp20_);
						_tmp22_ = _tmp21_;
						_tmp23_ = (*((ContactsContactEditorField*) _tmp22_)).rows;
						_tmp24_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp23_);
						_tmp25_ = _tmp24_;
						_tmp26_ = _tmp25_;
						_tmp27_ = gee_iterable_iterator ((GeeIterable*) _tmp26_);
						_tmp28_ = _tmp27_;
						_g_object_unref0 (_tmp26_);
						_idx_it = _tmp28_;
						while (TRUE) {
							GeeIterator* _tmp29_;
							gboolean _tmp30_;
							gint idx = 0;
							GeeIterator* _tmp31_;
							gpointer _tmp32_;
							gint _tmp33_;
							gint _tmp34_;
							_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;
								GtkGrid* _tmp35_;
								gint _tmp36_;
								GtkWidget* _tmp37_;
								GtkWidget* _tmp38_;
								GtkWidget* _tmp39_;
								GtkGrid* _tmp40_;
								gint _tmp41_;
								GtkWidget* _tmp42_;
								GtkWidget* _tmp43_;
								GtkWidget* _tmp44_;
								GtkGrid* _tmp45_;
								gint _tmp46_;
								GtkWidget* _tmp47_;
								GtkWidget* _tmp48_;
								GtkWidget* _tmp49_;
								GeeMapEntry* _tmp50_;
								gconstpointer _tmp51_;
								ContactsContactEditorField* _tmp52_;
								GeeMapEntry* _tmp53_;
								gconstpointer _tmp54_;
								ContactsContactEditorField* _tmp55_;
								GeeHashMap* _tmp56_;
								gint _tmp57_;
								_tmp35_ = self->priv->container_grid;
								_tmp36_ = row;
								_tmp37_ = gtk_grid_get_child_at (_tmp35_, 0, _tmp36_);
								_tmp38_ = _g_object_ref0 (_tmp37_);
								child = _tmp38_;
								_tmp39_ = child;
								gtk_widget_destroy (_tmp39_);
								_tmp40_ = self->priv->container_grid;
								_tmp41_ = row;
								_tmp42_ = gtk_grid_get_child_at (_tmp40_, 1, _tmp41_);
								_tmp43_ = _g_object_ref0 (_tmp42_);
								_g_object_unref0 (child);
								child = _tmp43_;
								_tmp44_ = child;
								gtk_widget_destroy (_tmp44_);
								_tmp45_ = self->priv->container_grid;
								_tmp46_ = row;
								_tmp47_ = gtk_grid_get_child_at (_tmp45_, 3, _tmp46_);
								_tmp48_ = _g_object_ref0 (_tmp47_);
								_g_object_unref0 (child);
								child = _tmp48_;
								_tmp49_ = child;
								gtk_widget_destroy (_tmp49_);
								_tmp50_ = field_entry;
								_tmp51_ = gee_map_entry_get_value (_tmp50_);
								_tmp52_ = _tmp51_;
								(*((ContactsContactEditorField*) _tmp52_)).changed = TRUE;
								_tmp53_ = field_entry;
								_tmp54_ = gee_map_entry_get_value (_tmp53_);
								_tmp55_ = _tmp54_;
								_tmp56_ = (*((ContactsContactEditorField*) _tmp55_)).rows;
								_tmp57_ = row;
								gee_abstract_map_unset ((GeeAbstractMap*) _tmp56_, (gpointer) ((gintptr) _tmp57_), 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 Block19Data* block19_data_ref (Block19Data* _data19_) {
	g_atomic_int_inc (&_data19_->_ref_count_);
	return _data19_;
}


static void block19_data_unref (void * _userdata_) {
	Block19Data* _data19_;
	_data19_ = (Block19Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data19_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data19_->self;
		_g_object_unref0 (_data19_->delete_button);
		_g_object_unref0 (_data19_->value_entry);
		_g_object_unref0 (_data19_->combo);
		_g_object_unref0 (self);
		g_slice_free (Block19Data, _data19_);
	}
}


static void __lambda40_ (Block19Data* _data19_) {
	ContactsContactEditor* self;
	ContactsTypeCombo* _tmp0_;
	gint _tmp1_;
	self = _data19_->self;
	_tmp0_ = _data19_->combo;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


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


static void __lambda41_ (Block19Data* _data19_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_;
	gint _tmp1_;
	self = _data19_->self;
	_tmp0_ = _data19_->value_entry;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


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


static void __lambda42_ (Block19Data* _data19_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_;
	gint _tmp1_;
	self = _data19_->self;
	_tmp0_ = _data19_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
}


static void ___lambda42__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda42_ (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) {
	Block19Data* _data19_;
	ContactsTypeSet* _tmp0_;
	ContactsTypeCombo* _tmp1_;
	ContactsTypeCombo* _tmp2_;
	ContactsTypeCombo* _tmp3_;
	FolksAbstractFieldDetails* _tmp4_;
	const gchar* _tmp5_;
	ContactsTypeCombo* _tmp8_;
	GtkGrid* _tmp9_;
	ContactsTypeCombo* _tmp10_;
	gint _tmp11_;
	GtkEntry* _tmp12_;
	GtkEntry* _tmp13_;
	const gchar* _tmp14_;
	GtkEntry* _tmp15_;
	GtkGrid* _tmp16_;
	GtkEntry* _tmp17_;
	gint _tmp18_;
	ContactsTypeSet* _tmp19_;
	ContactsTypeSet* _tmp20_;
	ContactsTypeSet* _tmp21_;
	GtkButton* _tmp27_;
	GtkButton* _tmp28_;
	AtkObject* _tmp29_;
	GtkGrid* _tmp30_;
	GtkButton* _tmp31_;
	gint _tmp32_;
	ContactsTypeCombo* _tmp33_;
	GtkEntry* _tmp34_;
	GtkButton* _tmp35_;
	const gchar* _tmp36_;
	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);
	_data19_ = g_slice_new0 (Block19Data);
	_data19_->_ref_count_ = 1;
	_data19_->self = g_object_ref (self);
	_tmp0_ = type_set;
	_tmp1_ = contacts_typecombo_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_data19_->combo = _tmp1_;
	_tmp2_ = _data19_->combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = _data19_->combo;
	_tmp4_ = details;
	contacts_typecombo_set_active (_tmp3_, _tmp4_);
	_tmp5_ = type;
	if (_tmp5_ != NULL) {
		ContactsTypeCombo* _tmp6_;
		const gchar* _tmp7_;
		_tmp6_ = _data19_->combo;
		_tmp7_ = type;
		contacts_typecombo_set_to (_tmp6_, _tmp7_);
	}
	_tmp8_ = _data19_->combo;
	gtk_widget_set_valign ((GtkWidget*) _tmp8_, GTK_ALIGN_CENTER);
	_tmp9_ = self->priv->container_grid;
	_tmp10_ = _data19_->combo;
	_tmp11_ = row;
	gtk_grid_attach (_tmp9_, (GtkWidget*) _tmp10_, 0, _tmp11_, 1, 1);
	_tmp12_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp12_);
	_data19_->value_entry = _tmp12_;
	_tmp13_ = _data19_->value_entry;
	_tmp14_ = value;
	gtk_entry_set_text (_tmp13_, _tmp14_);
	_tmp15_ = _data19_->value_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp15_, TRUE);
	_tmp16_ = self->priv->container_grid;
	_tmp17_ = _data19_->value_entry;
	_tmp18_ = row;
	gtk_grid_attach (_tmp16_, (GtkWidget*) _tmp17_, 1, _tmp18_, 1, 1);
	_tmp19_ = type_set;
	_tmp20_ = contacts_typeset_get_email ();
	_tmp21_ = _tmp20_;
	if (_tmp19_ == _tmp21_) {
		GtkEntry* _tmp22_;
		_tmp22_ = _data19_->value_entry;
		gtk_entry_set_placeholder_text (_tmp22_, _ ("Add email"));
	} else {
		ContactsTypeSet* _tmp23_;
		ContactsTypeSet* _tmp24_;
		ContactsTypeSet* _tmp25_;
		_tmp23_ = type_set;
		_tmp24_ = contacts_typeset_get_phone ();
		_tmp25_ = _tmp24_;
		if (_tmp23_ == _tmp25_) {
			GtkEntry* _tmp26_;
			_tmp26_ = _data19_->value_entry;
			gtk_entry_set_placeholder_text (_tmp26_, _ ("Add number"));
		}
	}
	_tmp27_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp27_);
	_data19_->delete_button = _tmp27_;
	_tmp28_ = _data19_->delete_button;
	_tmp29_ = gtk_widget_get_accessible ((GtkWidget*) _tmp28_);
	atk_object_set_name (_tmp29_, _ ("Delete field"));
	_tmp30_ = self->priv->container_grid;
	_tmp31_ = _data19_->delete_button;
	_tmp32_ = row;
	gtk_grid_attach (_tmp30_, (GtkWidget*) _tmp31_, 3, _tmp32_, 1, 1);
	_tmp33_ = _data19_->combo;
	g_signal_connect_data (_tmp33_, "changed", (GCallback) ___lambda40__contacts_typecombo_changed, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	_tmp34_ = _data19_->value_entry;
	g_signal_connect_data ((GtkEditable*) _tmp34_, "changed", (GCallback) ___lambda41__gtk_editable_changed, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	_tmp35_ = _data19_->delete_button;
	g_signal_connect_data (_tmp35_, "clicked", (GCallback) ___lambda42__gtk_button_clicked, block19_data_ref (_data19_), (GClosureNotify) block19_data_unref, 0);
	_tmp36_ = value;
	if (g_strcmp0 (_tmp36_, "") == 0) {
		GtkEntry* _tmp37_;
		_tmp37_ = _data19_->value_entry;
		self->priv->focus_widget = (GtkWidget*) _tmp37_;
	}
	block19_data_unref (_data19_);
	_data19_ = NULL;
}


static Block20Data* block20_data_ref (Block20Data* _data20_) {
	g_atomic_int_inc (&_data20_->_ref_count_);
	return _data20_;
}


static void block20_data_unref (void * _userdata_) {
	Block20Data* _data20_;
	_data20_ = (Block20Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data20_->_ref_count_)) {
		ContactsContactEditor* self;
		self = _data20_->self;
		_g_object_unref0 (_data20_->delete_button);
		_g_object_unref0 (_data20_->value_entry);
		_g_object_unref0 (self);
		g_slice_free (Block20Data, _data20_);
	}
}


static void __lambda43_ (Block20Data* _data20_) {
	ContactsContactEditor* self;
	GtkEntry* _tmp0_;
	gint _tmp1_;
	self = _data20_->self;
	_tmp0_ = _data20_->value_entry;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda43__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda43_ (self);
}


static void __lambda44_ (Block20Data* _data20_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_;
	gint _tmp1_;
	self = _data20_->self;
	_tmp0_ = _data20_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
}


static void ___lambda44__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda44_ (self);
}


static void contacts_contact_editor_attach_row_with_entry_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block20Data* _data20_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkGrid* _tmp5_;
	GtkLabel* _tmp6_;
	gint _tmp7_;
	GtkEntry* _tmp8_;
	GtkEntry* _tmp9_;
	const gchar* _tmp10_;
	GtkEntry* _tmp11_;
	GtkGrid* _tmp12_;
	GtkEntry* _tmp13_;
	gint _tmp14_;
	GtkButton* _tmp15_;
	GtkButton* _tmp16_;
	AtkObject* _tmp17_;
	GtkGrid* _tmp18_;
	GtkButton* _tmp19_;
	gint _tmp20_;
	GtkEntry* _tmp21_;
	GtkButton* _tmp22_;
	const gchar* _tmp23_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data20_ = g_slice_new0 (Block20Data);
	_data20_->_ref_count_ = 1;
	_data20_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	_tmp2_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = title_label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 6);
	_tmp5_ = self->priv->container_grid;
	_tmp6_ = title_label;
	_tmp7_ = row;
	gtk_grid_attach (_tmp5_, (GtkWidget*) _tmp6_, 0, _tmp7_, 1, 1);
	_tmp8_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp8_);
	_data20_->value_entry = _tmp8_;
	_tmp9_ = _data20_->value_entry;
	_tmp10_ = value;
	gtk_entry_set_text (_tmp9_, _tmp10_);
	_tmp11_ = _data20_->value_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp11_, TRUE);
	_tmp12_ = self->priv->container_grid;
	_tmp13_ = _data20_->value_entry;
	_tmp14_ = row;
	gtk_grid_attach (_tmp12_, (GtkWidget*) _tmp13_, 1, _tmp14_, 1, 1);
	_tmp15_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	_data20_->delete_button = _tmp15_;
	_tmp16_ = _data20_->delete_button;
	_tmp17_ = gtk_widget_get_accessible ((GtkWidget*) _tmp16_);
	atk_object_set_name (_tmp17_, _ ("Delete field"));
	_tmp18_ = self->priv->container_grid;
	_tmp19_ = _data20_->delete_button;
	_tmp20_ = row;
	gtk_grid_attach (_tmp18_, (GtkWidget*) _tmp19_, 3, _tmp20_, 1, 1);
	_tmp21_ = _data20_->value_entry;
	g_signal_connect_data ((GtkEditable*) _tmp21_, "changed", (GCallback) ___lambda43__gtk_editable_changed, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, 0);
	_tmp22_ = _data20_->delete_button;
	g_signal_connect_data (_tmp22_, "clicked", (GCallback) ___lambda44__gtk_button_clicked, block20_data_ref (_data20_), (GClosureNotify) block20_data_unref, G_CONNECT_AFTER);
	_tmp23_ = value;
	if (g_strcmp0 (_tmp23_, "") == 0) {
		GtkEntry* _tmp24_;
		_tmp24_ = _data20_->value_entry;
		self->priv->focus_widget = (GtkWidget*) _tmp24_;
	}
	_g_object_unref0 (title_label);
	block20_data_unref (_data20_);
	_data20_ = NULL;
}


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_->delete_button);
		_g_object_unref0 (_data21_->sw);
		_g_object_unref0 (self);
		g_slice_free (Block21Data, _data21_);
	}
}


static void __lambda45_ (Block21Data* _data21_) {
	ContactsContactEditor* self;
	GtkScrolledWindow* _tmp0_;
	gint _tmp1_;
	self = _data21_->self;
	_tmp0_ = _data21_->sw;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda45__gtk_text_buffer_changed (GtkTextBuffer* _sender, gpointer self) {
	__lambda45_ (self);
}


static void __lambda46_ (Block21Data* _data21_) {
	ContactsContactEditor* self;
	GtkButton* _tmp0_;
	gint _tmp1_;
	self = _data21_->self;
	_tmp0_ = _data21_->delete_button;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_remove_row (self, _tmp1_);
	contacts_contact_editor_set_has_notes_row (self, FALSE);
}


static void ___lambda46__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda46_ (self);
}


static void contacts_contact_editor_attach_row_with_text_labeled (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, const gchar* value, gint row) {
	Block21Data* _data21_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkLabel* _tmp5_;
	GtkLabel* _tmp6_;
	GtkGrid* _tmp7_;
	GtkLabel* _tmp8_;
	gint _tmp9_;
	GtkScrolledWindow* _tmp10_;
	GtkScrolledWindow* _tmp11_;
	GtkScrolledWindow* _tmp12_;
	GtkTextView* value_text = NULL;
	GtkTextView* _tmp13_;
	GtkTextView* _tmp14_;
	GtkTextBuffer* _tmp15_;
	const gchar* _tmp16_;
	GtkTextView* _tmp17_;
	GtkTextView* _tmp18_;
	GtkStyleContext* _tmp19_;
	GtkScrolledWindow* _tmp20_;
	GtkTextView* _tmp21_;
	GtkGrid* _tmp22_;
	GtkScrolledWindow* _tmp23_;
	gint _tmp24_;
	GtkButton* _tmp25_;
	GtkButton* _tmp26_;
	AtkObject* _tmp27_;
	GtkButton* _tmp28_;
	GtkGrid* _tmp29_;
	GtkButton* _tmp30_;
	gint _tmp31_;
	GtkTextView* _tmp32_;
	GtkTextBuffer* _tmp33_;
	GtkButton* _tmp34_;
	const gchar* _tmp35_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (value != NULL);
	_data21_ = g_slice_new0 (Block21Data);
	_data21_->_ref_count_ = 1;
	_data21_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	_tmp2_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = title_label;
	gtk_widget_set_valign ((GtkWidget*) _tmp4_, GTK_ALIGN_START);
	_tmp5_ = title_label;
	gtk_widget_set_margin_top ((GtkWidget*) _tmp5_, 3);
	_tmp6_ = title_label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp6_, 6);
	_tmp7_ = self->priv->container_grid;
	_tmp8_ = title_label;
	_tmp9_ = row;
	gtk_grid_attach (_tmp7_, (GtkWidget*) _tmp8_, 0, _tmp9_, 1, 1);
	_tmp10_ = (GtkScrolledWindow*) gtk_scrolled_window_new (NULL, NULL);
	g_object_ref_sink (_tmp10_);
	_data21_->sw = _tmp10_;
	_tmp11_ = _data21_->sw;
	gtk_scrolled_window_set_shadow_type (_tmp11_, GTK_SHADOW_OUT);
	_tmp12_ = _data21_->sw;
	gtk_widget_set_size_request ((GtkWidget*) _tmp12_, -1, 100);
	_tmp13_ = (GtkTextView*) gtk_text_view_new ();
	g_object_ref_sink (_tmp13_);
	value_text = _tmp13_;
	_tmp14_ = value_text;
	_tmp15_ = gtk_text_view_get_buffer (_tmp14_);
	_tmp16_ = value;
	gtk_text_buffer_set_text (_tmp15_, _tmp16_, -1);
	_tmp17_ = value_text;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp17_, TRUE);
	_tmp18_ = value_text;
	_tmp19_ = gtk_widget_get_style_context ((GtkWidget*) _tmp18_);
	gtk_style_context_add_class (_tmp19_, "contacts-entry");
	_tmp20_ = _data21_->sw;
	_tmp21_ = value_text;
	gtk_container_add ((GtkContainer*) _tmp20_, (GtkWidget*) _tmp21_);
	_tmp22_ = self->priv->container_grid;
	_tmp23_ = _data21_->sw;
	_tmp24_ = row;
	gtk_grid_attach (_tmp22_, (GtkWidget*) _tmp23_, 1, _tmp24_, 1, 1);
	_tmp25_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp25_);
	_data21_->delete_button = _tmp25_;
	_tmp26_ = _data21_->delete_button;
	_tmp27_ = gtk_widget_get_accessible ((GtkWidget*) _tmp26_);
	atk_object_set_name (_tmp27_, _ ("Delete field"));
	_tmp28_ = _data21_->delete_button;
	gtk_widget_set_valign ((GtkWidget*) _tmp28_, GTK_ALIGN_START);
	_tmp29_ = self->priv->container_grid;
	_tmp30_ = _data21_->delete_button;
	_tmp31_ = row;
	gtk_grid_attach (_tmp29_, (GtkWidget*) _tmp30_, 3, _tmp31_, 1, 1);
	_tmp32_ = value_text;
	_tmp33_ = gtk_text_view_get_buffer (_tmp32_);
	g_signal_connect_data (_tmp33_, "changed", (GCallback) ___lambda45__gtk_text_buffer_changed, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp34_ = _data21_->delete_button;
	g_signal_connect_data (_tmp34_, "clicked", (GCallback) ___lambda46__gtk_button_clicked, block21_data_ref (_data21_), (GClosureNotify) block21_data_unref, 0);
	_tmp35_ = value;
	if (g_strcmp0 (_tmp35_, "") == 0) {
		GtkTextView* _tmp36_;
		_tmp36_ = value_text;
		self->priv->focus_widget = (GtkWidget*) _tmp36_;
	}
	_g_object_unref0 (value_text);
	_g_object_unref0 (title_label);
	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;
		(_data22_->fn_target_destroy_notify == NULL) ? NULL : (_data22_->fn_target_destroy_notify (_data22_->fn_target), NULL);
		_data22_->fn = NULL;
		_data22_->fn_target = NULL;
		_data22_->fn_target_destroy_notify = NULL;
		_g_object_unref0 (_data22_->delete_button);
		_g_object_unref0 (_data22_->year_spin);
		_g_object_unref0 (_data22_->month_combo);
		_g_object_unref0 (_data22_->day_spin);
		_g_object_unref0 (self);
		g_slice_free (Block22Data, _data22_);
	}
}


static gboolean _vala_int_array_contains (gint * stack, int stack_length, gint needle) {
	int i;
	for (i = 0; i < stack_length; i++) {
		if (needle == stack[i]) {
			return TRUE;
		}
	}
	return FALSE;
}


static void __lambda47_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	gint* month_of_31 = NULL;
	gint* _tmp0_;
	gint month_of_31_length1;
	gint _month_of_31_size_;
	GtkComboBoxText* _tmp1_;
	gint _tmp2_;
	gint* _tmp3_;
	gint _tmp3__length1;
	self = _data22_->self;
	_tmp0_ = g_new0 (gint, 4);
	_tmp0_[0] = 3;
	_tmp0_[1] = 5;
	_tmp0_[2] = 8;
	_tmp0_[3] = 10;
	month_of_31 = _tmp0_;
	month_of_31_length1 = 4;
	_month_of_31_size_ = month_of_31_length1;
	_tmp1_ = _data22_->month_combo;
	_tmp2_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp1_);
	_tmp3_ = month_of_31;
	_tmp3__length1 = month_of_31_length1;
	if (_vala_int_array_contains (_tmp3_, _tmp3__length1, _tmp2_)) {
		GtkSpinButton* _tmp4_;
		_tmp4_ = _data22_->day_spin;
		gtk_spin_button_set_range (_tmp4_, (gdouble) 1, (gdouble) 30);
	} else {
		GtkComboBoxText* _tmp5_;
		gint _tmp6_;
		_tmp5_ = _data22_->month_combo;
		_tmp6_ = gtk_combo_box_get_active ((GtkComboBox*) _tmp5_);
		if (_tmp6_ == 1) {
			gboolean _tmp7_ = FALSE;
			gint _tmp8_;
			_tmp8_ = gtk_spin_button_get_value_as_int (_data22_->year_spin);
			if ((_tmp8_ % 4) == 0) {
				gint _tmp9_;
				_tmp9_ = gtk_spin_button_get_value_as_int (_data22_->year_spin);
				_tmp7_ = (_tmp9_ % 100) != 0;
			} else {
				_tmp7_ = FALSE;
			}
			if (_tmp7_) {
				GtkSpinButton* _tmp10_;
				_tmp10_ = _data22_->day_spin;
				gtk_spin_button_set_range (_tmp10_, (gdouble) 1, (gdouble) 29);
			} else {
				GtkSpinButton* _tmp11_;
				_tmp11_ = _data22_->day_spin;
				gtk_spin_button_set_range (_tmp11_, (gdouble) 1, (gdouble) 28);
			}
		}
	}
	month_of_31 = (g_free (month_of_31), NULL);
}


static void ___lambda47__contacts_contact_editor_adjusting_date_fn (gpointer self) {
	__lambda47_ (self);
}


static void __lambda48_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	GtkSpinButton* _tmp0_;
	gint _tmp1_;
	self = _data22_->self;
	_tmp0_ = _data22_->day_spin;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda48__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda48_ (self);
}


static void __lambda49_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	GtkComboBoxText* _tmp0_;
	gint _tmp1_;
	self = _data22_->self;
	_tmp0_ = _data22_->month_combo;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
	_data22_->fn (_data22_->fn_target);
}


static void ___lambda49__gtk_combo_box_changed (GtkComboBox* _sender, gpointer self) {
	__lambda49_ (self);
}


static void __lambda50_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	gint _tmp0_;
	self = _data22_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data22_->year_spin);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
	_data22_->fn (_data22_->fn_target);
}


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


static void __lambda51_ (Block22Data* _data22_) {
	ContactsContactEditor* self;
	gint _tmp0_;
	self = _data22_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data22_->delete_button);
	contacts_contact_editor_remove_row (self, _tmp0_);
	contacts_contact_editor_set_has_birthday_row (self, FALSE);
}


static void ___lambda51__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda51_ (self);
}


static void contacts_contact_editor_attach_row_for_birthday (ContactsContactEditor* self, const gchar* title, FolksAbstractFieldDetails* details, GDateTime* birthday, gint row) {
	Block22Data* _data22_;
	GtkLabel* title_label = NULL;
	const gchar* _tmp0_;
	GtkLabel* _tmp1_;
	GtkLabel* _tmp2_;
	GtkLabel* _tmp3_;
	GtkLabel* _tmp4_;
	GtkGrid* _tmp5_;
	GtkLabel* _tmp6_;
	gint _tmp7_;
	GtkGrid* box = NULL;
	GtkGrid* _tmp8_;
	GtkGrid* _tmp9_;
	GtkSpinButton* _tmp10_;
	GtkSpinButton* _tmp11_;
	GtkSpinButton* _tmp12_;
	GtkSpinButton* _tmp13_;
	GDateTime* _tmp14_;
	GDateTime* _tmp15_;
	GDateTime* _tmp16_;
	gint _tmp17_;
	GtkComboBoxText* _tmp18_;
	GDateTime* january = NULL;
	GDateTime* _tmp19_;
	GtkComboBoxText* _tmp30_;
	GDateTime* _tmp31_;
	GDateTime* _tmp32_;
	GDateTime* _tmp33_;
	gint _tmp34_;
	GtkComboBoxText* _tmp35_;
	GtkStyleContext* _tmp36_;
	GtkComboBoxText* _tmp37_;
	GtkSpinButton* _tmp38_;
	GDateTime* _tmp39_;
	GDateTime* _tmp40_;
	GDateTime* _tmp41_;
	gint _tmp42_;
	GtkGrid* _tmp43_;
	GtkSpinButton* _tmp44_;
	GtkGrid* _tmp45_;
	GtkComboBoxText* _tmp46_;
	GtkGrid* _tmp47_;
	GtkGrid* _tmp48_;
	GtkGrid* _tmp49_;
	gint _tmp50_;
	GtkButton* _tmp51_;
	AtkObject* _tmp52_;
	GtkGrid* _tmp53_;
	gint _tmp54_;
	GtkSpinButton* _tmp55_;
	GtkComboBoxText* _tmp56_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (title != NULL);
	g_return_if_fail (birthday != NULL);
	_data22_ = g_slice_new0 (Block22Data);
	_data22_->_ref_count_ = 1;
	_data22_->self = g_object_ref (self);
	_tmp0_ = title;
	_tmp1_ = (GtkLabel*) gtk_label_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	title_label = _tmp1_;
	_tmp2_ = title_label;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = title_label;
	gtk_widget_set_halign ((GtkWidget*) _tmp3_, GTK_ALIGN_START);
	_tmp4_ = title_label;
	gtk_widget_set_margin_end ((GtkWidget*) _tmp4_, 6);
	_tmp5_ = self->priv->container_grid;
	_tmp6_ = title_label;
	_tmp7_ = row;
	gtk_grid_attach (_tmp5_, (GtkWidget*) _tmp6_, 0, _tmp7_, 1, 1);
	_tmp8_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp8_);
	box = _tmp8_;
	_tmp9_ = box;
	gtk_grid_set_column_spacing (_tmp9_, (guint) 12);
	_tmp10_ = (GtkSpinButton*) gtk_spin_button_new_with_range (1.0, 31.0, 1.0);
	g_object_ref_sink (_tmp10_);
	_data22_->day_spin = _tmp10_;
	_tmp11_ = _data22_->day_spin;
	gtk_spin_button_set_digits (_tmp11_, (guint) 0);
	_tmp12_ = _data22_->day_spin;
	gtk_spin_button_set_numeric (_tmp12_, TRUE);
	_tmp13_ = _data22_->day_spin;
	_tmp14_ = birthday;
	_tmp15_ = g_date_time_to_local (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = g_date_time_get_day_of_month (_tmp16_);
	gtk_spin_button_set_value (_tmp13_, (gdouble) _tmp17_);
	_g_date_time_unref0 (_tmp16_);
	_tmp18_ = (GtkComboBoxText*) gtk_combo_box_text_new ();
	g_object_ref_sink (_tmp18_);
	_data22_->month_combo = _tmp18_;
	_tmp19_ = g_date_time_new_local (1, 1, 1, 1, 1, (gdouble) 1);
	january = _tmp19_;
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp20_ = FALSE;
			_tmp20_ = TRUE;
			while (TRUE) {
				gint _tmp22_;
				GDateTime* month = NULL;
				GDateTime* _tmp23_;
				gint _tmp24_;
				GDateTime* _tmp25_;
				GtkComboBoxText* _tmp26_;
				GDateTime* _tmp27_;
				gchar* _tmp28_;
				gchar* _tmp29_;
				if (!_tmp20_) {
					gint _tmp21_;
					_tmp21_ = i;
					i = _tmp21_ + 1;
				}
				_tmp20_ = FALSE;
				_tmp22_ = i;
				if (!(_tmp22_ < 12)) {
					break;
				}
				_tmp23_ = january;
				_tmp24_ = i;
				_tmp25_ = g_date_time_add_months (_tmp23_, _tmp24_);
				month = _tmp25_;
				_tmp26_ = _data22_->month_combo;
				_tmp27_ = month;
				_tmp28_ = g_date_time_format (_tmp27_, "%B");
				_tmp29_ = _tmp28_;
				gtk_combo_box_text_append_text (_tmp26_, _tmp29_);
				_g_free0 (_tmp29_);
				_g_date_time_unref0 (month);
			}
		}
	}
	_tmp30_ = _data22_->month_combo;
	_tmp31_ = birthday;
	_tmp32_ = g_date_time_to_local (_tmp31_);
	_tmp33_ = _tmp32_;
	_tmp34_ = g_date_time_get_month (_tmp33_);
	gtk_combo_box_set_active ((GtkComboBox*) _tmp30_, _tmp34_ - 1);
	_g_date_time_unref0 (_tmp33_);
	_tmp35_ = _data22_->month_combo;
	_tmp36_ = gtk_widget_get_style_context ((GtkWidget*) _tmp35_);
	gtk_style_context_add_class (_tmp36_, "contacts-combo");
	_tmp37_ = _data22_->month_combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp37_, TRUE);
	_tmp38_ = (GtkSpinButton*) gtk_spin_button_new_with_range ((gdouble) 1800, (gdouble) 3000, (gdouble) 1);
	g_object_ref_sink (_tmp38_);
	_data22_->year_spin = _tmp38_;
	gtk_spin_button_set_digits (_data22_->year_spin, (guint) 0);
	gtk_spin_button_set_numeric (_data22_->year_spin, TRUE);
	_tmp39_ = birthday;
	_tmp40_ = g_date_time_to_local (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = g_date_time_get_year (_tmp41_);
	gtk_spin_button_set_value (_data22_->year_spin, (gdouble) _tmp42_);
	_g_date_time_unref0 (_tmp41_);
	_tmp43_ = box;
	_tmp44_ = _data22_->day_spin;
	gtk_container_add ((GtkContainer*) _tmp43_, (GtkWidget*) _tmp44_);
	_tmp45_ = box;
	_tmp46_ = _data22_->month_combo;
	gtk_container_add ((GtkContainer*) _tmp45_, (GtkWidget*) _tmp46_);
	_tmp47_ = box;
	gtk_container_add ((GtkContainer*) _tmp47_, (GtkWidget*) _data22_->year_spin);
	_tmp48_ = self->priv->container_grid;
	_tmp49_ = box;
	_tmp50_ = row;
	gtk_grid_attach (_tmp48_, (GtkWidget*) _tmp49_, 1, _tmp50_, 1, 1);
	_tmp51_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp51_);
	_data22_->delete_button = _tmp51_;
	_tmp52_ = gtk_widget_get_accessible ((GtkWidget*) _data22_->delete_button);
	atk_object_set_name (_tmp52_, _ ("Delete field"));
	_tmp53_ = self->priv->container_grid;
	_tmp54_ = row;
	gtk_grid_attach (_tmp53_, (GtkWidget*) _data22_->delete_button, 3, _tmp54_, 1, 1);
	_data22_->fn = ___lambda47__contacts_contact_editor_adjusting_date_fn;
	_data22_->fn_target = block22_data_ref (_data22_);
	_data22_->fn_target_destroy_notify = block22_data_unref;
	_tmp55_ = _data22_->day_spin;
	g_signal_connect_data ((GtkEditable*) _tmp55_, "changed", (GCallback) ___lambda48__gtk_editable_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_tmp56_ = _data22_->month_combo;
	g_signal_connect_data ((GtkComboBox*) _tmp56_, "changed", (GCallback) ___lambda49__gtk_combo_box_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	g_signal_connect_data ((GtkEditable*) _data22_->year_spin, "changed", (GCallback) ___lambda50__gtk_editable_changed, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	g_signal_connect_data (_data22_->delete_button, "clicked", (GCallback) ___lambda51__gtk_button_clicked, block22_data_ref (_data22_), (GClosureNotify) block22_data_unref, 0);
	_g_date_time_unref0 (january);
	_g_object_unref0 (box);
	_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_->delete_button);
		_g_object_unref0 (_data23_->value_address);
		_g_object_unref0 (_data23_->combo);
		_g_object_unref0 (self);
		g_slice_free (Block23Data, _data23_);
	}
}


static void __lambda52_ (Block23Data* _data23_) {
	ContactsContactEditor* self;
	ContactsTypeCombo* _tmp0_;
	gint _tmp1_;
	self = _data23_->self;
	_tmp0_ = _data23_->combo;
	_tmp1_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _tmp0_);
	contacts_contact_editor_set_field_changed (self, _tmp1_);
}


static void ___lambda52__contacts_typecombo_changed (ContactsTypeCombo* _sender, gpointer self) {
	__lambda52_ (self);
}


static void __lambda53_ (Block23Data* _data23_) {
	ContactsContactEditor* self;
	gint _tmp0_;
	self = _data23_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data23_->value_address);
	contacts_contact_editor_set_field_changed (self, _tmp0_);
}


static void ___lambda53__contacts_address_editor_changed (ContactsAddressEditor* _sender, gpointer self) {
	__lambda53_ (self);
}


static void __lambda54_ (Block23Data* _data23_) {
	ContactsContactEditor* self;
	gint _tmp0_;
	self = _data23_->self;
	_tmp0_ = contacts_contact_editor_get_current_row (self, (GtkWidget*) _data23_->delete_button);
	contacts_contact_editor_remove_row (self, _tmp0_);
}


static void ___lambda54__gtk_button_clicked (GtkButton* _sender, gpointer self) {
	__lambda54_ (self);
}


static void contacts_contact_editor_attach_row_for_address (ContactsContactEditor* self, gint row, ContactsTypeSet* type_set, FolksPostalAddressFieldDetails* details, const gchar* type) {
	Block23Data* _data23_;
	ContactsTypeSet* _tmp0_;
	ContactsTypeCombo* _tmp1_;
	ContactsTypeCombo* _tmp2_;
	ContactsTypeCombo* _tmp3_;
	FolksPostalAddressFieldDetails* _tmp4_;
	const gchar* _tmp5_;
	GtkGrid* _tmp8_;
	ContactsTypeCombo* _tmp9_;
	gint _tmp10_;
	FolksPostalAddressFieldDetails* _tmp11_;
	ContactsAddressEditor* _tmp12_;
	GtkGrid* _tmp13_;
	gint _tmp14_;
	GtkButton* _tmp15_;
	AtkObject* _tmp16_;
	GtkGrid* _tmp17_;
	gint _tmp18_;
	ContactsTypeCombo* _tmp19_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (type_set != NULL);
	g_return_if_fail (details != NULL);
	_data23_ = g_slice_new0 (Block23Data);
	_data23_->_ref_count_ = 1;
	_data23_->self = g_object_ref (self);
	_tmp0_ = type_set;
	_tmp1_ = contacts_typecombo_new (_tmp0_);
	g_object_ref_sink (_tmp1_);
	_data23_->combo = _tmp1_;
	_tmp2_ = _data23_->combo;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp2_, FALSE);
	_tmp3_ = _data23_->combo;
	_tmp4_ = details;
	contacts_typecombo_set_active (_tmp3_, (FolksAbstractFieldDetails*) _tmp4_);
	_tmp5_ = type;
	if (_tmp5_ != NULL) {
		ContactsTypeCombo* _tmp6_;
		const gchar* _tmp7_;
		_tmp6_ = _data23_->combo;
		_tmp7_ = type;
		contacts_typecombo_set_to (_tmp6_, _tmp7_);
	}
	_tmp8_ = self->priv->container_grid;
	_tmp9_ = _data23_->combo;
	_tmp10_ = row;
	gtk_grid_attach (_tmp8_, (GtkWidget*) _tmp9_, 0, _tmp10_, 1, 1);
	_tmp11_ = details;
	_tmp12_ = contacts_address_editor_new (_tmp11_);
	g_object_ref_sink (_tmp12_);
	_data23_->value_address = _tmp12_;
	_tmp13_ = self->priv->container_grid;
	_tmp14_ = row;
	gtk_grid_attach (_tmp13_, (GtkWidget*) _data23_->value_address, 1, _tmp14_, 1, 1);
	_tmp15_ = (GtkButton*) gtk_button_new_from_icon_name ("user-trash-symbolic", GTK_ICON_SIZE_MENU);
	g_object_ref_sink (_tmp15_);
	_data23_->delete_button = _tmp15_;
	_tmp16_ = gtk_widget_get_accessible ((GtkWidget*) _data23_->delete_button);
	atk_object_set_name (_tmp16_, _ ("Delete field"));
	gtk_widget_set_valign ((GtkWidget*) _data23_->delete_button, GTK_ALIGN_START);
	_tmp17_ = self->priv->container_grid;
	_tmp18_ = row;
	gtk_grid_attach (_tmp17_, (GtkWidget*) _data23_->delete_button, 3, _tmp18_, 1, 1);
	_tmp19_ = _data23_->combo;
	g_signal_connect_data (_tmp19_, "changed", (GCallback) ___lambda52__contacts_typecombo_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	g_signal_connect_data (_data23_->value_address, "changed", (GCallback) ___lambda53__contacts_address_editor_changed, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	g_signal_connect_data (_data23_->delete_button, "clicked", (GCallback) ___lambda54__gtk_button_clicked, block23_data_ref (_data23_), (GClosureNotify) block23_data_unref, 0);
	self->priv->focus_widget = (GtkWidget*) _data23_->value_address;
	block23_data_unref (_data23_);
	_data23_ = NULL;
}


static void ____lambda55_ (ContactsContactEditor* self) {
	contacts_contact_editor_set_has_nickname_row (self, FALSE);
}


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


static gint contacts_contact_editor_get_current_row (ContactsContactEditor* self, GtkWidget* child) {
	gint result = 0;
	gint row = 0;
	GtkGrid* _tmp0_;
	GtkWidget* _tmp1_;
	g_return_val_if_fail (self != NULL, 0);
	g_return_val_if_fail (child != NULL, 0);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = child;
	gtk_container_child_get ((GtkContainer*) _tmp0_, _tmp1_, "top-attach", &row, NULL);
	result = row;
	return result;
}


static void contacts_contact_editor_insert_row_at (ContactsContactEditor* self, gint idx) {
	GtkGrid* _tmp120_;
	gint _tmp121_;
	g_return_if_fail (self != NULL);
	{
		GeeIterator* _field_maps_it = NULL;
		GeeHashMap* _tmp0_;
		GeeCollection* _tmp1_;
		GeeCollection* _tmp2_;
		GeeCollection* _tmp3_;
		GeeIterator* _tmp4_;
		GeeIterator* _tmp5_;
		_tmp0_ = self->priv->writable_personas;
		_tmp1_ = gee_abstract_map_get_values ((GeeAbstractMap*) _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_;
			gboolean _tmp7_;
			GeeHashMap* field_maps = NULL;
			GeeIterator* _tmp8_;
			gpointer _tmp9_;
			_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_;
				GeeCollection* _tmp11_;
				GeeCollection* _tmp12_;
				GeeCollection* _tmp13_;
				GeeIterator* _tmp14_;
				GeeIterator* _tmp15_;
				_tmp10_ = field_maps;
				_tmp11_ = gee_abstract_map_get_values ((GeeAbstractMap*) _tmp10_);
				_tmp12_ = _tmp11_;
				_tmp13_ = _tmp12_;
				_tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
				_tmp15_ = _tmp14_;
				_g_object_unref0 (_tmp13_);
				_field_it = _tmp15_;
				while (TRUE) {
					GeeIterator* _tmp16_;
					gboolean _tmp17_;
					ContactsContactEditorField* field = NULL;
					GeeIterator* _tmp18_;
					gpointer _tmp19_;
					_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_;
						GeeHashMap* _tmp21_;
						GeeSet* _tmp22_;
						GeeSet* _tmp23_;
						GeeSet* _tmp24_;
						GeeIterator* _tmp25_;
						GeeIterator* _tmp26_;
						_tmp20_ = field;
						_tmp21_ = (*_tmp20_).rows;
						_tmp22_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp21_);
						_tmp23_ = _tmp22_;
						_tmp24_ = _tmp23_;
						_tmp25_ = gee_iterable_iterator ((GeeIterable*) _tmp24_);
						_tmp26_ = _tmp25_;
						_g_object_unref0 (_tmp24_);
						_row_it = _tmp26_;
						while (TRUE) {
							GeeIterator* _tmp27_;
							gboolean _tmp28_;
							gint row = 0;
							GeeIterator* _tmp29_;
							gpointer _tmp30_;
							gint _tmp31_;
							gint _tmp32_;
							_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_;
								ContactsContactEditorField* _tmp52_;
								GeeHashMap* _tmp53_;
								GeeHashMap* _tmp54_;
								_tmp33_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, (GDestroyNotify) 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_;
									GeeHashMap* _tmp35_;
									GeeSet* _tmp36_;
									GeeSet* _tmp37_;
									GeeSet* _tmp38_;
									GeeIterator* _tmp39_;
									GeeIterator* _tmp40_;
									_tmp34_ = field;
									_tmp35_ = (*_tmp34_).rows;
									_tmp36_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _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_;
										gboolean _tmp42_;
										gint old_row = 0;
										GeeIterator* _tmp43_;
										gpointer _tmp44_;
										GeeHashMap* _tmp45_;
										gint _tmp46_;
										ContactsContactEditorField* _tmp47_;
										GeeHashMap* _tmp48_;
										gint _tmp49_;
										gpointer _tmp50_;
										ContactsContactEditorRowData* _tmp51_;
										_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);
	}
	{
		GeeIterator* _entry_it = NULL;
		GeeHashMap* _tmp55_;
		GeeSet* _tmp56_;
		GeeSet* _tmp57_;
		GeeSet* _tmp58_;
		GeeIterator* _tmp59_;
		GeeIterator* _tmp60_;
		_tmp55_ = self->priv->writable_personas;
		_tmp56_ = gee_abstract_map_get_entries ((GeeAbstractMap*) _tmp55_);
		_tmp57_ = _tmp56_;
		_tmp58_ = _tmp57_;
		_tmp59_ = gee_iterable_iterator ((GeeIterable*) _tmp58_);
		_tmp60_ = _tmp59_;
		_g_object_unref0 (_tmp58_);
		_entry_it = _tmp60_;
		while (TRUE) {
			GeeIterator* _tmp61_;
			gboolean _tmp62_;
			GeeMapEntry* entry = NULL;
			GeeIterator* _tmp63_;
			gpointer _tmp64_;
			_tmp61_ = _entry_it;
			_tmp62_ = gee_iterator_next (_tmp61_);
			if (!_tmp62_) {
				break;
			}
			_tmp63_ = _entry_it;
			_tmp64_ = gee_iterator_get (_tmp63_);
			entry = (GeeMapEntry*) _tmp64_;
			{
				GeeIterator* _field_entry_it = NULL;
				GeeMapEntry* _tmp65_;
				gconstpointer _tmp66_;
				GeeHashMap* _tmp67_;
				GeeSet* _tmp68_;
				GeeSet* _tmp69_;
				GeeSet* _tmp70_;
				GeeIterator* _tmp71_;
				GeeIterator* _tmp72_;
				_tmp65_ = entry;
				_tmp66_ = gee_map_entry_get_value (_tmp65_);
				_tmp67_ = _tmp66_;
				_tmp68_ = gee_abstract_map_get_entries ((GeeAbstractMap*) ((GeeHashMap*) _tmp67_));
				_tmp69_ = _tmp68_;
				_tmp70_ = _tmp69_;
				_tmp71_ = gee_iterable_iterator ((GeeIterable*) _tmp70_);
				_tmp72_ = _tmp71_;
				_g_object_unref0 (_tmp70_);
				_field_entry_it = _tmp72_;
				while (TRUE) {
					GeeIterator* _tmp73_;
					gboolean _tmp74_;
					GeeMapEntry* field_entry = NULL;
					GeeIterator* _tmp75_;
					gpointer _tmp76_;
					_tmp73_ = _field_entry_it;
					_tmp74_ = gee_iterator_next (_tmp73_);
					if (!_tmp74_) {
						break;
					}
					_tmp75_ = _field_entry_it;
					_tmp76_ = gee_iterator_get (_tmp75_);
					field_entry = (GeeMapEntry*) _tmp76_;
					{
						GeeIterator* _row_it = NULL;
						GeeMapEntry* _tmp77_;
						gconstpointer _tmp78_;
						ContactsContactEditorField* _tmp79_;
						GeeHashMap* _tmp80_;
						GeeSet* _tmp81_;
						GeeSet* _tmp82_;
						GeeSet* _tmp83_;
						GeeIterator* _tmp84_;
						GeeIterator* _tmp85_;
						_tmp77_ = field_entry;
						_tmp78_ = gee_map_entry_get_value (_tmp77_);
						_tmp79_ = _tmp78_;
						_tmp80_ = (*((ContactsContactEditorField*) _tmp79_)).rows;
						_tmp81_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp80_);
						_tmp82_ = _tmp81_;
						_tmp83_ = _tmp82_;
						_tmp84_ = gee_iterable_iterator ((GeeIterable*) _tmp83_);
						_tmp85_ = _tmp84_;
						_g_object_unref0 (_tmp83_);
						_row_it = _tmp85_;
						while (TRUE) {
							GeeIterator* _tmp86_;
							gboolean _tmp87_;
							gint row = 0;
							GeeIterator* _tmp88_;
							gpointer _tmp89_;
							gint _tmp90_;
							gint _tmp91_;
							_tmp86_ = _row_it;
							_tmp87_ = gee_iterator_next (_tmp86_);
							if (!_tmp87_) {
								break;
							}
							_tmp88_ = _row_it;
							_tmp89_ = gee_iterator_get (_tmp88_);
							row = (gint) ((gintptr) _tmp89_);
							_tmp90_ = row;
							_tmp91_ = idx;
							if (_tmp90_ >= _tmp91_) {
								GeeHashMap* new_rows = NULL;
								GeeHashMap* _tmp92_;
								GeeMapEntry* _tmp115_;
								gconstpointer _tmp116_;
								ContactsContactEditorField* _tmp117_;
								GeeHashMap* _tmp118_;
								GeeHashMap* _tmp119_;
								_tmp92_ = gee_hash_map_new (G_TYPE_INT, NULL, NULL, CONTACTS_CONTACT_EDITOR_TYPE_ROW_DATA, (GBoxedCopyFunc) contacts_contact_editor_row_data_dup, (GDestroyNotify) contacts_contact_editor_row_data_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
								new_rows = _tmp92_;
								{
									GeeIterator* _old_row_it = NULL;
									GeeMapEntry* _tmp93_;
									gconstpointer _tmp94_;
									ContactsContactEditorField* _tmp95_;
									GeeHashMap* _tmp96_;
									GeeSet* _tmp97_;
									GeeSet* _tmp98_;
									GeeSet* _tmp99_;
									GeeIterator* _tmp100_;
									GeeIterator* _tmp101_;
									_tmp93_ = field_entry;
									_tmp94_ = gee_map_entry_get_value (_tmp93_);
									_tmp95_ = _tmp94_;
									_tmp96_ = (*((ContactsContactEditorField*) _tmp95_)).rows;
									_tmp97_ = gee_abstract_map_get_keys ((GeeAbstractMap*) _tmp96_);
									_tmp98_ = _tmp97_;
									_tmp99_ = _tmp98_;
									_tmp100_ = gee_iterable_iterator ((GeeIterable*) _tmp99_);
									_tmp101_ = _tmp100_;
									_g_object_unref0 (_tmp99_);
									_old_row_it = _tmp101_;
									while (TRUE) {
										GeeIterator* _tmp102_;
										gboolean _tmp103_;
										gint old_row = 0;
										GeeIterator* _tmp104_;
										gpointer _tmp105_;
										GeeHashMap* _tmp106_;
										gint _tmp107_;
										GeeMapEntry* _tmp108_;
										gconstpointer _tmp109_;
										ContactsContactEditorField* _tmp110_;
										GeeHashMap* _tmp111_;
										gint _tmp112_;
										gpointer _tmp113_;
										ContactsContactEditorRowData* _tmp114_;
										_tmp102_ = _old_row_it;
										_tmp103_ = gee_iterator_next (_tmp102_);
										if (!_tmp103_) {
											break;
										}
										_tmp104_ = _old_row_it;
										_tmp105_ = gee_iterator_get (_tmp104_);
										old_row = (gint) ((gintptr) _tmp105_);
										_tmp106_ = new_rows;
										_tmp107_ = old_row;
										_tmp108_ = field_entry;
										_tmp109_ = gee_map_entry_get_value (_tmp108_);
										_tmp110_ = _tmp109_;
										_tmp111_ = (*((ContactsContactEditorField*) _tmp110_)).rows;
										_tmp112_ = old_row;
										_tmp113_ = gee_abstract_map_get ((GeeAbstractMap*) _tmp111_, (gpointer) ((gintptr) _tmp112_));
										_tmp114_ = (ContactsContactEditorRowData*) _tmp113_;
										gee_abstract_map_set ((GeeAbstractMap*) _tmp106_, (gpointer) ((gintptr) (_tmp107_ + 1)), _tmp114_);
										_contacts_contact_editor_row_data_free0 (_tmp114_);
									}
									_g_object_unref0 (_old_row_it);
								}
								_tmp115_ = field_entry;
								_tmp116_ = gee_map_entry_get_value (_tmp115_);
								_tmp117_ = _tmp116_;
								_tmp118_ = new_rows;
								_tmp119_ = _g_object_ref0 (_tmp118_);
								_g_object_unref0 ((*((ContactsContactEditorField*) _tmp117_)).rows);
								(*((ContactsContactEditorField*) _tmp117_)).rows = _tmp119_;
								_g_object_unref0 (new_rows);
								break;
							}
						}
						_g_object_unref0 (_row_it);
					}
					_g_object_unref0 (field_entry);
				}
				_g_object_unref0 (_field_entry_it);
			}
			_g_object_unref0 (entry);
		}
		_g_object_unref0 (_entry_it);
	}
	_tmp120_ = self->priv->container_grid;
	_tmp121_ = idx;
	gtk_grid_insert_row (_tmp120_, _tmp121_);
}


static void contacts_contact_editor_size_allocate_cb (ContactsContactEditor* self, GtkAllocation* alloc) {
	gboolean _tmp0_ = FALSE;
	GtkWidget* _tmp1_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (alloc != NULL);
	_tmp1_ = self->priv->focus_widget;
	if (_tmp1_ != NULL) {
		GtkWidget* _tmp2_;
		_tmp2_ = self->priv->focus_widget;
		_tmp0_ = G_TYPE_CHECK_INSTANCE_TYPE (_tmp2_, gtk_widget_get_type ());
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		GtkWidget* _tmp3_;
		_tmp3_ = self->priv->focus_widget;
		gtk_widget_grab_focus (_tmp3_);
		self->priv->focus_widget = NULL;
	}
}


static void _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate (GtkWidget* _sender, GtkAllocation* allocation, gpointer self) {
	contacts_contact_editor_size_allocate_cb ((ContactsContactEditor*) self, allocation);
}


ContactsContactEditor* contacts_contact_editor_construct (GType object_type, GSimpleActionGroup* editor_actions) {
	ContactsContactEditor * self = NULL;
	Center* hcenter = NULL;
	Center* _tmp0_;
	GtkGrid* _tmp1_;
	GtkGrid* _tmp2_;
	GtkGrid* _tmp3_;
	GtkGrid* _tmp4_;
	GtkGrid* _tmp5_;
	GtkGrid* _tmp6_;
	GtkGrid* _tmp7_;
	GtkGrid* _tmp8_;
	GtkScrolledWindow* _tmp9_;
	GtkGrid* _tmp10_;
	GtkScrolledWindow* _tmp11_;
	GtkAdjustment* _tmp12_;
	GtkScrolledWindow* _tmp13_;
	GtkWidget* _tmp14_;
	GtkStyleContext* _tmp15_;
	GtkScrolledWindow* _tmp16_;
	GtkWidget* _tmp17_;
	GtkStyleContext* _tmp18_;
	GtkScrolledWindow* _tmp19_;
	GtkMenuButton* _tmp20_;
	GtkPopover* _tmp21_;
	GSimpleActionGroup* _tmp22_;
	GeeHashMap* _tmp23_;
	GtkGrid* _tmp24_;
	g_return_val_if_fail (editor_actions != NULL, NULL);
	self = (ContactsContactEditor*) g_object_new (object_type, NULL);
	_tmp0_ = center_new ();
	g_object_ref_sink (_tmp0_);
	hcenter = _tmp0_;
	center_set_max_width (hcenter, 600);
	center_set_xalign (hcenter, 0.0);
	_tmp1_ = (GtkGrid*) gtk_grid_new ();
	g_object_ref_sink (_tmp1_);
	_g_object_unref0 (self->priv->container_grid);
	self->priv->container_grid = _tmp1_;
	_tmp2_ = self->priv->container_grid;
	gtk_grid_set_row_spacing (_tmp2_, (guint) 12);
	_tmp3_ = self->priv->container_grid;
	gtk_grid_set_column_spacing (_tmp3_, (guint) 12);
	_tmp4_ = self->priv->container_grid;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp4_, TRUE);
	_tmp5_ = self->priv->container_grid;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp5_, TRUE);
	_tmp6_ = self->priv->container_grid;
	g_object_set ((GtkWidget*) _tmp6_, "margin", 36, NULL);
	_tmp7_ = self->priv->container_grid;
	gtk_widget_set_margin_bottom ((GtkWidget*) _tmp7_, 24);
	_tmp8_ = self->priv->container_grid;
	gtk_container_add ((GtkContainer*) hcenter, (GtkWidget*) _tmp8_);
	_tmp9_ = self->priv->main_sw;
	gtk_container_add ((GtkContainer*) _tmp9_, (GtkWidget*) hcenter);
	_tmp10_ = self->priv->container_grid;
	_tmp11_ = self->priv->main_sw;
	_tmp12_ = gtk_scrolled_window_get_vadjustment (_tmp11_);
	gtk_container_set_focus_vadjustment ((GtkContainer*) _tmp10_, _tmp12_);
	_tmp13_ = self->priv->main_sw;
	_tmp14_ = gtk_bin_get_child ((GtkBin*) _tmp13_);
	_tmp15_ = gtk_widget_get_style_context (_tmp14_);
	gtk_style_context_add_class (_tmp15_, "contacts-main-view");
	_tmp16_ = self->priv->main_sw;
	_tmp17_ = gtk_bin_get_child ((GtkBin*) _tmp16_);
	_tmp18_ = gtk_widget_get_style_context (_tmp17_);
	gtk_style_context_add_class (_tmp18_, "view");
	_tmp19_ = self->priv->main_sw;
	gtk_widget_show_all ((GtkWidget*) _tmp19_);
	_tmp20_ = self->priv->add_detail_button;
	_tmp21_ = gtk_menu_button_get_popover (_tmp20_);
	_tmp22_ = editor_actions;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp21_, "edit", (GActionGroup*) _tmp22_);
	_tmp23_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_g_object_unref0 (self->priv->writable_personas);
	self->priv->writable_personas = _tmp23_;
	_tmp24_ = self->priv->container_grid;
	g_signal_connect_object ((GtkWidget*) _tmp24_, "size-allocate", (GCallback) _contacts_contact_editor_size_allocate_cb_gtk_widget_size_allocate, self, G_CONNECT_AFTER);
	_g_object_unref0 (hcenter);
	return self;
}


ContactsContactEditor* contacts_contact_editor_new (GSimpleActionGroup* editor_actions) {
	return contacts_contact_editor_construct (CONTACTS_TYPE_CONTACT_EDITOR, editor_actions);
}


/**
   * Adjusts the ContactEditor to the given contact.
   * Use clear() to make sure nothing is lingering from the previous one.
   */
void contacts_contact_editor_edit (ContactsContactEditor* self, ContactsContact* c) {
	ContactsContact* _tmp0_;
	ContactsContact* _tmp1_;
	GtkButton* _tmp2_;
	GtkButton* _tmp3_;
	ContactsContact* _tmp4_;
	gboolean _tmp5_;
	GtkButton* _tmp6_;
	GtkButton* _tmp7_;
	ContactsContact* _tmp8_;
	FolksIndividual* _tmp9_;
	GeeSet* _tmp10_;
	GeeSet* _tmp11_;
	gint _tmp12_;
	gint _tmp13_;
	gint i = 0;
	gint last_store_position = 0;
	gboolean is_first_persona = FALSE;
	GeeList* personas = NULL;
	ContactsContact* _tmp14_;
	GeeList* _tmp15_;
	g_return_if_fail (self != NULL);
	g_return_if_fail (c != NULL);
	_tmp0_ = c;
	_tmp1_ = _g_object_ref0 (_tmp0_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = _tmp1_;
	_tmp2_ = self->remove_button;
	gtk_widget_show ((GtkWidget*) _tmp2_);
	_tmp3_ = self->remove_button;
	_tmp4_ = self->priv->contact;
	_tmp5_ = contacts_contact_can_remove_personas (_tmp4_);
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, _tmp5_);
	_tmp6_ = self->linked_button;
	gtk_widget_show ((GtkWidget*) _tmp6_);
	_tmp7_ = self->linked_button;
	_tmp8_ = self->priv->contact;
	_tmp9_ = _tmp8_->individual;
	_tmp10_ = folks_individual_get_personas (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = gee_collection_get_size ((GeeCollection*) _tmp11_);
	_tmp13_ = _tmp12_;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp7_, _tmp13_ > 1);
	contacts_contact_editor_create_avatar_frame (self);
	contacts_contact_editor_create_name_entry (self);
	i = 3;
	last_store_position = 0;
	is_first_persona = TRUE;
	_tmp14_ = c;
	_tmp15_ = contacts_contact_get_personas_for_display (_tmp14_);
	personas = _tmp15_;
	{
		GeeList* _p_list = NULL;
		GeeList* _tmp16_;
		GeeList* _tmp17_;
		gint _p_size = 0;
		GeeList* _tmp18_;
		gint _tmp19_;
		gint _tmp20_;
		gint _p_index = 0;
		_tmp16_ = personas;
		_tmp17_ = _g_object_ref0 (_tmp16_);
		_p_list = _tmp17_;
		_tmp18_ = _p_list;
		_tmp19_ = gee_collection_get_size ((GeeCollection*) _tmp18_);
		_tmp20_ = _tmp19_;
		_p_size = _tmp20_;
		_p_index = -1;
		while (TRUE) {
			gint _tmp21_;
			gint _tmp22_;
			gint _tmp23_;
			FolksPersona* p = NULL;
			GeeList* _tmp24_;
			gint _tmp25_;
			gpointer _tmp26_;
			gboolean _tmp27_;
			gchar** rw_props = NULL;
			FolksPersona* _tmp43_;
			gchar** _tmp44_;
			gint _tmp44__length1;
			gchar** _tmp45_;
			gint _tmp45__length1;
			gint _tmp46_;
			gchar** _tmp47_;
			gint rw_props_length1;
			gint _rw_props_size_;
			gchar** _tmp48_;
			gint _tmp48__length1;
			gboolean _tmp59_;
			gint _tmp61_;
			gint _tmp62_;
			gint _tmp63_;
			_tmp21_ = _p_index;
			_p_index = _tmp21_ + 1;
			_tmp22_ = _p_index;
			_tmp23_ = _p_size;
			if (!(_tmp22_ < _tmp23_)) {
				break;
			}
			_tmp24_ = _p_list;
			_tmp25_ = _p_index;
			_tmp26_ = gee_list_get (_tmp24_, _tmp25_);
			p = (FolksPersona*) _tmp26_;
			_tmp27_ = is_first_persona;
			if (!_tmp27_) {
				GtkLabel* store_name = NULL;
				GtkLabel* _tmp28_;
				GtkLabel* _tmp29_;
				FolksPersona* _tmp30_;
				gchar* _tmp31_;
				gchar* _tmp32_;
				gchar* _tmp33_;
				gchar* _tmp34_;
				GtkLabel* _tmp35_;
				GtkLabel* _tmp36_;
				GtkLabel* _tmp37_;
				GtkGrid* _tmp38_;
				GtkLabel* _tmp39_;
				gint _tmp40_;
				gint _tmp41_;
				gint _tmp42_;
				_tmp28_ = (GtkLabel*) gtk_label_new ("");
				g_object_ref_sink (_tmp28_);
				store_name = _tmp28_;
				_tmp29_ = store_name;
				_tmp30_ = p;
				_tmp31_ = contacts_contact_format_persona_store_name_for_contact (_tmp30_);
				_tmp32_ = _tmp31_;
				_tmp33_ = g_markup_printf_escaped ("<span font='16px bold'>%s</span>", _tmp32_);
				_tmp34_ = _tmp33_;
				gtk_label_set_markup (_tmp29_, _tmp34_);
				_g_free0 (_tmp34_);
				_g_free0 (_tmp32_);
				_tmp35_ = store_name;
				gtk_widget_set_halign ((GtkWidget*) _tmp35_, GTK_ALIGN_START);
				_tmp36_ = store_name;
				gtk_label_set_xalign (_tmp36_, 0.0f);
				_tmp37_ = store_name;
				gtk_widget_set_margin_start ((GtkWidget*) _tmp37_, 6);
				_tmp38_ = self->priv->container_grid;
				_tmp39_ = store_name;
				_tmp40_ = i;
				gtk_grid_attach (_tmp38_, (GtkWidget*) _tmp39_, 0, _tmp40_, 2, 1);
				_tmp41_ = i;
				i = _tmp41_ + 1;
				_tmp42_ = i;
				last_store_position = _tmp42_;
				_g_object_unref0 (store_name);
			}
			_tmp43_ = p;
			_tmp44_ = folks_persona_get_writeable_properties (_tmp43_, &_tmp44__length1);
			_tmp45_ = _tmp44_;
			_tmp45__length1 = _tmp44__length1;
			_tmp47_ = contacts_contact_sort_persona_properties (_tmp45_, _tmp45__length1, &_tmp46_);
			rw_props = _tmp47_;
			rw_props_length1 = _tmp46_;
			_rw_props_size_ = rw_props_length1;
			_tmp48_ = rw_props;
			_tmp48__length1 = rw_props_length1;
			if (_tmp48__length1 != 0) {
				GeeHashMap* _tmp49_;
				FolksPersona* _tmp50_;
				const gchar* _tmp51_;
				const gchar* _tmp52_;
				GeeHashMap* _tmp53_;
				GeeHashMap* _tmp54_;
				gchar** _tmp55_;
				gint _tmp55__length1;
				_tmp49_ = self->priv->writable_personas;
				_tmp50_ = p;
				_tmp51_ = folks_persona_get_uid (_tmp50_);
				_tmp52_ = _tmp51_;
				_tmp53_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, (GDestroyNotify) contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
				_tmp54_ = _tmp53_;
				gee_abstract_map_set ((GeeAbstractMap*) _tmp49_, _tmp52_, _tmp54_);
				_g_object_unref0 (_tmp54_);
				_tmp55_ = rw_props;
				_tmp55__length1 = rw_props_length1;
				{
					gchar** prop_collection = NULL;
					gint prop_collection_length1 = 0;
					gint _prop_collection_size_ = 0;
					gint prop_it = 0;
					prop_collection = _tmp55_;
					prop_collection_length1 = _tmp55__length1;
					for (prop_it = 0; prop_it < _tmp55__length1; prop_it = prop_it + 1) {
						gchar* _tmp56_;
						gchar* prop = NULL;
						_tmp56_ = g_strdup (prop_collection[prop_it]);
						prop = _tmp56_;
						{
							FolksPersona* _tmp57_;
							const gchar* _tmp58_;
							_tmp57_ = p;
							_tmp58_ = prop;
							contacts_contact_editor_add_edit_row (self, _tmp57_, _tmp58_, &i, FALSE, NULL);
							_g_free0 (prop);
						}
					}
				}
			}
			_tmp59_ = is_first_persona;
			if (_tmp59_) {
				gint _tmp60_;
				_tmp60_ = i;
				self->priv->last_row = _tmp60_ - 1;
			}
			_tmp61_ = i;
			if (_tmp61_ != 3) {
				is_first_persona = FALSE;
			}
			_tmp62_ = i;
			_tmp63_ = last_store_position;
			if (_tmp62_ == _tmp63_) {
				gint _tmp64_;
				GtkGrid* _tmp65_;
				gint _tmp66_;
				GtkWidget* _tmp67_;
				_tmp64_ = i;
				i = _tmp64_ - 1;
				_tmp65_ = self->priv->container_grid;
				_tmp66_ = i;
				_tmp67_ = gtk_grid_get_child_at (_tmp65_, 0, _tmp66_);
				gtk_widget_destroy (_tmp67_);
			}
			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);
}


/**
   * Adjusts the ContactEditor for a new contact.
   * Use clear() to make sure nothing is lingering from the previous one.
   */
void contacts_contact_editor_set_new_contact (ContactsContactEditor* self) {
	GtkButton* _tmp0_;
	GtkButton* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	GtkEntry* _tmp14_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->remove_button;
	gtk_widget_hide ((GtkWidget*) _tmp0_);
	_tmp1_ = self->linked_button;
	gtk_widget_hide ((GtkWidget*) _tmp1_);
	contacts_contact_editor_create_avatar_frame (self);
	contacts_contact_editor_create_name_entry (self);
	self->priv->last_row = 2;
	_tmp2_ = self->priv->writable_personas;
	_tmp3_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, CONTACTS_CONTACT_EDITOR_TYPE_FIELD, (GBoxedCopyFunc) contacts_contact_editor_field_dup, (GDestroyNotify) contacts_contact_editor_field_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	_tmp4_ = _tmp3_;
	gee_abstract_map_set ((GeeAbstractMap*) _tmp2_, "null-persona.hack", _tmp4_);
	_g_object_unref0 (_tmp4_);
	{
		const gchar** prop_collection = NULL;
		gint prop_collection_length1 = 0;
		gint _prop_collection_size_ = 0;
		gint prop_it = 0;
		prop_collection = CONTACTS_CONTACT_EDITOR_DEFAULT_PROPS_NEW_CONTACT;
		prop_collection_length1 = G_N_ELEMENTS (CONTACTS_CONTACT_EDITOR_DEFAULT_PROPS_NEW_CONTACT);
		for (prop_it = 0; prop_it < G_N_ELEMENTS (CONTACTS_CONTACT_EDITOR_DEFAULT_PROPS_NEW_CONTACT); prop_it = prop_it + 1) {
			const gchar* prop = NULL;
			prop = prop_collection[prop_it];
			{
				gchar** tok = NULL;
				const gchar* _tmp5_;
				gchar** _tmp6_;
				gchar** _tmp7_;
				gint tok_length1;
				gint _tok_size_;
				gchar** _tmp8_;
				gint _tmp8__length1;
				const gchar* _tmp9_;
				gchar** _tmp10_;
				gint _tmp10__length1;
				const gchar* _tmp11_;
				gchar* _tmp12_;
				gchar* _tmp13_;
				_tmp5_ = prop;
				_tmp7_ = _tmp6_ = g_strsplit (_tmp5_, ".", 0);
				tok = _tmp7_;
				tok_length1 = _vala_array_length (_tmp6_);
				_tok_size_ = tok_length1;
				_tmp8_ = tok;
				_tmp8__length1 = tok_length1;
				_tmp9_ = _tmp8_[0];
				_tmp10_ = tok;
				_tmp10__length1 = tok_length1;
				_tmp11_ = _tmp10_[1];
				_tmp12_ = g_utf8_strup (_tmp11_, (gssize) -1);
				_tmp13_ = _tmp12_;
				contacts_contact_editor_add_new_row_for_property (self, NULL, _tmp9_, _tmp13_);
				_g_free0 (_tmp13_);
				tok = (_vala_array_free (tok, tok_length1, (GDestroyNotify) g_free), NULL);
			}
		}
	}
	_tmp14_ = self->priv->name_entry;
	self->priv->focus_widget = (GtkWidget*) _tmp14_;
}


void contacts_contact_editor_clear (ContactsContactEditor* self) {
	GtkGrid* _tmp0_;
	GList* _tmp1_;
	GtkButton* _tmp3_;
	GtkButton* _tmp4_;
	GeeHashMap* _tmp5_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->container_grid;
	_tmp1_ = gtk_container_get_children ((GtkContainer*) _tmp0_);
	{
		GList* w_collection = NULL;
		GList* w_it = NULL;
		w_collection = _tmp1_;
		for (w_it = w_collection; w_it != NULL; w_it = w_it->next) {
			GtkWidget* w = NULL;
			w = (GtkWidget*) w_it->data;
			{
				GtkWidget* _tmp2_;
				_tmp2_ = w;
				gtk_widget_destroy (_tmp2_);
			}
		}
		_g_list_free0 (w_collection);
	}
	_tmp3_ = self->remove_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp3_, FALSE);
	_tmp4_ = self->linked_button;
	gtk_widget_set_sensitive ((GtkWidget*) _tmp4_, FALSE);
	contacts_contact_editor_set_has_birthday_row (self, FALSE);
	contacts_contact_editor_set_has_nickname_row (self, FALSE);
	contacts_contact_editor_set_has_notes_row (self, FALSE);
	_tmp5_ = self->priv->writable_personas;
	gee_abstract_map_clear ((GeeAbstractMap*) _tmp5_);
	_g_object_unref0 (self->priv->contact);
	self->priv->contact = NULL;
}


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


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


static void _contacts_contact_editor_on_avatar_frame_clicked_contacts_contact_frame_clicked (ContactsContactFrame* _sender, gpointer self) {
	contacts_contact_editor_on_avatar_frame_clicked ((ContactsContactEditor*) self);
}


static void ___lambda64_ (ContactsContactEditor* self, GtkWidget* w) {
	ContactsContactFrame* _tmp0_;
	ContactsContact* _tmp1_;
	FolksIndividual* _tmp2_;
	ContactsContact* _tmp3_;
	g_return_if_fail (w != NULL);
	_tmp0_ = self->priv->avatar_frame;
	_tmp1_ = self->priv->contact;
	_tmp2_ = _tmp1_->individual;
	_tmp3_ = self->priv->contact;
	contacts_contact_frame_set_image (_tmp0_, (FolksAvatarDetails*) _tmp2_, _tmp3_);
}


static void ____lambda64__gtk_callback (GtkWidget* widget, gpointer self) {
	___lambda64_ ((ContactsContactEditor*) self, widget);
}


static void contacts_contact_editor_create_avatar_frame (ContactsContactEditor* self) {
	ContactsContactFrame* _tmp0_;
	ContactsContactFrame* _tmp1_;
	ContactsContactFrame* _tmp2_;
	ContactsContactFrame* _tmp3_;
	GtkWidget* _tmp4_;
	ContactsContactFrame* _tmp5_;
	ContactsContact* _tmp6_;
	GtkGrid* _tmp10_;
	ContactsContactFrame* _tmp11_;
	g_return_if_fail (self != NULL);
	_tmp0_ = contacts_contact_frame_new (PROFILE_SIZE, TRUE);
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->avatar_frame);
	self->priv->avatar_frame = _tmp0_;
	_tmp1_ = self->priv->avatar_frame;
	gtk_widget_set_vexpand ((GtkWidget*) _tmp1_, FALSE);
	_tmp2_ = self->priv->avatar_frame;
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_START);
	_tmp3_ = self->priv->avatar_frame;
	_tmp4_ = gtk_bin_get_child ((GtkBin*) _tmp3_);
	gtk_button_set_relief (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, gtk_button_get_type ()) ? ((GtkButton*) _tmp4_) : NULL, GTK_RELIEF_NORMAL);
	_tmp5_ = self->priv->avatar_frame;
	g_signal_connect_object (_tmp5_, "clicked", (GCallback) _contacts_contact_editor_on_avatar_frame_clicked_contacts_contact_frame_clicked, self, 0);
	_tmp6_ = self->priv->contact;
	if (_tmp6_ != NULL) {
		ContactsContact* _tmp7_;
		ContactsContactFrame* _tmp8_;
		_tmp7_ = self->priv->contact;
		_tmp8_ = self->priv->avatar_frame;
		contacts_contact_keep_widget_uptodate (_tmp7_, (GtkWidget*) _tmp8_, ____lambda64__gtk_callback, g_object_ref (self), g_object_unref);
	} else {
		ContactsContactFrame* _tmp9_;
		_tmp9_ = self->priv->avatar_frame;
		contacts_contact_frame_set_image (_tmp9_, NULL, NULL);
	}
	_tmp10_ = self->priv->container_grid;
	_tmp11_ = self->priv->avatar_frame;
	gtk_grid_attach (_tmp10_, (GtkWidget*) _tmp11_, 0, 0, 1, 3);
}


static void __lambda63_ (ContactsContactEditor* self, GIcon* icon) {
	ContactsContactFrame* _tmp0_;
	GIcon* _tmp1_;
	GIcon* _tmp2_;
	ContactsContactFrame* _tmp3_;
	GdkPixbuf* a_pixbuf = NULL;
	ContactsContactFrame* _tmp10_;
	GdkPixbuf* _tmp11_;
	GError * _inner_error_ = NULL;
	g_return_if_fail (icon != NULL);
	_tmp0_ = self->priv->avatar_frame;
	_tmp1_ = icon;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	g_object_set_data_full ((GObject*) _tmp0_, "value", _tmp2_, g_object_unref);
	_tmp3_ = self->priv->avatar_frame;
	g_object_set_data_full ((GObject*) _tmp3_, "changed", (gpointer) ((gintptr) TRUE), NULL);
	a_pixbuf = NULL;
	{
		GInputStream* stream = NULL;
		GIcon* _tmp4_;
		GInputStream* _tmp5_;
		GdkPixbuf* _tmp6_ = NULL;
		GInputStream* _tmp7_;
		GdkPixbuf* _tmp8_;
		GdkPixbuf* _tmp9_;
		_tmp4_ = icon;
		_tmp5_ = g_loadable_icon_load (G_TYPE_CHECK_INSTANCE_TYPE (_tmp4_, g_loadable_icon_get_type ()) ? ((GLoadableIcon*) _tmp4_) : NULL, PROFILE_SIZE, NULL, NULL, &_inner_error_);
		stream = _tmp5_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			goto __catch6_g_error;
		}
		_tmp7_ = stream;
		_tmp8_ = gdk_pixbuf_new_from_stream_at_scale (_tmp7_, PROFILE_SIZE, PROFILE_SIZE, TRUE, NULL, &_inner_error_);
		_tmp6_ = _tmp8_;
		if (G_UNLIKELY (_inner_error_ != NULL)) {
			_g_object_unref0 (stream);
			goto __catch6_g_error;
		}
		_tmp9_ = _tmp6_;
		_tmp6_ = NULL;
		_g_object_unref0 (a_pixbuf);
		a_pixbuf = _tmp9_;
		_g_object_unref0 (_tmp6_);
		_g_object_unref0 (stream);
	}
	goto __finally6;
	__catch6_g_error:
	{
		g_clear_error (&_inner_error_);
		_inner_error_ = NULL;
	}
	__finally6:
	if (G_UNLIKELY (_inner_error_ != NULL)) {
		_g_object_unref0 (a_pixbuf);
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
		g_clear_error (&_inner_error_);
		return;
	}
	_tmp10_ = self->priv->avatar_frame;
	_tmp11_ = a_pixbuf;
	contacts_contact_frame_set_pixbuf (_tmp10_, _tmp11_);
	_g_object_unref0 (a_pixbuf);
}


static void ___lambda63__contacts_avatar_dialog_set_avatar (ContactsAvatarDialog* _sender, GIcon* avatar_icon, gpointer self) {
	__lambda63_ ((ContactsContactEditor*) self, avatar_icon);
}


static void contacts_contact_editor_on_avatar_frame_clicked (ContactsContactEditor* self) {
	ContactsAvatarDialog* dialog = NULL;
	GtkWidget* _tmp0_;
	ContactsContact* _tmp1_;
	ContactsAvatarDialog* _tmp2_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_widget_get_toplevel ((GtkWidget*) self);
	_tmp1_ = self->priv->contact;
	_tmp2_ = contacts_avatar_dialog_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp0_, CONTACTS_TYPE_WINDOW, ContactsWindow), _tmp1_);
	g_object_ref_sink (_tmp2_);
	dialog = _tmp2_;
	g_signal_connect_object (dialog, "set-avatar", (GCallback) ___lambda63__contacts_avatar_dialog_set_avatar, self, 0);
	gtk_dialog_run ((GtkDialog*) dialog);
	_g_object_unref0 (dialog);
}


gboolean contacts_contact_editor_avatar_changed (ContactsContactEditor* self) {
	gboolean result = FALSE;
	ContactsContactFrame* _tmp0_;
	gconstpointer _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->avatar_frame;
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "changed");
	result = (gboolean) ((gintptr) _tmp1_);
	return result;
}


void contacts_contact_editor_get_avatar_value (ContactsContactEditor* self, GValue* result) {
	GIcon* icon = NULL;
	ContactsContactFrame* _tmp0_;
	gconstpointer _tmp1_;
	GIcon* _tmp2_;
	GValue v = {0};
	GType _tmp3_;
	GValue _tmp4_ = {0};
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->avatar_frame;
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "value");
	_tmp2_ = _g_object_ref0 ((GIcon*) _tmp1_);
	icon = _tmp2_;
	_tmp3_ = G_TYPE_FROM_INSTANCE ((GObject*) icon);
	g_value_init (&_tmp4_, _tmp3_);
	v = _tmp4_;
	g_value_set_object (&v, (GObject*) icon);
	*result = v;
	_g_object_unref0 (icon);
	return;
}


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


static void ___lambda65__gtk_editable_changed (GtkEditable* _sender, gpointer self) {
	__lambda65_ ((ContactsContactEditor*) self);
}


static void contacts_contact_editor_create_name_entry (ContactsContactEditor* self) {
	GtkEntry* _tmp0_;
	GtkEntry* _tmp1_;
	GtkEntry* _tmp2_;
	GtkEntry* _tmp3_;
	GtkEntry* _tmp4_;
	ContactsContact* _tmp5_;
	GtkEntry* _tmp10_;
	GtkGrid* _tmp11_;
	GtkEntry* _tmp12_;
	g_return_if_fail (self != NULL);
	_tmp0_ = (GtkEntry*) gtk_entry_new ();
	g_object_ref_sink (_tmp0_);
	_g_object_unref0 (self->priv->name_entry);
	self->priv->name_entry = _tmp0_;
	_tmp1_ = self->priv->name_entry;
	gtk_widget_set_hexpand ((GtkWidget*) _tmp1_, TRUE);
	_tmp2_ = self->priv->name_entry;
	gtk_widget_set_valign ((GtkWidget*) _tmp2_, GTK_ALIGN_CENTER);
	_tmp3_ = self->priv->name_entry;
	gtk_entry_set_placeholder_text (_tmp3_, _ ("Add name"));
	_tmp4_ = self->priv->name_entry;
	g_object_set_data_full ((GObject*) _tmp4_, "changed", (gpointer) ((gintptr) FALSE), NULL);
	_tmp5_ = self->priv->contact;
	if (_tmp5_ != NULL) {
		GtkEntry* _tmp6_;
		ContactsContact* _tmp7_;
		const gchar* _tmp8_;
		const gchar* _tmp9_;
		_tmp6_ = self->priv->name_entry;
		_tmp7_ = self->priv->contact;
		_tmp8_ = contacts_contact_get_display_name (_tmp7_);
		_tmp9_ = _tmp8_;
		gtk_entry_set_text (_tmp6_, _tmp9_);
	}
	_tmp10_ = self->priv->name_entry;
	g_signal_connect_object ((GtkEditable*) _tmp10_, "changed", (GCallback) ___lambda65__gtk_editable_changed, self, 0);
	_tmp11_ = self->priv->container_grid;
	_tmp12_ = self->priv->name_entry;
	gtk_grid_attach (_tmp11_, (GtkWidget*) _tmp12_, 1, 0, 3, 3);
}


gboolean contacts_contact_editor_name_changed (ContactsContactEditor* self) {
	gboolean result = FALSE;
	GtkEntry* _tmp0_;
	gconstpointer _tmp1_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->name_entry;
	_tmp1_ = g_object_get_data ((GObject*) _tmp0_, "changed");
	result = (gboolean) ((gintptr) _tmp1_);
	return result;
}


void contacts_contact_editor_get_full_name_value (ContactsContactEditor* self, GValue* result) {
	GValue v = {0};
	GValue _tmp0_ = {0};
	GtkEntry* _tmp1_;
	const gchar* _tmp2_;
	g_return_if_fail (self != NULL);
	g_value_init (&_tmp0_, G_TYPE_STRING);
	v = _tmp0_;
	_tmp1_ = self->priv->name_entry;
	_tmp2_ = gtk_entry_get_text (_tmp1_);
	g_value_set_string (&v, _tmp2_);
	*result = v;
	return;
}


gboolean contacts_contact_editor_get_has_birthday_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_birthday_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_birthday_row (ContactsContactEditor* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (contacts_contact_editor_get_has_birthday_row (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_has_birthday_row = _tmp0_;
		g_object_notify ((GObject *) self, "has-birthday-row");
	}
}


gboolean contacts_contact_editor_get_has_nickname_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_nickname_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_nickname_row (ContactsContactEditor* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (contacts_contact_editor_get_has_nickname_row (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_has_nickname_row = _tmp0_;
		g_object_notify ((GObject *) self, "has-nickname-row");
	}
}


gboolean contacts_contact_editor_get_has_notes_row (ContactsContactEditor* self) {
	gboolean result;
	gboolean _tmp0_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp0_ = self->priv->_has_notes_row;
	result = _tmp0_;
	return result;
}


static void contacts_contact_editor_set_has_notes_row (ContactsContactEditor* self, gboolean value) {
	g_return_if_fail (self != NULL);
	if (contacts_contact_editor_get_has_notes_row (self) != value) {
		gboolean _tmp0_;
		_tmp0_ = value;
		self->priv->_has_notes_row = _tmp0_;
		g_object_notify ((GObject *) self, "has-notes-row");
	}
}


void contacts_contact_editor_property_data_copy (const ContactsContactEditorPropertyData* self, ContactsContactEditorPropertyData* dest) {
	FolksPersona* _tmp0_;
	FolksPersona* _tmp1_;
	GValue _tmp2_;
	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_;
	FolksAbstractFieldDetails* _tmp1_;
	_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_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	_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) {
	gint ContactsContactEditor_private_offset;
	contacts_contact_editor_parent_class = g_type_class_peek_parent (klass);
	g_type_class_add_private (klass, sizeof (ContactsContactEditorPrivate));
	G_OBJECT_CLASS (klass)->get_property = _vala_contacts_contact_editor_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_contacts_contact_editor_set_property;
	G_OBJECT_CLASS (klass)->finalize = contacts_contact_editor_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW, g_param_spec_boolean ("has-birthday-row", "has-birthday-row", "has-birthday-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW, g_param_spec_boolean ("has-nickname-row", "has-nickname-row", "has-nickname-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW, g_param_spec_boolean ("has-notes-row", "has-notes-row", "has-notes-row", FALSE, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
	ContactsContactEditor_private_offset = g_type_class_get_instance_private_offset (klass);
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/org/gnome/contacts/ui/contacts-contact-editor.ui");
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "main_sw", FALSE, ContactsContactEditor_private_offset + G_STRUCT_OFFSET (ContactsContactEditorPrivate, main_sw));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "add_detail_button", FALSE, ContactsContactEditor_private_offset + G_STRUCT_OFFSET (ContactsContactEditorPrivate, add_detail_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "linked_button", FALSE, G_STRUCT_OFFSET (ContactsContactEditor, linked_button));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "remove_button", FALSE, G_STRUCT_OFFSET (ContactsContactEditor, remove_button));
}


static void contacts_contact_editor_instance_init (ContactsContactEditor * self) {
	self->priv = CONTACTS_CONTACT_EDITOR_GET_PRIVATE (self);
	self->priv->_has_birthday_row = FALSE;
	self->priv->_has_nickname_row = FALSE;
	self->priv->_has_notes_row = FALSE;
	gtk_widget_init_template (GTK_WIDGET (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->container_grid);
	_g_object_unref0 (self->priv->name_entry);
	_g_object_unref0 (self->priv->avatar_frame);
	_g_object_unref0 (self->priv->main_sw);
	_g_object_unref0 (self->priv->add_detail_button);
	_g_object_unref0 (self->linked_button);
	_g_object_unref0 (self->remove_button);
	_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_grid_get_type (), "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_contacts_contact_editor_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	switch (property_id) {
		case CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_birthday_row (self));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_nickname_row (self));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW:
		g_value_set_boolean (value, contacts_contact_editor_get_has_notes_row (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


static void _vala_contacts_contact_editor_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
	ContactsContactEditor * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, CONTACTS_TYPE_CONTACT_EDITOR, ContactsContactEditor);
	switch (property_id) {
		case CONTACTS_CONTACT_EDITOR_HAS_BIRTHDAY_ROW:
		contacts_contact_editor_set_has_birthday_row (self, g_value_get_boolean (value));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NICKNAME_ROW:
		contacts_contact_editor_set_has_nickname_row (self, g_value_get_boolean (value));
		break;
		case CONTACTS_CONTACT_EDITOR_HAS_NOTES_ROW:
		contacts_contact_editor_set_has_notes_row (self, g_value_get_boolean (value));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}


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);
}


static gint _vala_array_length (gpointer array) {
	int length;
	length = 0;
	if (array) {
		while (((gpointer*) array)[length]) {
			length++;
		}
	}
	return length;
}



