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

#include <adwaita.h>
#include <glib-object.h>
#include <gtksourceview/gtksource.h>
#include <gtk/gtk.h>
#include <gee.h>
#include <glib.h>
#include <gio/gio.h>
#include <stdlib.h>
#include <string.h>
#include <glib/gi18n-lib.h>
#include <gdk/gdk.h>
#include <libsoup/soup.h>
#include <libspelling.h>

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

#define TUBA_DIALOGS_TYPE_PROFILE_EDIT (tuba_dialogs_profile_edit_get_type ())
#define TUBA_DIALOGS_PROFILE_EDIT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEdit))
#define TUBA_DIALOGS_PROFILE_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEditClass))
#define TUBA_DIALOGS_IS_PROFILE_EDIT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_PROFILE_EDIT))
#define TUBA_DIALOGS_IS_PROFILE_EDIT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_PROFILE_EDIT))
#define TUBA_DIALOGS_PROFILE_EDIT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEditClass))

typedef struct _TubaDialogsProfileEdit TubaDialogsProfileEdit;
typedef struct _TubaDialogsProfileEditClass TubaDialogsProfileEditClass;
typedef struct _TubaDialogsProfileEditPrivate TubaDialogsProfileEditPrivate;

#define TUBA_TYPE_ENTITY (tuba_entity_get_type ())
#define TUBA_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ENTITY, TubaEntity))
#define TUBA_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ENTITY, TubaEntityClass))
#define TUBA_IS_ENTITY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ENTITY))
#define TUBA_IS_ENTITY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ENTITY))
#define TUBA_ENTITY_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ENTITY, TubaEntityClass))

typedef struct _TubaEntity TubaEntity;
typedef struct _TubaEntityClass TubaEntityClass;

#define TUBA_API_TYPE_ACCOUNT (tuba_api_account_get_type ())
#define TUBA_API_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccount))
#define TUBA_API_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))
#define TUBA_API_IS_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_IS_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT))
#define TUBA_API_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT, TubaAPIAccountClass))

typedef struct _TubaAPIAccount TubaAPIAccount;
typedef struct _TubaAPIAccountClass TubaAPIAccountClass;

#define TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD (tuba_dialogs_profile_edit_field_get_type ())
#define TUBA_DIALOGS_PROFILE_EDIT_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, TubaDialogsProfileEditField))
#define TUBA_DIALOGS_PROFILE_EDIT_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, TubaDialogsProfileEditFieldClass))
#define TUBA_DIALOGS_PROFILE_EDIT_IS_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD))
#define TUBA_DIALOGS_PROFILE_EDIT_IS_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD))
#define TUBA_DIALOGS_PROFILE_EDIT_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, TubaDialogsProfileEditFieldClass))

typedef struct _TubaDialogsProfileEditField TubaDialogsProfileEditField;
typedef struct _TubaDialogsProfileEditFieldClass TubaDialogsProfileEditFieldClass;
enum  {
	TUBA_DIALOGS_PROFILE_EDIT_0_PROPERTY,
	TUBA_DIALOGS_PROFILE_EDIT_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_profile_edit_properties[TUBA_DIALOGS_PROFILE_EDIT_NUM_PROPERTIES];
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))

#define TUBA_TYPE_APPLICATION (tuba_application_get_type ())
#define TUBA_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_APPLICATION, TubaApplication))
#define TUBA_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_APPLICATION, TubaApplicationClass))
#define TUBA_IS_APPLICATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_APPLICATION))
#define TUBA_IS_APPLICATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_APPLICATION))
#define TUBA_APPLICATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_APPLICATION, TubaApplicationClass))

typedef struct _TubaApplication TubaApplication;
typedef struct _TubaApplicationClass TubaApplicationClass;
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))

#define TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2 (tuba_widgets_custom_emoji_chooser_v2_get_type ())
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2Class))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2))
#define TUBA_WIDGETS_IS_CUSTOM_EMOJI_CHOOSER_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2))
#define TUBA_WIDGETS_CUSTOM_EMOJI_CHOOSER_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2, TubaWidgetsCustomEmojiChooserV2Class))

typedef struct _TubaWidgetsCustomEmojiChooserV2 TubaWidgetsCustomEmojiChooserV2;
typedef struct _TubaWidgetsCustomEmojiChooserV2Class TubaWidgetsCustomEmojiChooserV2Class;

#define TUBA_TYPE_ACCOUNT_STORE (tuba_account_store_get_type ())
#define TUBA_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStore))
#define TUBA_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))
#define TUBA_IS_ACCOUNT_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_IS_ACCOUNT_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_ACCOUNT_STORE))
#define TUBA_ACCOUNT_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_ACCOUNT_STORE, TubaAccountStoreClass))

typedef struct _TubaAccountStore TubaAccountStore;
typedef struct _TubaAccountStoreClass TubaAccountStoreClass;

#define TUBA_TYPE_INSTANCE_ACCOUNT (tuba_instance_account_get_type ())
#define TUBA_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccount))
#define TUBA_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))
#define TUBA_IS_INSTANCE_ACCOUNT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_IS_INSTANCE_ACCOUNT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_INSTANCE_ACCOUNT))
#define TUBA_INSTANCE_ACCOUNT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_INSTANCE_ACCOUNT, TubaInstanceAccountClass))

typedef struct _TubaInstanceAccount TubaInstanceAccount;
typedef struct _TubaInstanceAccountClass TubaInstanceAccountClass;

#define TUBA_API_TYPE_INSTANCE (tuba_api_instance_get_type ())
#define TUBA_API_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstance))
#define TUBA_API_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))
#define TUBA_API_IS_INSTANCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_IS_INSTANCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_INSTANCE))
#define TUBA_API_INSTANCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_INSTANCE, TubaAPIInstanceClass))

typedef struct _TubaAPIInstance TubaAPIInstance;
typedef struct _TubaAPIInstanceClass TubaAPIInstanceClass;

#define TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS (tuba_api_instance_v2_configuration_accounts_char_limits_get_type ())
#define TUBA_API_INSTANCE_V2_CONFIGURATION_ACCOUNTS_CHAR_LIMITS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS, TubaAPIInstanceV2ConfigurationAccountsCharLimits))
#define TUBA_API_INSTANCE_V2_CONFIGURATION_ACCOUNTS_CHAR_LIMITS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS, TubaAPIInstanceV2ConfigurationAccountsCharLimitsClass))
#define TUBA_API_INSTANCE_V2_CONFIGURATION_IS_ACCOUNTS_CHAR_LIMITS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS))
#define TUBA_API_INSTANCE_V2_CONFIGURATION_IS_ACCOUNTS_CHAR_LIMITS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS))
#define TUBA_API_INSTANCE_V2_CONFIGURATION_ACCOUNTS_CHAR_LIMITS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_INSTANCE_V2_CONFIGURATION_TYPE_ACCOUNTS_CHAR_LIMITS, TubaAPIInstanceV2ConfigurationAccountsCharLimitsClass))

typedef struct _TubaAPIInstanceV2ConfigurationAccountsCharLimits TubaAPIInstanceV2ConfigurationAccountsCharLimits;
typedef struct _TubaAPIInstanceV2ConfigurationAccountsCharLimitsClass TubaAPIInstanceV2ConfigurationAccountsCharLimitsClass;

#define TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS (tuba_api_instance_v2_api_versions_get_type ())
#define TUBA_API_INSTANCE_V2_API_VERSIONS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS, TubaAPIInstanceV2APIVersions))
#define TUBA_API_INSTANCE_V2_API_VERSIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS, TubaAPIInstanceV2APIVersionsClass))
#define TUBA_API_INSTANCE_V2_IS_API_VERSIONS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS))
#define TUBA_API_INSTANCE_V2_IS_API_VERSIONS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS))
#define TUBA_API_INSTANCE_V2_API_VERSIONS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_INSTANCE_V2_TYPE_API_VERSIONS, TubaAPIInstanceV2APIVersionsClass))

typedef struct _TubaAPIInstanceV2APIVersions TubaAPIInstanceV2APIVersions;
typedef struct _TubaAPIInstanceV2APIVersionsClass TubaAPIInstanceV2APIVersionsClass;
typedef void (*TubaHelperImageOnItemChangedFn) (GdkPaintable* data, gpointer user_data);

#define TUBA_API_TYPE_ACCOUNT_SOURCE (tuba_api_account_source_get_type ())
#define TUBA_API_ACCOUNT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT_SOURCE, TubaAPIAccountSource))
#define TUBA_API_ACCOUNT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT_SOURCE, TubaAPIAccountSourceClass))
#define TUBA_API_IS_ACCOUNT_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT_SOURCE))
#define TUBA_API_IS_ACCOUNT_SOURCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT_SOURCE))
#define TUBA_API_ACCOUNT_SOURCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT_SOURCE, TubaAPIAccountSourceClass))

typedef struct _TubaAPIAccountSource TubaAPIAccountSource;
typedef struct _TubaAPIAccountSourceClass TubaAPIAccountSourceClass;

#define TUBA_API_TYPE_ACCOUNT_FIELD (tuba_api_account_field_get_type ())
#define TUBA_API_ACCOUNT_FIELD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_ACCOUNT_FIELD, TubaAPIAccountField))
#define TUBA_API_ACCOUNT_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_ACCOUNT_FIELD, TubaAPIAccountFieldClass))
#define TUBA_API_IS_ACCOUNT_FIELD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_ACCOUNT_FIELD))
#define TUBA_API_IS_ACCOUNT_FIELD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_ACCOUNT_FIELD))
#define TUBA_API_ACCOUNT_FIELD_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_ACCOUNT_FIELD, TubaAPIAccountFieldClass))

typedef struct _TubaAPIAccountField TubaAPIAccountField;
typedef struct _TubaAPIAccountFieldClass TubaAPIAccountFieldClass;
typedef struct _Block31Data Block31Data;

#define TUBA_DIALOGS_TYPE_MAIN_WINDOW (tuba_dialogs_main_window_get_type ())
#define TUBA_DIALOGS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindow))
#define TUBA_DIALOGS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))
#define TUBA_DIALOGS_IS_MAIN_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_DIALOGS_TYPE_MAIN_WINDOW))
#define TUBA_DIALOGS_MAIN_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_DIALOGS_TYPE_MAIN_WINDOW, TubaDialogsMainWindowClass))

typedef struct _TubaDialogsMainWindow TubaDialogsMainWindow;
typedef struct _TubaDialogsMainWindowClass TubaDialogsMainWindowClass;

#define TUBA_TYPE_REQUEST_V2 (tuba_request_v2_get_type ())
#define TUBA_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2))
#define TUBA_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))
#define TUBA_IS_REQUEST_V2(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_TYPE_REQUEST_V2))
#define TUBA_IS_REQUEST_V2_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_TYPE_REQUEST_V2))
#define TUBA_REQUEST_V2_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_TYPE_REQUEST_V2, TubaRequestV2Class))

typedef struct _TubaRequestV2 TubaRequestV2;
typedef struct _TubaRequestV2Class TubaRequestV2Class;
typedef enum  {
	TUBA_REQUEST_V2_METHOD_GET,
	TUBA_REQUEST_V2_METHOD_POST,
	TUBA_REQUEST_V2_METHOD_PUT,
	TUBA_REQUEST_V2_METHOD_DELETE,
	TUBA_REQUEST_V2_METHOD_PATCH
} TubaRequestV2Method;

#define TUBA_REQUEST_V2_TYPE_METHOD (tuba_request_v2_method_get_type ())
#define _g_bytes_unref0(var) ((var == NULL) ? NULL : (var = (g_bytes_unref (var), NULL)))

#define TUBA_TYPE_OOPSIE (tuba_oopsie_get_type ())
typedef struct _TubaDialogsProfileEditSaveData TubaDialogsProfileEditSaveData;
typedef struct _TubaDialogsProfileEditFieldPrivate TubaDialogsProfileEditFieldPrivate;
enum  {
	TUBA_DIALOGS_PROFILE_EDIT_FIELD_0_PROPERTY,
	TUBA_DIALOGS_PROFILE_EDIT_FIELD_KEY_PROPERTY,
	TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALUE_PROPERTY,
	TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALID_PROPERTY,
	TUBA_DIALOGS_PROFILE_EDIT_FIELD_NUM_PROPERTIES
};
static GParamSpec* tuba_dialogs_profile_edit_field_properties[TUBA_DIALOGS_PROFILE_EDIT_FIELD_NUM_PROPERTIES];

#define TUBA_API_TYPE_EMOJI (tuba_api_emoji_get_type ())
#define TUBA_API_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmoji))
#define TUBA_API_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))
#define TUBA_API_IS_EMOJI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), TUBA_API_TYPE_EMOJI))
#define TUBA_API_IS_EMOJI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), TUBA_API_TYPE_EMOJI))
#define TUBA_API_EMOJI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), TUBA_API_TYPE_EMOJI, TubaAPIEmojiClass))

typedef struct _TubaAPIEmoji TubaAPIEmoji;
typedef struct _TubaAPIEmojiClass TubaAPIEmojiClass;
typedef enum  {
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_NONE = 1 << 0,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_QUOTE = 1 << 1,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_EMOJI_REACTIONS = 1 << 2,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_BUBBLE = 1 << 3,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_GROUP_NOTIFICATIONS = 1 << 4,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_FEATURE_TAGS = 1 << 5,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_ENDORSE_USERS = 1 << 6,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_MUTUALS = 1 << 7,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_TRANSLATION = 1 << 8,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_ICESHRIMP = 1 << 9,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_GLITCH = 1 << 10,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_LOCAL_ONLY = 1 << 11,
	TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_GOTOSOCIAL = 1 << 12
} TubaInstanceAccountInstanceFeatures;

#define TUBA_INSTANCE_ACCOUNT_TYPE_INSTANCE_FEATURES (tuba_instance_account_instance_features_get_type ())
enum  {
	TUBA_DIALOGS_PROFILE_EDIT_SAVED_SIGNAL,
	TUBA_DIALOGS_PROFILE_EDIT_NUM_SIGNALS
};
static guint tuba_dialogs_profile_edit_signals[TUBA_DIALOGS_PROFILE_EDIT_NUM_SIGNALS] = {0};

struct _TubaDialogsProfileEdit {
	AdwDialog parent_instance;
	TubaDialogsProfileEditPrivate * priv;
};

struct _TubaDialogsProfileEditClass {
	AdwDialogClass parent_class;
};

struct _TubaDialogsProfileEditPrivate {
	AdwEntryRow* name_row;
	AdwExpanderRow* bio_row;
	GtkSourceView* bio_text_view;
	AdwAvatar* avi;
	GtkPicture* background;
	AdwPreferencesGroup* fields_box;
	GtkMenuButton* cepbtn;
	AdwPreferencesGroup* alt_text_group;
	AdwEntryRow* avi_alt_text_row;
	AdwEntryRow* header_alt_text_row;
	AdwPreferencesGroup* display_group;
	AdwSwitchRow* featured_row;
	AdwSwitchRow* media_row;
	AdwSwitchRow* media_replies_row;
	AdwPreferencesGroup* gotosocial_group;
	AdwSwitchRow* rss_row;
	GtkFileFilter* filter;
	TubaAPIAccount* _profile;
	GeeArrayList* fields;
	AdwButtonRow* add_field_row;
	gint64 max_fields;
	gint64 max_key_length;
	gint64 max_value_length;
	gint64 max_name_length;
	gint64 max_bio_length;
	gint64 max_avi_alt_length;
	gint64 max_cover_alt_length;
	GFile* new_avi;
	GFile* new_header;
};

struct _Block31Data {
	int _ref_count_;
	TubaDialogsProfileEdit* self;
	GtkFileDialog* chooser;
	gboolean for_header;
};

typedef enum  {
	TUBA_OOPSIE_USER,
	TUBA_OOPSIE_PARSING,
	TUBA_OOPSIE_INSTANCE,
	TUBA_OOPSIE_INTERNAL,
	TUBA_OOPSIE_HTTP_401 = 401,
	TUBA_OOPSIE_HTTP_403 = 403,
	TUBA_OOPSIE_HTTP_404 = 404,
	TUBA_OOPSIE_HTTP_410 = 410,
	TUBA_OOPSIE_HTTP_422 = 422,
	TUBA_OOPSIE_HTTP_429 = 429,
	TUBA_OOPSIE_HTTP_500 = 500,
	TUBA_OOPSIE_HTTP_503 = 503
} TubaOopsie;
#define TUBA_OOPSIE tuba_oopsie_quark ()

struct _TubaDialogsProfileEditSaveData {
	int _state_;
	GObject* _source_object_;
	GAsyncResult* _res_;
	GTask* _async_result;
	TubaDialogsProfileEdit* self;
	TubaRequestV2* req;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaInstanceAccount* _tmp3_;
	TubaRequestV2* _tmp4_;
	gboolean _tmp5_;
	AdwEntryRow* _tmp6_;
	TubaAPIAccount* _tmp7_;
	const gchar* _tmp8_;
	const gchar* _tmp9_;
	AdwEntryRow* _tmp10_;
	const gchar* _tmp11_;
	const gchar* _tmp12_;
	TubaRequestV2* _tmp13_;
	AdwEntryRow* _tmp14_;
	const gchar* _tmp15_;
	const gchar* _tmp16_;
	gboolean _tmp17_;
	gboolean _tmp18_;
	AdwExpanderRow* _tmp19_;
	TubaAPIAccount* _tmp20_;
	TubaAPIAccountSource* _tmp21_;
	TubaAPIAccountSource* _tmp22_;
	TubaAPIAccount* _tmp23_;
	TubaAPIAccountSource* _tmp24_;
	TubaAPIAccountSource* _tmp25_;
	const gchar* _tmp26_;
	const gchar* _tmp27_;
	GtkSourceView* _tmp28_;
	GtkTextBuffer* _tmp29_;
	GtkTextBuffer* _tmp30_;
	gchar* _tmp31_;
	gchar* _tmp32_;
	gchar* _tmp33_;
	TubaRequestV2* _tmp34_;
	GtkSourceView* _tmp35_;
	GtkTextBuffer* _tmp36_;
	GtkTextBuffer* _tmp37_;
	gchar* _tmp38_;
	gchar* _tmp39_;
	gchar* _tmp40_;
	AdwPreferencesGroup* _tmp41_;
	gboolean _tmp42_;
	gboolean _tmp43_;
	gboolean _tmp44_;
	AdwEntryRow* _tmp45_;
	TubaAPIAccount* _tmp46_;
	const gchar* _tmp47_;
	const gchar* _tmp48_;
	AdwEntryRow* _tmp49_;
	const gchar* _tmp50_;
	const gchar* _tmp51_;
	TubaRequestV2* _tmp52_;
	AdwEntryRow* _tmp53_;
	const gchar* _tmp54_;
	const gchar* _tmp55_;
	gboolean _tmp56_;
	AdwEntryRow* _tmp57_;
	TubaAPIAccount* _tmp58_;
	const gchar* _tmp59_;
	const gchar* _tmp60_;
	AdwEntryRow* _tmp61_;
	const gchar* _tmp62_;
	const gchar* _tmp63_;
	TubaRequestV2* _tmp64_;
	AdwEntryRow* _tmp65_;
	const gchar* _tmp66_;
	const gchar* _tmp67_;
	AdwPreferencesGroup* _tmp68_;
	gboolean _tmp69_;
	gboolean _tmp70_;
	AdwSwitchRow* _tmp71_;
	gboolean _tmp72_;
	gboolean _tmp73_;
	TubaAPIAccount* _tmp74_;
	gboolean _tmp75_;
	gboolean _tmp76_;
	TubaRequestV2* _tmp77_;
	AdwSwitchRow* _tmp78_;
	gboolean _tmp79_;
	gboolean _tmp80_;
	gchar* _tmp81_;
	gchar* _tmp82_;
	gint i;
	GeeArrayList* _field_list;
	GeeArrayList* _tmp83_;
	gint _field_size;
	GeeArrayList* _tmp84_;
	gint _tmp85_;
	gint _tmp86_;
	gint _field_index;
	gint _tmp87_;
	gint _tmp88_;
	TubaDialogsProfileEditField* field;
	GeeArrayList* _tmp89_;
	gpointer _tmp90_;
	const gchar* _tmp91_;
	TubaDialogsProfileEditField* _tmp92_;
	gboolean _tmp93_;
	gboolean _tmp94_;
	TubaDialogsProfileEditField* _tmp95_;
	const gchar* _tmp96_;
	const gchar* _tmp97_;
	TubaRequestV2* _tmp98_;
	gchar* _tmp99_;
	gchar* _tmp100_;
	gchar* _tmp101_;
	gchar* _tmp102_;
	const gchar* _tmp103_;
	TubaDialogsProfileEditField* _tmp104_;
	gboolean _tmp105_;
	gboolean _tmp106_;
	TubaDialogsProfileEditField* _tmp107_;
	const gchar* _tmp108_;
	const gchar* _tmp109_;
	TubaRequestV2* _tmp110_;
	gchar* _tmp111_;
	gchar* _tmp112_;
	gchar* _tmp113_;
	gchar* _tmp114_;
	gint _tmp115_;
	GFile* _tmp116_;
	gchar* mime;
	GBytes* buffer;
	GFile* _tmp117_;
	gchar* _tmp118_;
	GBytes* _tmp119_;
	TubaRequestV2* _tmp120_;
	const gchar* _tmp121_;
	GBytes* _tmp122_;
	GFile* _tmp123_;
	gchar* _vala1_mime;
	GBytes* _vala1_buffer;
	GFile* _tmp124_;
	gchar* _tmp125_;
	GBytes* _tmp126_;
	TubaRequestV2* _tmp127_;
	const gchar* _tmp128_;
	GBytes* _tmp129_;
	TubaRequestV2* _tmp130_;
	gboolean _tmp131_;
	gboolean _tmp132_;
	GInputStream* in_stream;
	TubaRequestV2* _tmp133_;
	GInputStream* _tmp134_;
	TubaAccountStore* _tmp135_;
	TubaInstanceAccount* _tmp136_;
	TubaInstanceAccount* _tmp137_;
	GInputStream* _tmp138_;
	gboolean _tmp139_;
	AdwPreferencesGroup* _tmp140_;
	gboolean _tmp141_;
	gboolean _tmp142_;
	gboolean _tmp143_;
	gboolean _tmp144_;
	TubaAPIAccount* _tmp145_;
	gboolean _tmp146_;
	gboolean _tmp147_;
	AdwSwitchRow* _tmp148_;
	gboolean _tmp149_;
	gboolean _tmp150_;
	TubaAPIAccount* _tmp151_;
	gboolean _tmp152_;
	gboolean _tmp153_;
	AdwSwitchRow* _tmp154_;
	gboolean _tmp155_;
	gboolean _tmp156_;
	TubaAPIAccount* _tmp157_;
	gboolean _tmp158_;
	gboolean _tmp159_;
	AdwSwitchRow* _tmp160_;
	gboolean _tmp161_;
	gboolean _tmp162_;
	TubaRequestV2* req2;
	TubaAccountStore* _tmp163_;
	TubaInstanceAccount* _tmp164_;
	TubaInstanceAccount* _tmp165_;
	TubaInstanceAccount* _tmp166_;
	TubaRequestV2* _tmp167_;
	TubaRequestV2* _tmp168_;
	AdwSwitchRow* _tmp169_;
	gboolean _tmp170_;
	gboolean _tmp171_;
	gchar* _tmp172_;
	gchar* _tmp173_;
	TubaRequestV2* _tmp174_;
	AdwSwitchRow* _tmp175_;
	gboolean _tmp176_;
	gboolean _tmp177_;
	gchar* _tmp178_;
	gchar* _tmp179_;
	AdwSwitchRow* _tmp180_;
	gboolean _tmp181_;
	gboolean _tmp182_;
	TubaRequestV2* _tmp183_;
	AdwSwitchRow* _tmp184_;
	gboolean _tmp185_;
	gboolean _tmp186_;
	gchar* _tmp187_;
	gchar* _tmp188_;
	TubaRequestV2* _tmp189_;
	GInputStream* _tmp190_;
	GInputStream* _tmp191_;
	TubaAccountStore* _tmp192_;
	TubaInstanceAccount* _tmp193_;
	TubaInstanceAccount* _tmp194_;
	AdwSwitchRow* _tmp195_;
	gboolean _tmp196_;
	gboolean _tmp197_;
	TubaAccountStore* _tmp198_;
	TubaInstanceAccount* _tmp199_;
	TubaInstanceAccount* _tmp200_;
	AdwSwitchRow* _tmp201_;
	gboolean _tmp202_;
	gboolean _tmp203_;
	TubaAccountStore* _tmp204_;
	TubaInstanceAccount* _tmp205_;
	TubaInstanceAccount* _tmp206_;
	AdwSwitchRow* _tmp207_;
	gboolean _tmp208_;
	gboolean _tmp209_;
	GError* _inner_error0_;
};

struct _TubaDialogsProfileEditField {
	AdwExpanderRow parent_instance;
	TubaDialogsProfileEditFieldPrivate * priv;
};

struct _TubaDialogsProfileEditFieldClass {
	AdwExpanderRowClass parent_class;
};

struct _TubaDialogsProfileEditFieldPrivate {
	AdwEntryRow* key_row;
	AdwEntryRow* value_row;
	gint64 max_key_length;
	gint64 max_value_length;
};

static gint TubaDialogsProfileEdit_private_offset;
static gpointer tuba_dialogs_profile_edit_parent_class = NULL;
VALA_EXTERN TubaApplication* tuba_app;
VALA_EXTERN TubaAccountStore* tuba_accounts;
static gint TubaDialogsProfileEditField_private_offset;
static gpointer tuba_dialogs_profile_edit_field_parent_class = NULL;

VALA_EXTERN GType tuba_dialogs_profile_edit_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsProfileEdit, g_object_unref)
VALA_EXTERN GType tuba_entity_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaEntity, g_object_unref)
VALA_EXTERN GType tuba_api_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccount, g_object_unref)
VALA_EXTERN GType tuba_dialogs_profile_edit_field_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsProfileEditField, g_object_unref)
static TubaAPIAccount* tuba_dialogs_profile_edit_get_profile (TubaDialogsProfileEdit* self);
VALA_EXTERN gchar* tuba_api_account_get_handle (TubaAPIAccount* self);
VALA_EXTERN void tuba_dialogs_profile_edit_update_style_scheme (TubaDialogsProfileEdit* self);
static void tuba_dialogs_profile_edit_on_close (TubaDialogsProfileEdit* self);
static void _tuba_dialogs_profile_edit_on_close_gtk_button_clicked (GtkButton* _sender,
                                                             gpointer self);
static void tuba_dialogs_profile_edit_on_avi_button_clicked (TubaDialogsProfileEdit* self);
static void tuba_dialogs_profile_edit_choose_file (TubaDialogsProfileEdit* self,
                                            gboolean for_header);
static void _tuba_dialogs_profile_edit_on_avi_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                          gpointer self);
static void tuba_dialogs_profile_edit_on_header_button_clicked (TubaDialogsProfileEdit* self);
static void _tuba_dialogs_profile_edit_on_header_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                             gpointer self);
static void tuba_dialogs_profile_edit_on_save_clicked (TubaDialogsProfileEdit* self);
static void tuba_dialogs_profile_edit_save (TubaDialogsProfileEdit* self,
                                     GAsyncReadyCallback _callback_,
                                     gpointer _user_data_);
static void tuba_dialogs_profile_edit_save_finish (TubaDialogsProfileEdit* self,
                                            GAsyncResult* _res_,
                                            GError** error);
static void __lambda152_ (TubaDialogsProfileEdit* self,
                   GObject* obj,
                   GAsyncResult* res);
VALA_EXTERN GType tuba_application_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaApplication, g_object_unref)
VALA_EXTERN AdwAlertDialog* tuba_application_inform (TubaApplication* self,
                                         const gchar* text,
                                         const gchar* msg);
static void ___lambda152__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void _tuba_dialogs_profile_edit_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                    gpointer self);
static void tuba_dialogs_profile_edit_on_bio_emoji_picked (TubaDialogsProfileEdit* self,
                                                    const gchar* emoji_unicode);
VALA_EXTERN GType tuba_widgets_custom_emoji_chooser_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaWidgetsCustomEmojiChooserV2, g_object_unref)
static void _tuba_dialogs_profile_edit_on_bio_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked (TubaWidgetsCustomEmojiChooserV2* _sender,
                                                                                                       const gchar* shortcode,
                                                                                                       gpointer self);
static gboolean tuba_dialogs_profile_edit_has_error (TubaDialogsProfileEdit* self,
                                              GtkWidget* wdg);
static void tuba_dialogs_profile_edit_on_name_row_changed (TubaDialogsProfileEdit* self);
VALA_EXTERN gint tuba_utils_counting_chars (const gchar* content,
                                const gchar* language);
VALA_EXTERN void tuba_toggle_css (GtkWidget* wdg,
                      gboolean state,
                      const gchar* style);
static void _tuba_dialogs_profile_edit_on_name_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self);
static void tuba_dialogs_profile_edit_on_bio_text_changed (TubaDialogsProfileEdit* self);
static void tuba_dialogs_profile_edit_on_avi_alt_text_row_changed (TubaDialogsProfileEdit* self);
static void _tuba_dialogs_profile_edit_on_avi_alt_text_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                  gpointer self);
static void tuba_dialogs_profile_edit_on_header_alt_text_row_changed (TubaDialogsProfileEdit* self);
static void _tuba_dialogs_profile_edit_on_header_alt_text_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                     gpointer self);
VALA_EXTERN TubaDialogsProfileEdit* tuba_dialogs_profile_edit_new (TubaAPIAccount* acc);
VALA_EXTERN TubaDialogsProfileEdit* tuba_dialogs_profile_edit_construct (GType object_type,
                                                             TubaAPIAccount* acc);
VALA_EXTERN GType tuba_account_store_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAccountStore, g_object_unref)
VALA_EXTERN GType tuba_instance_account_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaInstanceAccount, g_object_unref)
VALA_EXTERN TubaInstanceAccount* tuba_account_store_get_active (TubaAccountStore* self);
VALA_EXTERN GType tuba_api_instance_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstance, g_object_unref)
VALA_EXTERN TubaAPIInstance* tuba_instance_account_get_instance_info (TubaInstanceAccount* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_fields_limits_max_fields (TubaAPIInstance* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_fields_limits_name_length (TubaAPIInstance* self);
VALA_EXTERN gint64 tuba_api_instance_get_compat_fields_limits_value_length (TubaAPIInstance* self);
VALA_EXTERN GType tuba_api_instance_v2_configuration_accounts_char_limits_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstanceV2ConfigurationAccountsCharLimits, g_object_unref)
VALA_EXTERN TubaAPIInstanceV2ConfigurationAccountsCharLimits* tuba_api_instance_get_tuba_limits (TubaAPIInstance* self);
VALA_EXTERN gint64 tuba_api_instance_v2_configuration_accounts_char_limits_get_max_display_name_length (TubaAPIInstanceV2ConfigurationAccountsCharLimits* self);
VALA_EXTERN gint64 tuba_api_instance_v2_configuration_accounts_char_limits_get_max_note_length (TubaAPIInstanceV2ConfigurationAccountsCharLimits* self);
VALA_EXTERN gint64 tuba_api_instance_v2_configuration_accounts_char_limits_get_max_avatar_description_length (TubaAPIInstanceV2ConfigurationAccountsCharLimits* self);
VALA_EXTERN gint64 tuba_api_instance_v2_configuration_accounts_char_limits_get_max_header_description_length (TubaAPIInstanceV2ConfigurationAccountsCharLimits* self);
VALA_EXTERN const gchar* tuba_api_account_get_avatar_description (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_account_get_header_description (TubaAPIAccount* self);
VALA_EXTERN GType tuba_api_instance_v2_api_versions_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIInstanceV2APIVersions, g_object_unref)
VALA_EXTERN TubaAPIInstanceV2APIVersions* tuba_instance_account_get_tuba_api_versions (TubaInstanceAccount* self);
VALA_EXTERN gint8 tuba_api_instance_v2_api_versions_get_mastodon (TubaAPIInstanceV2APIVersions* self);
VALA_EXTERN gboolean tuba_api_account_get_show_featured (TubaAPIAccount* self);
VALA_EXTERN gboolean tuba_api_account_get_show_media (TubaAPIAccount* self);
VALA_EXTERN gboolean tuba_api_account_get_show_media_replies (TubaAPIAccount* self);
static void tuba_dialogs_profile_edit_set_profile (TubaDialogsProfileEdit* self,
                                            TubaAPIAccount* value);
VALA_EXTERN void tuba_helper_image_request_paintable (const gchar* url,
                                          const gchar* blurhash,
                                          gboolean disable_cache,
                                          TubaHelperImageOnItemChangedFn cb,
                                          gpointer cb_target,
                                          GDestroyNotify cb_target_destroy_notify,
                                          GCancellable* cancellable);
VALA_EXTERN const gchar* tuba_api_account_get_header (TubaAPIAccount* self);
static void tuba_dialogs_profile_edit_on_background_cache_response (TubaDialogsProfileEdit* self,
                                                             GdkPaintable* data);
static void _tuba_dialogs_profile_edit_on_background_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                                   gpointer self);
VALA_EXTERN const gchar* tuba_api_account_get_avatar (TubaAPIAccount* self);
static void tuba_dialogs_profile_edit_on_avi_cache_response (TubaDialogsProfileEdit* self,
                                                      GdkPaintable* data);
static void _tuba_dialogs_profile_edit_on_avi_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                            gpointer self);
VALA_EXTERN const gchar* tuba_api_account_get_display_name (TubaAPIAccount* self);
VALA_EXTERN GType tuba_api_account_source_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccountSource, g_object_unref)
VALA_EXTERN TubaAPIAccountSource* tuba_api_account_get_source (TubaAPIAccount* self);
VALA_EXTERN const gchar* tuba_api_account_source_get_note (TubaAPIAccountSource* self);
VALA_EXTERN gboolean tuba_api_account_get_enable_rss (TubaAPIAccount* self);
VALA_EXTERN GType tuba_api_account_field_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIAccountField, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_api_account_source_get_fields (TubaAPIAccountSource* self);
static void tuba_dialogs_profile_edit_add_field (TubaDialogsProfileEdit* self,
                                          const gchar* key,
                                          const gchar* value);
VALA_EXTERN const gchar* tuba_api_account_field_get_name (TubaAPIAccountField* self);
VALA_EXTERN const gchar* tuba_api_account_field_get_val (TubaAPIAccountField* self);
static void tuba_dialogs_profile_edit_on_add_field_activated (TubaDialogsProfileEdit* self);
static void _tuba_dialogs_profile_edit_on_add_field_activated_adw_button_row_activated (AdwButtonRow* _sender,
                                                                                 gpointer self);
VALA_EXTERN TubaDialogsProfileEditField* tuba_dialogs_profile_edit_field_new (const gchar* t_key,
                                                                  const gchar* t_value,
                                                                  gint64 t_max_key_length,
                                                                  gint64 t_max_value_length);
VALA_EXTERN TubaDialogsProfileEditField* tuba_dialogs_profile_edit_field_construct (GType object_type,
                                                                        const gchar* t_key,
                                                                        const gchar* t_value,
                                                                        gint64 t_max_key_length,
                                                                        gint64 t_max_value_length);
static Block31Data* block31_data_ref (Block31Data* _data31_);
static void block31_data_unref (void * _userdata_);
VALA_EXTERN GType tuba_dialogs_main_window_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaDialogsMainWindow, g_object_unref)
VALA_EXTERN TubaDialogsMainWindow* tuba_application_get_main_window (TubaApplication* self);
static void __lambda151_ (Block31Data* _data31_,
                   GObject* obj,
                   GAsyncResult* res);
static void ___lambda151__gasync_ready_callback (GObject* source_object,
                                          GAsyncResult* res,
                                          gpointer self);
static void tuba_dialogs_profile_edit_save_data_free (gpointer _data);
static gboolean tuba_dialogs_profile_edit_save_co (TubaDialogsProfileEditSaveData* _data_);
VALA_EXTERN GType tuba_request_v2_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaRequestV2, g_object_unref)
VALA_EXTERN GType tuba_request_v2_method_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaRequestV2* tuba_request_v2_new (const gchar* url,
                                    TubaRequestV2Method method);
VALA_EXTERN TubaRequestV2* tuba_request_v2_construct (GType object_type,
                                          const gchar* url,
                                          TubaRequestV2Method method);
VALA_EXTERN void tuba_request_v2_set_account (TubaRequestV2* self,
                                  TubaInstanceAccount* value);
VALA_EXTERN void tuba_request_v2_add_form_data (TubaRequestV2* self,
                                    const gchar* name,
                                    const gchar* val);
VALA_EXTERN gboolean tuba_dialogs_profile_edit_field_get_valid (TubaDialogsProfileEditField* self);
VALA_EXTERN const gchar* tuba_dialogs_profile_edit_field_get_key (TubaDialogsProfileEditField* self);
VALA_EXTERN const gchar* tuba_dialogs_profile_edit_field_get_value (TubaDialogsProfileEditField* self);
static void tuba_dialogs_profile_edit_image_data (TubaDialogsProfileEdit* self,
                                           GFile* file,
                                           gchar** mime,
                                           GBytes** buffer,
                                           GError** error);
VALA_EXTERN void tuba_request_v2_add_form_data_file (TubaRequestV2* self,
                                         const gchar* name,
                                         const gchar* mime,
                                         GBytes* buffer);
VALA_EXTERN gboolean tuba_request_v2_get_has_form_data (TubaRequestV2* self);
VALA_EXTERN void tuba_request_v2_exec (TubaRequestV2* self,
                           GAsyncReadyCallback _callback_,
                           gpointer _user_data_);
VALA_EXTERN GQuark tuba_oopsie_quark (void);
VALA_EXTERN GType tuba_oopsie_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GInputStream* tuba_request_v2_exec_finish (TubaRequestV2* self,
                                           GAsyncResult* _res_,
                                           SoupMessageHeaders** response_headers,
                                           GError** error);
static void tuba_dialogs_profile_edit_save_ready (GObject* source_object,
                                           GAsyncResult* _res_,
                                           gpointer _user_data_);
VALA_EXTERN void tuba_instance_account_update_object (TubaInstanceAccount* self,
                                          GInputStream* in_stream,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);
VALA_EXTERN void tuba_instance_account_update_object_finish (TubaInstanceAccount* self,
                                                 GAsyncResult* _res_,
                                                 GError** error);
VALA_EXTERN void tuba_api_account_set_show_featured (TubaAPIAccount* self,
                                         gboolean value);
VALA_EXTERN void tuba_api_account_set_show_media (TubaAPIAccount* self,
                                      gboolean value);
VALA_EXTERN void tuba_api_account_set_show_media_replies (TubaAPIAccount* self,
                                              gboolean value);
static guint8* _vala_array_dup17 (guint8* self,
                           gssize length);
static void tuba_dialogs_profile_edit_field_update_valid_style (TubaDialogsProfileEditField* self);
static void _tuba_dialogs_profile_edit_field_update_valid_style_gtk_editable_changed (GtkEditable* _sender,
                                                                               gpointer self);
static void tuba_dialogs_profile_edit_field_finalize (GObject * obj);
static GType tuba_dialogs_profile_edit_field_get_type_once (void);
static void _vala_tuba_dialogs_profile_edit_field_get_property (GObject * object,
                                                         guint property_id,
                                                         GValue * value,
                                                         GParamSpec * pspec);
static GObject * tuba_dialogs_profile_edit_constructor (GType type,
                                                 guint n_construct_properties,
                                                 GObjectConstructParam * construct_properties);
static void _tuba_dialogs_profile_edit_on_bio_text_changed_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                             gpointer self);
static void _tuba_dialogs_profile_edit_update_style_scheme_g_object_notify (GObject* _sender,
                                                                     GParamSpec* pspec,
                                                                     gpointer self);
VALA_EXTERN GType tuba_api_emoji_get_type (void) G_GNUC_CONST ;
G_DEFINE_AUTOPTR_CLEANUP_FUNC (TubaAPIEmoji, g_object_unref)
VALA_EXTERN GeeArrayList* tuba_instance_account_get_instance_emojis (TubaInstanceAccount* self);
VALA_EXTERN GType tuba_instance_account_instance_features_get_type (void) G_GNUC_CONST ;
VALA_EXTERN TubaInstanceAccountInstanceFeatures tuba_instance_account_get_tuba_instance_features (TubaInstanceAccount* self);
static void tuba_dialogs_profile_edit_finalize (GObject * obj);
static GType tuba_dialogs_profile_edit_get_type_once (void);
static void _vala_tuba_dialogs_profile_edit_get_property (GObject * object,
                                                   guint property_id,
                                                   GValue * value,
                                                   GParamSpec * pspec);
static void _vala_tuba_dialogs_profile_edit_set_property (GObject * object,
                                                   guint property_id,
                                                   const GValue * value,
                                                   GParamSpec * pspec);

static inline gpointer
tuba_dialogs_profile_edit_get_instance_private (TubaDialogsProfileEdit* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsProfileEdit_private_offset);
}

static const gchar*
string_to_string (const gchar* self)
{
	const gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	result = self;
	return result;
}

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

void
tuba_dialogs_profile_edit_update_style_scheme (TubaDialogsProfileEdit* self)
{
	GtkSourceStyleSchemeManager* manager = NULL;
	GtkSourceStyleSchemeManager* _tmp0_;
	GtkSourceStyleSchemeManager* _tmp1_;
	gchar* scheme_name = NULL;
	gchar* _tmp2_;
	AdwStyleManager* _tmp3_;
	gboolean _tmp4_;
	gboolean _tmp5_;
	GtkSourceView* _tmp8_;
	GtkTextBuffer* _tmp9_;
	GtkTextBuffer* _tmp10_;
	GtkSourceStyleSchemeManager* _tmp11_;
	const gchar* _tmp12_;
	GtkSourceStyleScheme* _tmp13_;
	g_return_if_fail (self != NULL);
	_tmp0_ = gtk_source_style_scheme_manager_get_default ();
	_tmp1_ = _g_object_ref0 (_tmp0_);
	manager = _tmp1_;
	_tmp2_ = g_strdup ("Adwaita");
	scheme_name = _tmp2_;
	_tmp3_ = adw_style_manager_get_default ();
	_tmp4_ = adw_style_manager_get_dark (_tmp3_);
	_tmp5_ = _tmp4_;
	if (_tmp5_) {
		const gchar* _tmp6_;
		gchar* _tmp7_;
		_tmp6_ = scheme_name;
		_tmp7_ = g_strconcat (_tmp6_, "-dark", NULL);
		_g_free0 (scheme_name);
		scheme_name = _tmp7_;
	}
	_tmp8_ = self->priv->bio_text_view;
	_tmp9_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = manager;
	_tmp12_ = scheme_name;
	_tmp13_ = gtk_source_style_scheme_manager_get_scheme (_tmp11_, _tmp12_);
	gtk_source_buffer_set_style_scheme (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_source_buffer_get_type (), GtkSourceBuffer), _tmp13_);
	_g_free0 (scheme_name);
	_g_object_unref0 (manager);
}

static void
tuba_dialogs_profile_edit_on_close (TubaDialogsProfileEdit* self)
{
	g_return_if_fail (self != NULL);
	adw_dialog_force_close ((AdwDialog*) self);
}

static void
_tuba_dialogs_profile_edit_on_close_gtk_button_clicked (GtkButton* _sender,
                                                        gpointer self)
{
	tuba_dialogs_profile_edit_on_close ((TubaDialogsProfileEdit*) self);
}

static void
tuba_dialogs_profile_edit_on_avi_button_clicked (TubaDialogsProfileEdit* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_profile_edit_choose_file (self, FALSE);
}

static void
_tuba_dialogs_profile_edit_on_avi_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                     gpointer self)
{
	tuba_dialogs_profile_edit_on_avi_button_clicked ((TubaDialogsProfileEdit*) self);
}

static void
tuba_dialogs_profile_edit_on_header_button_clicked (TubaDialogsProfileEdit* self)
{
	g_return_if_fail (self != NULL);
	tuba_dialogs_profile_edit_choose_file (self, TRUE);
}

static void
_tuba_dialogs_profile_edit_on_header_button_clicked_gtk_button_clicked (GtkButton* _sender,
                                                                        gpointer self)
{
	tuba_dialogs_profile_edit_on_header_button_clicked ((TubaDialogsProfileEdit*) self);
}

static void
__lambda152_ (TubaDialogsProfileEdit* self,
              GObject* obj,
              GAsyncResult* res)
{
	GError* _inner_error0_ = NULL;
	g_return_if_fail (res != NULL);
	{
		tuba_dialogs_profile_edit_save_finish (self, res, &_inner_error0_);
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		tuba_dialogs_profile_edit_on_close (self);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp0_;
		const gchar* _tmp1_;
		AdwAlertDialog* dlg = NULL;
		TubaApplication* _tmp2_;
		GError* _tmp3_;
		const gchar* _tmp4_;
		AdwAlertDialog* _tmp5_;
		AdwAlertDialog* _tmp6_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp0_ = e;
		_tmp1_ = _tmp0_->message;
		g_critical ("ProfileEdit.vala:154: %s", _tmp1_);
		_tmp2_ = tuba_app;
		_tmp3_ = e;
		_tmp4_ = _tmp3_->message;
		_tmp5_ = tuba_application_inform (_tmp2_, _ ("Error"), _tmp4_);
		dlg = _tmp5_;
		_tmp6_ = dlg;
		adw_dialog_present ((AdwDialog*) _tmp6_, (GtkWidget*) self);
		_g_object_unref0 (dlg);
		_g_error_free0 (e);
	}
	__finally0:
	{
		GError* _inner_error1_ = NULL;
		gtk_widget_set_sensitive ((GtkWidget*) self, TRUE);
	}
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda152__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda152_ ((TubaDialogsProfileEdit*) self, source_object, res);
	g_object_unref (self);
}

static void
tuba_dialogs_profile_edit_on_save_clicked (TubaDialogsProfileEdit* self)
{
	g_return_if_fail (self != NULL);
	gtk_widget_set_sensitive ((GtkWidget*) self, FALSE);
	tuba_dialogs_profile_edit_save (self, ___lambda152__gasync_ready_callback, g_object_ref (self));
}

static void
_tuba_dialogs_profile_edit_on_save_clicked_gtk_button_clicked (GtkButton* _sender,
                                                               gpointer self)
{
	tuba_dialogs_profile_edit_on_save_clicked ((TubaDialogsProfileEdit*) self);
}

static guint8*
string_get_data (const gchar* self,
                 gint* result_length1)
{
	guint8* result;
	guint8* res = NULL;
	gint res_length1;
	gint _res_size_;
	gint _tmp0_;
	gint _tmp1_;
	guint8* _tmp2_;
	gint _tmp2__length1;
	g_return_val_if_fail (self != NULL, NULL);
	res = (guint8*) self;
	res_length1 = -1;
	_res_size_ = res_length1;
	_tmp0_ = strlen (self);
	_tmp1_ = _tmp0_;
	res_length1 = (gint) _tmp1_;
	_tmp2_ = res;
	_tmp2__length1 = res_length1;
	if (result_length1) {
		*result_length1 = _tmp2__length1;
	}
	result = _tmp2_;
	return result;
}

static void
tuba_dialogs_profile_edit_on_bio_emoji_picked (TubaDialogsProfileEdit* self,
                                               const gchar* emoji_unicode)
{
	GtkSourceView* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextBuffer* _tmp2_;
	guint8* _tmp3_;
	gint _tmp3__length1;
	gint _tmp4_ = 0;
	guint8* _tmp5_;
	gint _tmp5__length1;
	g_return_if_fail (self != NULL);
	g_return_if_fail (emoji_unicode != NULL);
	_tmp0_ = self->priv->bio_text_view;
	_tmp1_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = string_get_data (emoji_unicode, &_tmp4_);
	_tmp3__length1 = _tmp4_;
	_tmp5_ = _tmp3_;
	_tmp5__length1 = _tmp3__length1;
	gtk_text_buffer_insert_at_cursor (_tmp2_, emoji_unicode, _tmp5__length1);
}

static void
_tuba_dialogs_profile_edit_on_bio_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked (TubaWidgetsCustomEmojiChooserV2* _sender,
                                                                                                  const gchar* shortcode,
                                                                                                  gpointer self)
{
	tuba_dialogs_profile_edit_on_bio_emoji_picked ((TubaDialogsProfileEdit*) self, shortcode);
}

static gboolean
tuba_dialogs_profile_edit_has_error (TubaDialogsProfileEdit* self,
                                     GtkWidget* wdg)
{
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	g_return_val_if_fail (wdg != NULL, FALSE);
	result = gtk_widget_has_css_class (wdg, "error");
	return result;
}

static void
tuba_dialogs_profile_edit_on_name_row_changed (TubaDialogsProfileEdit* self)
{
	gboolean valid = FALSE;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	AdwEntryRow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->name_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	valid = ((gint64) tuba_utils_counting_chars (_tmp2_, "en")) <= self->priv->max_name_length;
	_tmp3_ = self->priv->name_row;
	tuba_toggle_css ((GtkWidget*) _tmp3_, !valid, "error");
}

static void
_tuba_dialogs_profile_edit_on_name_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                     gpointer self)
{
	tuba_dialogs_profile_edit_on_name_row_changed ((TubaDialogsProfileEdit*) self);
}

static void
tuba_dialogs_profile_edit_on_bio_text_changed (TubaDialogsProfileEdit* self)
{
	gboolean valid = FALSE;
	GtkSourceView* _tmp0_;
	GtkTextBuffer* _tmp1_;
	GtkTextBuffer* _tmp2_;
	gchar* _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	gboolean _tmp6_;
	AdwExpanderRow* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->bio_text_view;
	_tmp1_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp0_);
	_tmp2_ = _tmp1_;
	g_object_get (_tmp2_, "text", &_tmp3_, NULL);
	_tmp4_ = _tmp3_;
	_tmp5_ = _tmp4_;
	_tmp6_ = ((gint64) tuba_utils_counting_chars (_tmp5_, "en")) <= self->priv->max_bio_length;
	_g_free0 (_tmp5_);
	valid = _tmp6_;
	_tmp7_ = self->priv->bio_row;
	tuba_toggle_css ((GtkWidget*) _tmp7_, !valid, "error");
}

static void
tuba_dialogs_profile_edit_on_avi_alt_text_row_changed (TubaDialogsProfileEdit* self)
{
	gboolean valid = FALSE;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	AdwEntryRow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->avi_alt_text_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	valid = ((gint64) tuba_utils_counting_chars (_tmp2_, "en")) <= self->priv->max_avi_alt_length;
	_tmp3_ = self->priv->avi_alt_text_row;
	tuba_toggle_css ((GtkWidget*) _tmp3_, !valid, "error");
}

static void
_tuba_dialogs_profile_edit_on_avi_alt_text_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                             gpointer self)
{
	tuba_dialogs_profile_edit_on_avi_alt_text_row_changed ((TubaDialogsProfileEdit*) self);
}

static void
tuba_dialogs_profile_edit_on_header_alt_text_row_changed (TubaDialogsProfileEdit* self)
{
	gboolean valid = FALSE;
	AdwEntryRow* _tmp0_;
	const gchar* _tmp1_;
	const gchar* _tmp2_;
	AdwEntryRow* _tmp3_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->header_alt_text_row;
	_tmp1_ = gtk_editable_get_text ((GtkEditable*) _tmp0_);
	_tmp2_ = _tmp1_;
	valid = ((gint64) tuba_utils_counting_chars (_tmp2_, "en")) <= self->priv->max_cover_alt_length;
	_tmp3_ = self->priv->header_alt_text_row;
	tuba_toggle_css ((GtkWidget*) _tmp3_, !valid, "error");
}

static void
_tuba_dialogs_profile_edit_on_header_alt_text_row_changed_gtk_editable_changed (GtkEditable* _sender,
                                                                                gpointer self)
{
	tuba_dialogs_profile_edit_on_header_alt_text_row_changed ((TubaDialogsProfileEdit*) self);
}

static void
_tuba_dialogs_profile_edit_on_background_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                              gpointer self)
{
	tuba_dialogs_profile_edit_on_background_cache_response ((TubaDialogsProfileEdit*) self, data);
}

static void
_tuba_dialogs_profile_edit_on_avi_cache_response_tuba_helper_image_on_item_changed_fn (GdkPaintable* data,
                                                                                       gpointer self)
{
	tuba_dialogs_profile_edit_on_avi_cache_response ((TubaDialogsProfileEdit*) self, data);
}

static void
_tuba_dialogs_profile_edit_on_add_field_activated_adw_button_row_activated (AdwButtonRow* _sender,
                                                                            gpointer self)
{
	tuba_dialogs_profile_edit_on_add_field_activated ((TubaDialogsProfileEdit*) self);
}

TubaDialogsProfileEdit*
tuba_dialogs_profile_edit_construct (GType object_type,
                                     TubaAPIAccount* acc)
{
	TubaDialogsProfileEdit * self = NULL;
	TubaAccountStore* _tmp0_;
	TubaInstanceAccount* _tmp1_;
	TubaInstanceAccount* _tmp2_;
	TubaAPIInstance* _tmp3_;
	TubaAPIInstance* _tmp4_;
	gint64 _tmp5_;
	gint64 _tmp6_;
	TubaAccountStore* _tmp7_;
	TubaInstanceAccount* _tmp8_;
	TubaInstanceAccount* _tmp9_;
	TubaAPIInstance* _tmp10_;
	TubaAPIInstance* _tmp11_;
	gint64 _tmp12_;
	gint64 _tmp13_;
	TubaAccountStore* _tmp14_;
	TubaInstanceAccount* _tmp15_;
	TubaInstanceAccount* _tmp16_;
	TubaAPIInstance* _tmp17_;
	TubaAPIInstance* _tmp18_;
	gint64 _tmp19_;
	gint64 _tmp20_;
	TubaAccountStore* _tmp21_;
	TubaInstanceAccount* _tmp22_;
	TubaInstanceAccount* _tmp23_;
	TubaAPIInstance* _tmp24_;
	TubaAPIInstance* _tmp25_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp26_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp27_;
	gint64 _tmp28_;
	gint64 _tmp29_;
	TubaAccountStore* _tmp30_;
	TubaInstanceAccount* _tmp31_;
	TubaInstanceAccount* _tmp32_;
	TubaAPIInstance* _tmp33_;
	TubaAPIInstance* _tmp34_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp35_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp36_;
	gint64 _tmp37_;
	gint64 _tmp38_;
	TubaAccountStore* _tmp39_;
	TubaInstanceAccount* _tmp40_;
	TubaInstanceAccount* _tmp41_;
	TubaAPIInstance* _tmp42_;
	TubaAPIInstance* _tmp43_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp44_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp45_;
	gint64 _tmp46_;
	gint64 _tmp47_;
	TubaAccountStore* _tmp48_;
	TubaInstanceAccount* _tmp49_;
	TubaInstanceAccount* _tmp50_;
	TubaAPIInstance* _tmp51_;
	TubaAPIInstance* _tmp52_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp53_;
	TubaAPIInstanceV2ConfigurationAccountsCharLimits* _tmp54_;
	gint64 _tmp55_;
	gint64 _tmp56_;
	gboolean _tmp57_ = FALSE;
	const gchar* _tmp58_;
	const gchar* _tmp59_;
	TubaAccountStore* _tmp69_;
	TubaInstanceAccount* _tmp70_;
	TubaInstanceAccount* _tmp71_;
	TubaAPIInstanceV2APIVersions* _tmp72_;
	TubaAPIInstanceV2APIVersions* _tmp73_;
	gint8 _tmp74_;
	gint8 _tmp75_;
	const gchar* _tmp86_;
	const gchar* _tmp87_;
	const gchar* _tmp88_;
	const gchar* _tmp89_;
	AdwAvatar* _tmp90_;
	const gchar* _tmp91_;
	const gchar* _tmp92_;
	AdwEntryRow* _tmp93_;
	const gchar* _tmp94_;
	const gchar* _tmp95_;
	const gchar* _tmp96_ = NULL;
	gboolean _tmp97_ = FALSE;
	TubaAPIAccountSource* _tmp98_;
	TubaAPIAccountSource* _tmp99_;
	GtkSourceView* _tmp108_;
	GtkTextBuffer* _tmp109_;
	GtkTextBuffer* _tmp110_;
	AdwPreferencesGroup* _tmp111_;
	gboolean _tmp112_;
	gboolean _tmp113_;
	gint total_fields = 0;
	gboolean _tmp117_ = FALSE;
	gboolean _tmp118_ = FALSE;
	gboolean _tmp119_ = FALSE;
	g_return_val_if_fail (acc != NULL, NULL);
	self = (TubaDialogsProfileEdit*) g_object_new (object_type, NULL);
	_tmp0_ = tuba_accounts;
	_tmp1_ = tuba_account_store_get_active (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = tuba_instance_account_get_instance_info (_tmp2_);
	_tmp4_ = _tmp3_;
	_tmp5_ = tuba_api_instance_get_compat_fields_limits_max_fields (_tmp4_);
	_tmp6_ = _tmp5_;
	self->priv->max_fields = _tmp6_;
	_tmp7_ = tuba_accounts;
	_tmp8_ = tuba_account_store_get_active (_tmp7_);
	_tmp9_ = _tmp8_;
	_tmp10_ = tuba_instance_account_get_instance_info (_tmp9_);
	_tmp11_ = _tmp10_;
	_tmp12_ = tuba_api_instance_get_compat_fields_limits_name_length (_tmp11_);
	_tmp13_ = _tmp12_;
	self->priv->max_key_length = _tmp13_;
	_tmp14_ = tuba_accounts;
	_tmp15_ = tuba_account_store_get_active (_tmp14_);
	_tmp16_ = _tmp15_;
	_tmp17_ = tuba_instance_account_get_instance_info (_tmp16_);
	_tmp18_ = _tmp17_;
	_tmp19_ = tuba_api_instance_get_compat_fields_limits_value_length (_tmp18_);
	_tmp20_ = _tmp19_;
	self->priv->max_value_length = _tmp20_;
	_tmp21_ = tuba_accounts;
	_tmp22_ = tuba_account_store_get_active (_tmp21_);
	_tmp23_ = _tmp22_;
	_tmp24_ = tuba_instance_account_get_instance_info (_tmp23_);
	_tmp25_ = _tmp24_;
	_tmp26_ = tuba_api_instance_get_tuba_limits (_tmp25_);
	_tmp27_ = _tmp26_;
	_tmp28_ = tuba_api_instance_v2_configuration_accounts_char_limits_get_max_display_name_length (_tmp27_);
	_tmp29_ = _tmp28_;
	self->priv->max_name_length = _tmp29_;
	_tmp30_ = tuba_accounts;
	_tmp31_ = tuba_account_store_get_active (_tmp30_);
	_tmp32_ = _tmp31_;
	_tmp33_ = tuba_instance_account_get_instance_info (_tmp32_);
	_tmp34_ = _tmp33_;
	_tmp35_ = tuba_api_instance_get_tuba_limits (_tmp34_);
	_tmp36_ = _tmp35_;
	_tmp37_ = tuba_api_instance_v2_configuration_accounts_char_limits_get_max_note_length (_tmp36_);
	_tmp38_ = _tmp37_;
	self->priv->max_bio_length = _tmp38_;
	_tmp39_ = tuba_accounts;
	_tmp40_ = tuba_account_store_get_active (_tmp39_);
	_tmp41_ = _tmp40_;
	_tmp42_ = tuba_instance_account_get_instance_info (_tmp41_);
	_tmp43_ = _tmp42_;
	_tmp44_ = tuba_api_instance_get_tuba_limits (_tmp43_);
	_tmp45_ = _tmp44_;
	_tmp46_ = tuba_api_instance_v2_configuration_accounts_char_limits_get_max_avatar_description_length (_tmp45_);
	_tmp47_ = _tmp46_;
	self->priv->max_avi_alt_length = _tmp47_;
	_tmp48_ = tuba_accounts;
	_tmp49_ = tuba_account_store_get_active (_tmp48_);
	_tmp50_ = _tmp49_;
	_tmp51_ = tuba_instance_account_get_instance_info (_tmp50_);
	_tmp52_ = _tmp51_;
	_tmp53_ = tuba_api_instance_get_tuba_limits (_tmp52_);
	_tmp54_ = _tmp53_;
	_tmp55_ = tuba_api_instance_v2_configuration_accounts_char_limits_get_max_header_description_length (_tmp54_);
	_tmp56_ = _tmp55_;
	self->priv->max_cover_alt_length = _tmp56_;
	_tmp58_ = tuba_api_account_get_avatar_description (acc);
	_tmp59_ = _tmp58_;
	if (_tmp59_ != NULL) {
		const gchar* _tmp60_;
		const gchar* _tmp61_;
		_tmp60_ = tuba_api_account_get_header_description (acc);
		_tmp61_ = _tmp60_;
		_tmp57_ = _tmp61_ != NULL;
	} else {
		_tmp57_ = FALSE;
	}
	if (_tmp57_) {
		AdwPreferencesGroup* _tmp62_;
		AdwEntryRow* _tmp63_;
		const gchar* _tmp64_;
		const gchar* _tmp65_;
		AdwEntryRow* _tmp66_;
		const gchar* _tmp67_;
		const gchar* _tmp68_;
		_tmp62_ = self->priv->alt_text_group;
		gtk_widget_set_visible ((GtkWidget*) _tmp62_, TRUE);
		_tmp63_ = self->priv->avi_alt_text_row;
		_tmp64_ = tuba_api_account_get_avatar_description (acc);
		_tmp65_ = _tmp64_;
		gtk_editable_set_text ((GtkEditable*) _tmp63_, _tmp65_);
		_tmp66_ = self->priv->header_alt_text_row;
		_tmp67_ = tuba_api_account_get_header_description (acc);
		_tmp68_ = _tmp67_;
		gtk_editable_set_text ((GtkEditable*) _tmp66_, _tmp68_);
	}
	_tmp69_ = tuba_accounts;
	_tmp70_ = tuba_account_store_get_active (_tmp69_);
	_tmp71_ = _tmp70_;
	_tmp72_ = tuba_instance_account_get_tuba_api_versions (_tmp71_);
	_tmp73_ = _tmp72_;
	_tmp74_ = tuba_api_instance_v2_api_versions_get_mastodon (_tmp73_);
	_tmp75_ = _tmp74_;
	if (((gint) _tmp75_) >= 11) {
		AdwPreferencesGroup* _tmp76_;
		AdwSwitchRow* _tmp77_;
		gboolean _tmp78_;
		gboolean _tmp79_;
		AdwSwitchRow* _tmp80_;
		gboolean _tmp81_;
		gboolean _tmp82_;
		AdwSwitchRow* _tmp83_;
		gboolean _tmp84_;
		gboolean _tmp85_;
		_tmp76_ = self->priv->display_group;
		gtk_widget_set_visible ((GtkWidget*) _tmp76_, TRUE);
		_tmp77_ = self->priv->featured_row;
		_tmp78_ = tuba_api_account_get_show_featured (acc);
		_tmp79_ = _tmp78_;
		adw_switch_row_set_active (_tmp77_, _tmp79_);
		_tmp80_ = self->priv->media_row;
		_tmp81_ = tuba_api_account_get_show_media (acc);
		_tmp82_ = _tmp81_;
		adw_switch_row_set_active (_tmp80_, _tmp82_);
		_tmp83_ = self->priv->media_replies_row;
		_tmp84_ = tuba_api_account_get_show_media_replies (acc);
		_tmp85_ = _tmp84_;
		adw_switch_row_set_active (_tmp83_, _tmp85_);
	}
	tuba_dialogs_profile_edit_set_profile (self, acc);
	_tmp86_ = tuba_api_account_get_header (acc);
	_tmp87_ = _tmp86_;
	tuba_helper_image_request_paintable (_tmp87_, NULL, FALSE, _tuba_dialogs_profile_edit_on_background_cache_response_tuba_helper_image_on_item_changed_fn, g_object_ref (self), g_object_unref, NULL);
	_tmp88_ = tuba_api_account_get_avatar (acc);
	_tmp89_ = _tmp88_;
	tuba_helper_image_request_paintable (_tmp89_, NULL, FALSE, _tuba_dialogs_profile_edit_on_avi_cache_response_tuba_helper_image_on_item_changed_fn, g_object_ref (self), g_object_unref, NULL);
	_tmp90_ = self->priv->avi;
	_tmp91_ = tuba_api_account_get_display_name (acc);
	_tmp92_ = _tmp91_;
	adw_avatar_set_text (_tmp90_, _tmp92_);
	_tmp93_ = self->priv->name_row;
	_tmp94_ = tuba_api_account_get_display_name (acc);
	_tmp95_ = _tmp94_;
	gtk_editable_set_text ((GtkEditable*) _tmp93_, _tmp95_);
	_tmp98_ = tuba_api_account_get_source (acc);
	_tmp99_ = _tmp98_;
	if (_tmp99_ == NULL) {
		_tmp97_ = TRUE;
	} else {
		TubaAPIAccountSource* _tmp100_;
		TubaAPIAccountSource* _tmp101_;
		const gchar* _tmp102_;
		const gchar* _tmp103_;
		_tmp100_ = tuba_api_account_get_source (acc);
		_tmp101_ = _tmp100_;
		_tmp102_ = tuba_api_account_source_get_note (_tmp101_);
		_tmp103_ = _tmp102_;
		_tmp97_ = _tmp103_ == NULL;
	}
	if (_tmp97_) {
		_tmp96_ = "";
	} else {
		TubaAPIAccountSource* _tmp104_;
		TubaAPIAccountSource* _tmp105_;
		const gchar* _tmp106_;
		const gchar* _tmp107_;
		_tmp104_ = tuba_api_account_get_source (acc);
		_tmp105_ = _tmp104_;
		_tmp106_ = tuba_api_account_source_get_note (_tmp105_);
		_tmp107_ = _tmp106_;
		_tmp96_ = _tmp107_;
	}
	_tmp108_ = self->priv->bio_text_view;
	_tmp109_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp108_);
	_tmp110_ = _tmp109_;
	g_object_set (_tmp110_, "text", _tmp96_, NULL);
	_tmp111_ = self->priv->gotosocial_group;
	_tmp112_ = gtk_widget_get_visible ((GtkWidget*) _tmp111_);
	_tmp113_ = _tmp112_;
	if (_tmp113_) {
		AdwSwitchRow* _tmp114_;
		gboolean _tmp115_;
		gboolean _tmp116_;
		_tmp114_ = self->priv->rss_row;
		_tmp115_ = tuba_api_account_get_enable_rss (acc);
		_tmp116_ = _tmp115_;
		adw_switch_row_set_active (_tmp114_, _tmp116_);
	}
	total_fields = 0;
	if (acc != NULL) {
		TubaAPIAccountSource* _tmp120_;
		TubaAPIAccountSource* _tmp121_;
		_tmp120_ = tuba_api_account_get_source (acc);
		_tmp121_ = _tmp120_;
		_tmp119_ = _tmp121_ != NULL;
	} else {
		_tmp119_ = FALSE;
	}
	if (_tmp119_) {
		TubaAPIAccountSource* _tmp122_;
		TubaAPIAccountSource* _tmp123_;
		GeeArrayList* _tmp124_;
		GeeArrayList* _tmp125_;
		_tmp122_ = tuba_api_account_get_source (acc);
		_tmp123_ = _tmp122_;
		_tmp124_ = tuba_api_account_source_get_fields (_tmp123_);
		_tmp125_ = _tmp124_;
		_tmp118_ = _tmp125_ != NULL;
	} else {
		_tmp118_ = FALSE;
	}
	if (_tmp118_) {
		TubaAPIAccountSource* _tmp126_;
		TubaAPIAccountSource* _tmp127_;
		GeeArrayList* _tmp128_;
		GeeArrayList* _tmp129_;
		gint _tmp130_;
		gint _tmp131_;
		_tmp126_ = tuba_api_account_get_source (acc);
		_tmp127_ = _tmp126_;
		_tmp128_ = tuba_api_account_source_get_fields (_tmp127_);
		_tmp129_ = _tmp128_;
		_tmp130_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp129_);
		_tmp131_ = _tmp130_;
		_tmp117_ = _tmp131_ > 0;
	} else {
		_tmp117_ = FALSE;
	}
	if (_tmp117_) {
		TubaAPIAccountSource* _tmp132_;
		TubaAPIAccountSource* _tmp133_;
		GeeArrayList* _tmp134_;
		GeeArrayList* _tmp135_;
		gint _tmp136_;
		gint _tmp137_;
		_tmp132_ = tuba_api_account_get_source (acc);
		_tmp133_ = _tmp132_;
		_tmp134_ = tuba_api_account_source_get_fields (_tmp133_);
		_tmp135_ = _tmp134_;
		_tmp136_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp135_);
		_tmp137_ = _tmp136_;
		total_fields = _tmp137_;
		{
			gint i = 0;
			i = 0;
			{
				gboolean _tmp138_ = FALSE;
				_tmp138_ = TRUE;
				while (TRUE) {
					TubaAPIAccountField* field = NULL;
					TubaAPIAccountSource* _tmp140_;
					TubaAPIAccountSource* _tmp141_;
					GeeArrayList* _tmp142_;
					GeeArrayList* _tmp143_;
					gpointer _tmp144_;
					TubaAPIAccountField* _tmp145_;
					const gchar* _tmp146_;
					const gchar* _tmp147_;
					TubaAPIAccountField* _tmp148_;
					const gchar* _tmp149_;
					const gchar* _tmp150_;
					if (!_tmp138_) {
						gint _tmp139_;
						_tmp139_ = i;
						i = _tmp139_ + 1;
					}
					_tmp138_ = FALSE;
					if (!(i < total_fields)) {
						break;
					}
					_tmp140_ = tuba_api_account_get_source (acc);
					_tmp141_ = _tmp140_;
					_tmp142_ = tuba_api_account_source_get_fields (_tmp141_);
					_tmp143_ = _tmp142_;
					_tmp144_ = gee_abstract_list_get ((GeeAbstractList*) _tmp143_, i);
					field = (TubaAPIAccountField*) _tmp144_;
					_tmp145_ = field;
					_tmp146_ = tuba_api_account_field_get_name (_tmp145_);
					_tmp147_ = _tmp146_;
					_tmp148_ = field;
					_tmp149_ = tuba_api_account_field_get_val (_tmp148_);
					_tmp150_ = _tmp149_;
					tuba_dialogs_profile_edit_add_field (self, _tmp147_, _tmp150_);
					_g_object_unref0 (field);
				}
			}
		}
	}
	if (self->priv->max_fields > ((gint64) total_fields)) {
		gchar* _tmp151_;
		gchar* _tmp152_;
		AdwButtonRow* _tmp153_ = NULL;
		AdwButtonRow* _tmp154_;
		AdwPreferencesGroup* _tmp155_;
		AdwButtonRow* _tmp156_;
		_tmp151_ = g_strdup ("tuba-plus-large-symbolic");
		_tmp152_ = g_strdup (_ ("Add Field"));
		_tmp153_ = (AdwButtonRow*) adw_button_row_new ();
		adw_button_row_set_start_icon_name (_tmp153_, _tmp151_);
		_g_free0 (_tmp151_);
		adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp153_, _tmp152_);
		_g_free0 (_tmp152_);
		g_object_ref_sink (_tmp153_);
		_g_object_unref0 (self->priv->add_field_row);
		self->priv->add_field_row = _tmp153_;
		_tmp154_ = self->priv->add_field_row;
		g_signal_connect_object (_tmp154_, "activated", (GCallback) _tuba_dialogs_profile_edit_on_add_field_activated_adw_button_row_activated, self, 0);
		_tmp155_ = self->priv->fields_box;
		_tmp156_ = self->priv->add_field_row;
		adw_preferences_group_add (_tmp155_, (GtkWidget*) _tmp156_);
	}
	return self;
}

TubaDialogsProfileEdit*
tuba_dialogs_profile_edit_new (TubaAPIAccount* acc)
{
	return tuba_dialogs_profile_edit_construct (TUBA_DIALOGS_TYPE_PROFILE_EDIT, acc);
}

static void
tuba_dialogs_profile_edit_on_add_field_activated (TubaDialogsProfileEdit* self)
{
	AdwPreferencesGroup* _tmp0_;
	AdwButtonRow* _tmp1_;
	GeeArrayList* _tmp2_;
	gint _tmp3_;
	gint _tmp4_;
	g_return_if_fail (self != NULL);
	tuba_dialogs_profile_edit_add_field (self, NULL, NULL);
	_tmp0_ = self->priv->fields_box;
	_tmp1_ = self->priv->add_field_row;
	adw_preferences_group_remove (_tmp0_, (GtkWidget*) _tmp1_);
	_tmp2_ = self->priv->fields;
	_tmp3_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp2_);
	_tmp4_ = _tmp3_;
	if (self->priv->max_fields > ((gint64) _tmp4_)) {
		AdwPreferencesGroup* _tmp5_;
		AdwButtonRow* _tmp6_;
		_tmp5_ = self->priv->fields_box;
		_tmp6_ = self->priv->add_field_row;
		adw_preferences_group_add (_tmp5_, (GtkWidget*) _tmp6_);
	}
}

static void
tuba_dialogs_profile_edit_add_field (TubaDialogsProfileEdit* self,
                                     const gchar* key,
                                     const gchar* value)
{
	TubaDialogsProfileEditField* field = NULL;
	TubaDialogsProfileEditField* _tmp0_;
	GeeArrayList* _tmp1_;
	gint _tmp2_;
	gint _tmp3_;
	gchar* _tmp4_;
	gchar* _tmp5_;
	GeeArrayList* _tmp6_;
	AdwPreferencesGroup* _tmp7_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_dialogs_profile_edit_field_new (key, value, self->priv->max_key_length, self->priv->max_value_length);
	g_object_ref_sink (_tmp0_);
	field = _tmp0_;
	_tmp1_ = self->priv->fields;
	_tmp2_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp4_ = g_strdup_printf (_ ("Field %d"), _tmp3_ + 1);
	_tmp5_ = _tmp4_;
	adw_preferences_row_set_title ((AdwPreferencesRow*) field, _tmp5_);
	_g_free0 (_tmp5_);
	_tmp6_ = self->priv->fields;
	gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, field);
	_tmp7_ = self->priv->fields_box;
	adw_preferences_group_add (_tmp7_, (GtkWidget*) field);
	_g_object_unref0 (field);
}

static void
tuba_dialogs_profile_edit_on_background_cache_response (TubaDialogsProfileEdit* self,
                                                        GdkPaintable* data)
{
	GtkPicture* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->background;
	gtk_picture_set_paintable (_tmp0_, data);
}

static void
tuba_dialogs_profile_edit_on_avi_cache_response (TubaDialogsProfileEdit* self,
                                                 GdkPaintable* data)
{
	AdwAvatar* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = self->priv->avi;
	adw_avatar_set_custom_image (_tmp0_, data);
}

static Block31Data*
block31_data_ref (Block31Data* _data31_)
{
	g_atomic_int_inc (&_data31_->_ref_count_);
	return _data31_;
}

static void
block31_data_unref (void * _userdata_)
{
	Block31Data* _data31_;
	_data31_ = (Block31Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data31_->_ref_count_)) {
		TubaDialogsProfileEdit* self;
		self = _data31_->self;
		_g_object_unref0 (_data31_->chooser);
		_g_object_unref0 (self);
		g_slice_free (Block31Data, _data31_);
	}
}

static void
__lambda151_ (Block31Data* _data31_,
              GObject* obj,
              GAsyncResult* res)
{
	TubaDialogsProfileEdit* self;
	GError* _inner_error0_ = NULL;
	self = _data31_->self;
	g_return_if_fail (res != NULL);
	{
		GFile* file = NULL;
		GFile* _tmp0_;
		_tmp0_ = gtk_file_dialog_open_finish (_data31_->chooser, res, &_inner_error0_);
		file = _tmp0_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		{
			GdkTexture* texture = NULL;
			GFile* _tmp1_;
			GdkTexture* _tmp2_;
			_tmp1_ = file;
			_tmp2_ = gdk_texture_new_from_file (_tmp1_, &_inner_error0_);
			texture = _tmp2_;
			if (G_UNLIKELY (_inner_error0_ != NULL)) {
				goto __catch1_g_error;
			}
			if (_data31_->for_header) {
				GFile* _tmp3_;
				GFile* _tmp4_;
				GtkPicture* _tmp5_;
				_tmp3_ = file;
				_tmp4_ = _g_object_ref0 (_tmp3_);
				_g_object_unref0 (self->priv->new_header);
				self->priv->new_header = _tmp4_;
				_tmp5_ = self->priv->background;
				gtk_picture_set_paintable (_tmp5_, (GdkPaintable*) texture);
			} else {
				GFile* _tmp6_;
				GFile* _tmp7_;
				AdwAvatar* _tmp8_;
				_tmp6_ = file;
				_tmp7_ = _g_object_ref0 (_tmp6_);
				_g_object_unref0 (self->priv->new_avi);
				self->priv->new_avi = _tmp7_;
				_tmp8_ = self->priv->avi;
				adw_avatar_set_custom_image (_tmp8_, (GdkPaintable*) texture);
			}
			_g_object_unref0 (texture);
		}
		goto __finally1;
		__catch1_g_error:
		{
			GError* e = NULL;
			GError* _tmp9_;
			const gchar* _tmp10_;
			const gchar* _tmp11_;
			gchar* _tmp12_;
			gchar* _tmp13_;
			e = _inner_error0_;
			_inner_error0_ = NULL;
			_tmp9_ = e;
			_tmp10_ = _tmp9_->message;
			_tmp11_ = string_to_string (_tmp10_);
			_tmp12_ = g_strconcat ("Couldn't construct Texture from file ", _tmp11_, NULL);
			_tmp13_ = _tmp12_;
			g_critical ("ProfileEdit.vala:309: %s", _tmp13_);
			_g_free0 (_tmp13_);
			_g_error_free0 (e);
		}
		__finally1:
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			_g_object_unref0 (file);
			goto __catch0_g_error;
		}
		_g_object_unref0 (file);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		GError* _tmp14_;
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gchar* _tmp17_;
		gchar* _tmp18_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp14_ = e;
		_tmp15_ = _tmp14_->message;
		_tmp16_ = string_to_string (_tmp15_);
		_tmp17_ = g_strconcat ("Couldn't get the result of FileDialog for ProfileEdit: ", _tmp16_, NULL);
		_tmp18_ = _tmp17_;
		g_warning ("ProfileEdit.vala:315: %s", _tmp18_);
		_g_free0 (_tmp18_);
		_g_error_free0 (e);
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error0_->message, g_quark_to_string (_inner_error0_->domain), _inner_error0_->code);
		g_clear_error (&_inner_error0_);
		return;
	}
}

static void
___lambda151__gasync_ready_callback (GObject* source_object,
                                     GAsyncResult* res,
                                     gpointer self)
{
	__lambda151_ (self, source_object, res);
	block31_data_unref (self);
}

static void
tuba_dialogs_profile_edit_choose_file (TubaDialogsProfileEdit* self,
                                       gboolean for_header)
{
	Block31Data* _data31_;
	gchar* _tmp0_;
	GtkFileFilter* _tmp1_;
	GtkFileFilter* _tmp2_;
	GtkFileDialog* _tmp3_ = NULL;
	TubaApplication* _tmp4_;
	TubaDialogsMainWindow* _tmp5_;
	TubaDialogsMainWindow* _tmp6_;
	g_return_if_fail (self != NULL);
	_data31_ = g_slice_new0 (Block31Data);
	_data31_->_ref_count_ = 1;
	_data31_->self = g_object_ref (self);
	_data31_->for_header = for_header;
	_tmp0_ = g_strdup (_ ("Open"));
	_tmp1_ = self->priv->filter;
	_tmp2_ = _g_object_ref0 (_tmp1_);
	_tmp3_ = gtk_file_dialog_new ();
	gtk_file_dialog_set_title (_tmp3_, _tmp0_);
	_g_free0 (_tmp0_);
	gtk_file_dialog_set_modal (_tmp3_, TRUE);
	gtk_file_dialog_set_default_filter (_tmp3_, _tmp2_);
	_g_object_unref0 (_tmp2_);
	_data31_->chooser = _tmp3_;
	_tmp4_ = tuba_app;
	_tmp5_ = tuba_application_get_main_window (_tmp4_);
	_tmp6_ = _tmp5_;
	gtk_file_dialog_open (_data31_->chooser, (GtkWindow*) _tmp6_, NULL, ___lambda151__gasync_ready_callback, block31_data_ref (_data31_));
	block31_data_unref (_data31_);
	_data31_ = NULL;
}

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

static void
tuba_dialogs_profile_edit_save (TubaDialogsProfileEdit* self,
                                GAsyncReadyCallback _callback_,
                                gpointer _user_data_)
{
	TubaDialogsProfileEditSaveData* _data_;
	TubaDialogsProfileEdit* _tmp0_;
	g_return_if_fail (self != NULL);
	_data_ = g_slice_new0 (TubaDialogsProfileEditSaveData);
	_data_->_async_result = g_task_new (G_OBJECT (self), NULL, _callback_, _user_data_);
	g_task_set_task_data (_data_->_async_result, _data_, tuba_dialogs_profile_edit_save_data_free);
	_tmp0_ = _g_object_ref0 (self);
	_data_->self = _tmp0_;
	tuba_dialogs_profile_edit_save_co (_data_);
}

static void
tuba_dialogs_profile_edit_save_finish (TubaDialogsProfileEdit* self,
                                       GAsyncResult* _res_,
                                       GError** error)
{
	TubaDialogsProfileEditSaveData* _data_;
	_data_ = g_task_propagate_pointer (G_TASK (_res_), error);
	if (NULL == _data_) {
		return;
	}
}

static gchar*
bool_to_string (gboolean self)
{
	gchar* result;
	if (self) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("true");
		result = _tmp0_;
		return result;
	} else {
		gchar* _tmp1_;
		_tmp1_ = g_strdup ("false");
		result = _tmp1_;
		return result;
	}
}

static void
tuba_dialogs_profile_edit_save_ready (GObject* source_object,
                                      GAsyncResult* _res_,
                                      gpointer _user_data_)
{
	TubaDialogsProfileEditSaveData* _data_;
	_data_ = _user_data_;
	_data_->_source_object_ = source_object;
	_data_->_res_ = _res_;
	tuba_dialogs_profile_edit_save_co (_data_);
}

static gboolean
tuba_dialogs_profile_edit_save_co (TubaDialogsProfileEditSaveData* _data_)
{
	switch (_data_->_state_) {
		case 0:
		goto _state_0;
		case 1:
		goto _state_1;
		case 2:
		goto _state_2;
		case 3:
		goto _state_3;
		default:
		g_assert_not_reached ();
	}
	_state_0:
	_data_->_tmp0_ = tuba_accounts;
	_data_->_tmp1_ = tuba_account_store_get_active (_data_->_tmp0_);
	_data_->_tmp2_ = _data_->_tmp1_;
	_data_->_tmp3_ = _g_object_ref0 (_data_->_tmp2_);
	_data_->_tmp4_ = NULL;
	_data_->_tmp4_ = tuba_request_v2_new ("/api/v1/accounts/update_credentials", TUBA_REQUEST_V2_METHOD_PATCH);
	tuba_request_v2_set_account (_data_->_tmp4_, _data_->_tmp3_);
	_g_object_unref0 (_data_->_tmp3_);
	_data_->req = _data_->_tmp4_;
	_data_->_tmp6_ = _data_->self->priv->name_row;
	if (!tuba_dialogs_profile_edit_has_error (_data_->self, (GtkWidget*) _data_->_tmp6_)) {
		_data_->_tmp7_ = _data_->self->priv->_profile;
		_data_->_tmp8_ = tuba_api_account_get_display_name (_data_->_tmp7_);
		_data_->_tmp9_ = _data_->_tmp8_;
		_data_->_tmp10_ = _data_->self->priv->name_row;
		_data_->_tmp11_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp10_);
		_data_->_tmp12_ = _data_->_tmp11_;
		_data_->_tmp5_ = g_strcmp0 (_data_->_tmp9_, _data_->_tmp12_) != 0;
	} else {
		_data_->_tmp5_ = FALSE;
	}
	if (_data_->_tmp5_) {
		_data_->_tmp13_ = _data_->req;
		_data_->_tmp14_ = _data_->self->priv->name_row;
		_data_->_tmp15_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp14_);
		_data_->_tmp16_ = _data_->_tmp15_;
		tuba_request_v2_add_form_data (_data_->_tmp13_, "display_name", _data_->_tmp16_);
	}
	_data_->_tmp19_ = _data_->self->priv->bio_row;
	if (!tuba_dialogs_profile_edit_has_error (_data_->self, (GtkWidget*) _data_->_tmp19_)) {
		_data_->_tmp20_ = _data_->self->priv->_profile;
		_data_->_tmp21_ = tuba_api_account_get_source (_data_->_tmp20_);
		_data_->_tmp22_ = _data_->_tmp21_;
		_data_->_tmp18_ = _data_->_tmp22_ != NULL;
	} else {
		_data_->_tmp18_ = FALSE;
	}
	if (_data_->_tmp18_) {
		_data_->_tmp23_ = _data_->self->priv->_profile;
		_data_->_tmp24_ = tuba_api_account_get_source (_data_->_tmp23_);
		_data_->_tmp25_ = _data_->_tmp24_;
		_data_->_tmp26_ = tuba_api_account_source_get_note (_data_->_tmp25_);
		_data_->_tmp27_ = _data_->_tmp26_;
		_data_->_tmp28_ = _data_->self->priv->bio_text_view;
		_data_->_tmp29_ = gtk_text_view_get_buffer ((GtkTextView*) _data_->_tmp28_);
		_data_->_tmp30_ = _data_->_tmp29_;
		g_object_get (_data_->_tmp30_, "text", &_data_->_tmp31_, NULL);
		_data_->_tmp32_ = _data_->_tmp31_;
		_data_->_tmp33_ = _data_->_tmp32_;
		_data_->_tmp17_ = g_strcmp0 (_data_->_tmp27_, _data_->_tmp33_) != 0;
		_g_free0 (_data_->_tmp33_);
	} else {
		_data_->_tmp17_ = FALSE;
	}
	if (_data_->_tmp17_) {
		_data_->_tmp34_ = _data_->req;
		_data_->_tmp35_ = _data_->self->priv->bio_text_view;
		_data_->_tmp36_ = gtk_text_view_get_buffer ((GtkTextView*) _data_->_tmp35_);
		_data_->_tmp37_ = _data_->_tmp36_;
		g_object_get (_data_->_tmp37_, "text", &_data_->_tmp38_, NULL);
		_data_->_tmp39_ = _data_->_tmp38_;
		_data_->_tmp40_ = _data_->_tmp39_;
		tuba_request_v2_add_form_data (_data_->_tmp34_, "note", _data_->_tmp40_);
		_g_free0 (_data_->_tmp40_);
	}
	_data_->_tmp41_ = _data_->self->priv->alt_text_group;
	_data_->_tmp42_ = gtk_widget_get_visible ((GtkWidget*) _data_->_tmp41_);
	_data_->_tmp43_ = _data_->_tmp42_;
	if (_data_->_tmp43_) {
		_data_->_tmp45_ = _data_->self->priv->avi_alt_text_row;
		if (!tuba_dialogs_profile_edit_has_error (_data_->self, (GtkWidget*) _data_->_tmp45_)) {
			_data_->_tmp46_ = _data_->self->priv->_profile;
			_data_->_tmp47_ = tuba_api_account_get_avatar_description (_data_->_tmp46_);
			_data_->_tmp48_ = _data_->_tmp47_;
			_data_->_tmp49_ = _data_->self->priv->avi_alt_text_row;
			_data_->_tmp50_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp49_);
			_data_->_tmp51_ = _data_->_tmp50_;
			_data_->_tmp44_ = g_strcmp0 (_data_->_tmp48_, _data_->_tmp51_) != 0;
		} else {
			_data_->_tmp44_ = FALSE;
		}
		if (_data_->_tmp44_) {
			_data_->_tmp52_ = _data_->req;
			_data_->_tmp53_ = _data_->self->priv->avi_alt_text_row;
			_data_->_tmp54_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp53_);
			_data_->_tmp55_ = _data_->_tmp54_;
			tuba_request_v2_add_form_data (_data_->_tmp52_, "avatar_description", _data_->_tmp55_);
		}
		_data_->_tmp57_ = _data_->self->priv->header_alt_text_row;
		if (!tuba_dialogs_profile_edit_has_error (_data_->self, (GtkWidget*) _data_->_tmp57_)) {
			_data_->_tmp58_ = _data_->self->priv->_profile;
			_data_->_tmp59_ = tuba_api_account_get_header_description (_data_->_tmp58_);
			_data_->_tmp60_ = _data_->_tmp59_;
			_data_->_tmp61_ = _data_->self->priv->header_alt_text_row;
			_data_->_tmp62_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp61_);
			_data_->_tmp63_ = _data_->_tmp62_;
			_data_->_tmp56_ = g_strcmp0 (_data_->_tmp60_, _data_->_tmp63_) != 0;
		} else {
			_data_->_tmp56_ = FALSE;
		}
		if (_data_->_tmp56_) {
			_data_->_tmp64_ = _data_->req;
			_data_->_tmp65_ = _data_->self->priv->header_alt_text_row;
			_data_->_tmp66_ = gtk_editable_get_text ((GtkEditable*) _data_->_tmp65_);
			_data_->_tmp67_ = _data_->_tmp66_;
			tuba_request_v2_add_form_data (_data_->_tmp64_, "header_description", _data_->_tmp67_);
		}
	}
	_data_->_tmp68_ = _data_->self->priv->gotosocial_group;
	_data_->_tmp69_ = gtk_widget_get_visible ((GtkWidget*) _data_->_tmp68_);
	_data_->_tmp70_ = _data_->_tmp69_;
	if (_data_->_tmp70_) {
		_data_->_tmp71_ = _data_->self->priv->rss_row;
		_data_->_tmp72_ = adw_switch_row_get_active (_data_->_tmp71_);
		_data_->_tmp73_ = _data_->_tmp72_;
		_data_->_tmp74_ = _data_->self->priv->_profile;
		_data_->_tmp75_ = tuba_api_account_get_enable_rss (_data_->_tmp74_);
		_data_->_tmp76_ = _data_->_tmp75_;
		if (_data_->_tmp73_ != _data_->_tmp76_) {
			_data_->_tmp77_ = _data_->req;
			_data_->_tmp78_ = _data_->self->priv->rss_row;
			_data_->_tmp79_ = adw_switch_row_get_active (_data_->_tmp78_);
			_data_->_tmp80_ = _data_->_tmp79_;
			_data_->_tmp81_ = bool_to_string (_data_->_tmp80_);
			_data_->_tmp82_ = _data_->_tmp81_;
			tuba_request_v2_add_form_data (_data_->_tmp77_, "enable_rss", _data_->_tmp82_);
			_g_free0 (_data_->_tmp82_);
		}
	}
	_data_->i = 0;
	{
		_data_->_tmp83_ = _data_->self->priv->fields;
		_data_->_field_list = _data_->_tmp83_;
		_data_->_tmp84_ = _data_->_field_list;
		_data_->_tmp85_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _data_->_tmp84_);
		_data_->_tmp86_ = _data_->_tmp85_;
		_data_->_field_size = _data_->_tmp86_;
		_data_->_field_index = -1;
		while (TRUE) {
			_data_->_field_index = _data_->_field_index + 1;
			_data_->_tmp87_ = _data_->_field_index;
			_data_->_tmp88_ = _data_->_field_size;
			if (!(_data_->_tmp87_ < _data_->_tmp88_)) {
				break;
			}
			_data_->_tmp89_ = _data_->_field_list;
			_data_->_tmp90_ = gee_abstract_list_get ((GeeAbstractList*) _data_->_tmp89_, _data_->_field_index);
			_data_->field = (TubaDialogsProfileEditField*) _data_->_tmp90_;
			_data_->_tmp92_ = _data_->field;
			_data_->_tmp93_ = tuba_dialogs_profile_edit_field_get_valid (_data_->_tmp92_);
			_data_->_tmp94_ = _data_->_tmp93_;
			if (_data_->_tmp94_) {
				_data_->_tmp95_ = _data_->field;
				_data_->_tmp96_ = tuba_dialogs_profile_edit_field_get_key (_data_->_tmp95_);
				_data_->_tmp97_ = _data_->_tmp96_;
				_data_->_tmp91_ = _data_->_tmp97_;
			} else {
				_data_->_tmp91_ = "";
			}
			_data_->_tmp98_ = _data_->req;
			_data_->_tmp99_ = g_strdup_printf ("%i", _data_->i);
			_data_->_tmp100_ = _data_->_tmp99_;
			_data_->_tmp101_ = g_strconcat ("fields_attributes[", _data_->_tmp100_, "][name]", NULL);
			_data_->_tmp102_ = _data_->_tmp101_;
			tuba_request_v2_add_form_data (_data_->_tmp98_, _data_->_tmp102_, _data_->_tmp91_);
			_g_free0 (_data_->_tmp102_);
			_g_free0 (_data_->_tmp100_);
			_data_->_tmp104_ = _data_->field;
			_data_->_tmp105_ = tuba_dialogs_profile_edit_field_get_valid (_data_->_tmp104_);
			_data_->_tmp106_ = _data_->_tmp105_;
			if (_data_->_tmp106_) {
				_data_->_tmp107_ = _data_->field;
				_data_->_tmp108_ = tuba_dialogs_profile_edit_field_get_value (_data_->_tmp107_);
				_data_->_tmp109_ = _data_->_tmp108_;
				_data_->_tmp103_ = _data_->_tmp109_;
			} else {
				_data_->_tmp103_ = "";
			}
			_data_->_tmp110_ = _data_->req;
			_data_->_tmp111_ = g_strdup_printf ("%i", _data_->i);
			_data_->_tmp112_ = _data_->_tmp111_;
			_data_->_tmp113_ = g_strconcat ("fields_attributes[", _data_->_tmp112_, "][value]", NULL);
			_data_->_tmp114_ = _data_->_tmp113_;
			tuba_request_v2_add_form_data (_data_->_tmp110_, _data_->_tmp114_, _data_->_tmp103_);
			_g_free0 (_data_->_tmp114_);
			_g_free0 (_data_->_tmp112_);
			_data_->_tmp115_ = _data_->i;
			_data_->i = _data_->_tmp115_ + 1;
			_g_object_unref0 (_data_->field);
		}
	}
	_data_->_tmp116_ = _data_->self->priv->new_avi;
	if (_data_->_tmp116_ != NULL) {
		_data_->_tmp117_ = _data_->self->priv->new_avi;
		_data_->_tmp118_ = NULL;
		_data_->_tmp119_ = NULL;
		tuba_dialogs_profile_edit_image_data (_data_->self, _data_->_tmp117_, &_data_->_tmp118_, &_data_->_tmp119_, &_data_->_inner_error0_);
		_g_free0 (_data_->mime);
		_data_->mime = _data_->_tmp118_;
		_g_bytes_unref0 (_data_->buffer);
		_data_->buffer = _data_->_tmp119_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_bytes_unref0 (_data_->buffer);
			_g_free0 (_data_->mime);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp120_ = _data_->req;
		_data_->_tmp121_ = _data_->mime;
		_data_->_tmp122_ = _data_->buffer;
		tuba_request_v2_add_form_data_file (_data_->_tmp120_, "avatar", _data_->_tmp121_, _data_->_tmp122_);
		_g_bytes_unref0 (_data_->buffer);
		_g_free0 (_data_->mime);
	}
	_data_->_tmp123_ = _data_->self->priv->new_header;
	if (_data_->_tmp123_ != NULL) {
		_data_->_tmp124_ = _data_->self->priv->new_header;
		_data_->_tmp125_ = NULL;
		_data_->_tmp126_ = NULL;
		tuba_dialogs_profile_edit_image_data (_data_->self, _data_->_tmp124_, &_data_->_tmp125_, &_data_->_tmp126_, &_data_->_inner_error0_);
		_g_free0 (_data_->_vala1_mime);
		_data_->_vala1_mime = _data_->_tmp125_;
		_g_bytes_unref0 (_data_->_vala1_buffer);
		_data_->_vala1_buffer = _data_->_tmp126_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_bytes_unref0 (_data_->_vala1_buffer);
			_g_free0 (_data_->_vala1_mime);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp127_ = _data_->req;
		_data_->_tmp128_ = _data_->_vala1_mime;
		_data_->_tmp129_ = _data_->_vala1_buffer;
		tuba_request_v2_add_form_data_file (_data_->_tmp127_, "header", _data_->_tmp128_, _data_->_tmp129_);
		_g_bytes_unref0 (_data_->_vala1_buffer);
		_g_free0 (_data_->_vala1_mime);
	}
	_data_->_tmp130_ = _data_->req;
	_data_->_tmp131_ = tuba_request_v2_get_has_form_data (_data_->_tmp130_);
	_data_->_tmp132_ = _data_->_tmp131_;
	if (_data_->_tmp132_) {
		_data_->_tmp133_ = _data_->req;
		_data_->_state_ = 1;
		tuba_request_v2_exec (_data_->_tmp133_, tuba_dialogs_profile_edit_save_ready, _data_);
		return FALSE;
		_state_1:
		_data_->_tmp134_ = tuba_request_v2_exec_finish (_data_->_tmp133_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->in_stream = _data_->_tmp134_;
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp135_ = tuba_accounts;
		_data_->_tmp136_ = tuba_account_store_get_active (_data_->_tmp135_);
		_data_->_tmp137_ = _data_->_tmp136_;
		_data_->_tmp138_ = _data_->in_stream;
		_data_->_state_ = 2;
		tuba_instance_account_update_object (_data_->_tmp137_, _data_->_tmp138_, tuba_dialogs_profile_edit_save_ready, _data_);
		return FALSE;
		_state_2:
		tuba_instance_account_update_object_finish (_data_->_tmp137_, _data_->_res_, &_data_->_inner_error0_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->in_stream);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_g_object_unref0 (_data_->in_stream);
	}
	_data_->_tmp140_ = _data_->self->priv->display_group;
	_data_->_tmp141_ = gtk_widget_get_visible ((GtkWidget*) _data_->_tmp140_);
	_data_->_tmp142_ = _data_->_tmp141_;
	if (_data_->_tmp142_) {
		_data_->_tmp145_ = _data_->self->priv->_profile;
		_data_->_tmp146_ = tuba_api_account_get_show_featured (_data_->_tmp145_);
		_data_->_tmp147_ = _data_->_tmp146_;
		_data_->_tmp148_ = _data_->self->priv->featured_row;
		_data_->_tmp149_ = adw_switch_row_get_active (_data_->_tmp148_);
		_data_->_tmp150_ = _data_->_tmp149_;
		if (_data_->_tmp147_ != _data_->_tmp150_) {
			_data_->_tmp144_ = TRUE;
		} else {
			_data_->_tmp151_ = _data_->self->priv->_profile;
			_data_->_tmp152_ = tuba_api_account_get_show_media (_data_->_tmp151_);
			_data_->_tmp153_ = _data_->_tmp152_;
			_data_->_tmp154_ = _data_->self->priv->media_row;
			_data_->_tmp155_ = adw_switch_row_get_active (_data_->_tmp154_);
			_data_->_tmp156_ = _data_->_tmp155_;
			_data_->_tmp144_ = _data_->_tmp153_ != _data_->_tmp156_;
		}
		if (_data_->_tmp144_) {
			_data_->_tmp143_ = TRUE;
		} else {
			_data_->_tmp157_ = _data_->self->priv->_profile;
			_data_->_tmp158_ = tuba_api_account_get_show_media_replies (_data_->_tmp157_);
			_data_->_tmp159_ = _data_->_tmp158_;
			_data_->_tmp160_ = _data_->self->priv->media_replies_row;
			_data_->_tmp161_ = adw_switch_row_get_active (_data_->_tmp160_);
			_data_->_tmp162_ = _data_->_tmp161_;
			_data_->_tmp143_ = _data_->_tmp159_ != _data_->_tmp162_;
		}
		_data_->_tmp139_ = _data_->_tmp143_;
	} else {
		_data_->_tmp139_ = FALSE;
	}
	if (_data_->_tmp139_) {
		_data_->_tmp163_ = tuba_accounts;
		_data_->_tmp164_ = tuba_account_store_get_active (_data_->_tmp163_);
		_data_->_tmp165_ = _data_->_tmp164_;
		_data_->_tmp166_ = _g_object_ref0 (_data_->_tmp165_);
		_data_->_tmp167_ = NULL;
		_data_->_tmp167_ = tuba_request_v2_new ("/api/v1/profile", TUBA_REQUEST_V2_METHOD_PATCH);
		tuba_request_v2_set_account (_data_->_tmp167_, _data_->_tmp166_);
		_g_object_unref0 (_data_->_tmp166_);
		_data_->req2 = _data_->_tmp167_;
		_data_->_tmp168_ = _data_->req2;
		_data_->_tmp169_ = _data_->self->priv->featured_row;
		_data_->_tmp170_ = adw_switch_row_get_active (_data_->_tmp169_);
		_data_->_tmp171_ = _data_->_tmp170_;
		_data_->_tmp172_ = bool_to_string (_data_->_tmp171_);
		_data_->_tmp173_ = _data_->_tmp172_;
		tuba_request_v2_add_form_data (_data_->_tmp168_, "show_featured", _data_->_tmp173_);
		_g_free0 (_data_->_tmp173_);
		_data_->_tmp174_ = _data_->req2;
		_data_->_tmp175_ = _data_->self->priv->media_row;
		_data_->_tmp176_ = adw_switch_row_get_active (_data_->_tmp175_);
		_data_->_tmp177_ = _data_->_tmp176_;
		_data_->_tmp178_ = bool_to_string (_data_->_tmp177_);
		_data_->_tmp179_ = _data_->_tmp178_;
		tuba_request_v2_add_form_data (_data_->_tmp174_, "show_media", _data_->_tmp179_);
		_g_free0 (_data_->_tmp179_);
		_data_->_tmp180_ = _data_->self->priv->media_replies_row;
		_data_->_tmp181_ = gtk_widget_get_sensitive ((GtkWidget*) _data_->_tmp180_);
		_data_->_tmp182_ = _data_->_tmp181_;
		if (_data_->_tmp182_) {
			_data_->_tmp183_ = _data_->req2;
			_data_->_tmp184_ = _data_->self->priv->media_replies_row;
			_data_->_tmp185_ = adw_switch_row_get_active (_data_->_tmp184_);
			_data_->_tmp186_ = _data_->_tmp185_;
			_data_->_tmp187_ = bool_to_string (_data_->_tmp186_);
			_data_->_tmp188_ = _data_->_tmp187_;
			tuba_request_v2_add_form_data (_data_->_tmp183_, "show_media_replies", _data_->_tmp188_);
			_g_free0 (_data_->_tmp188_);
		}
		_data_->_tmp189_ = _data_->req2;
		_data_->_state_ = 3;
		tuba_request_v2_exec (_data_->_tmp189_, tuba_dialogs_profile_edit_save_ready, _data_);
		return FALSE;
		_state_3:
		_data_->_tmp190_ = tuba_request_v2_exec_finish (_data_->_tmp189_, _data_->_res_, NULL, &_data_->_inner_error0_);
		_data_->_tmp191_ = _data_->_tmp190_;
		_g_object_unref0 (_data_->_tmp191_);
		if (G_UNLIKELY (_data_->_inner_error0_ != NULL)) {
			g_task_return_error (_data_->_async_result, _data_->_inner_error0_);
			_g_object_unref0 (_data_->req2);
			_g_object_unref0 (_data_->req);
			g_object_unref (_data_->_async_result);
			return FALSE;
		}
		_data_->_tmp192_ = tuba_accounts;
		_data_->_tmp193_ = tuba_account_store_get_active (_data_->_tmp192_);
		_data_->_tmp194_ = _data_->_tmp193_;
		_data_->_tmp195_ = _data_->self->priv->featured_row;
		_data_->_tmp196_ = adw_switch_row_get_active (_data_->_tmp195_);
		_data_->_tmp197_ = _data_->_tmp196_;
		tuba_api_account_set_show_featured ((TubaAPIAccount*) _data_->_tmp194_, _data_->_tmp197_);
		_data_->_tmp198_ = tuba_accounts;
		_data_->_tmp199_ = tuba_account_store_get_active (_data_->_tmp198_);
		_data_->_tmp200_ = _data_->_tmp199_;
		_data_->_tmp201_ = _data_->self->priv->media_row;
		_data_->_tmp202_ = adw_switch_row_get_active (_data_->_tmp201_);
		_data_->_tmp203_ = _data_->_tmp202_;
		tuba_api_account_set_show_media ((TubaAPIAccount*) _data_->_tmp200_, _data_->_tmp203_);
		_data_->_tmp204_ = tuba_accounts;
		_data_->_tmp205_ = tuba_account_store_get_active (_data_->_tmp204_);
		_data_->_tmp206_ = _data_->_tmp205_;
		_data_->_tmp207_ = _data_->self->priv->media_replies_row;
		_data_->_tmp208_ = adw_switch_row_get_active (_data_->_tmp207_);
		_data_->_tmp209_ = _data_->_tmp208_;
		tuba_api_account_set_show_media_replies ((TubaAPIAccount*) _data_->_tmp206_, _data_->_tmp209_);
		_g_object_unref0 (_data_->req2);
	}
	g_signal_emit (_data_->self, tuba_dialogs_profile_edit_signals[TUBA_DIALOGS_PROFILE_EDIT_SAVED_SIGNAL], 0);
	_g_object_unref0 (_data_->req);
	g_task_return_pointer (_data_->_async_result, _data_, NULL);
	if (_data_->_state_ != 0) {
		while (!g_task_get_completed (_data_->_async_result)) {
			g_main_context_iteration (g_task_get_context (_data_->_async_result), TRUE);
		}
	}
	g_object_unref (_data_->_async_result);
	return FALSE;
}

static guint8*
_vala_array_dup17 (guint8* self,
                   gssize length)
{
	if (length > 0) {
		return g_memdup2 (self, length * sizeof (guint8));
	}
	return NULL;
}

static void
tuba_dialogs_profile_edit_image_data (TubaDialogsProfileEdit* self,
                                      GFile* file,
                                      gchar** mime,
                                      GBytes** buffer,
                                      GError** error)
{
	gchar* _vala_mime = NULL;
	GBytes* _vala_buffer = NULL;
	guint8* t_contents = NULL;
	gint t_contents_length1 = 0;
	gint _t_contents_size_ = 0;
	gchar* t_mime = NULL;
	gchar* _tmp0_;
	guint8* _tmp15_;
	gint _tmp15__length1;
	guint8* _tmp16_;
	gint _tmp16__length1;
	GBytes* _tmp17_;
	const gchar* _tmp18_;
	gchar* _tmp19_;
	GError* _inner_error0_ = NULL;
	g_return_if_fail (self != NULL);
	g_return_if_fail (file != NULL);
	_tmp0_ = g_strdup ("");
	t_mime = _tmp0_;
	{
		guint8* _tmp1_ = NULL;
		gsize _tmp2_ = 0;
		GFileInfo* type = NULL;
		GFileInfo* _tmp3_;
		GFileInfo* _tmp4_;
		const gchar* _tmp5_;
		gchar* _tmp6_;
		g_file_load_contents (file, NULL, &_tmp1_, &_tmp2_, NULL, &_inner_error0_);
		t_contents = (g_free (t_contents), NULL);
		t_contents = _tmp1_;
		t_contents_length1 = _tmp2_;
		_t_contents_size_ = t_contents_length1;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp3_ = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, 0, NULL, &_inner_error0_);
		type = _tmp3_;
		if (G_UNLIKELY (_inner_error0_ != NULL)) {
			goto __catch0_g_error;
		}
		_tmp4_ = type;
		_tmp5_ = g_file_info_get_content_type (_tmp4_);
		_tmp6_ = g_strdup (_tmp5_);
		_g_free0 (t_mime);
		t_mime = _tmp6_;
		_g_object_unref0 (type);
	}
	goto __finally0;
	__catch0_g_error:
	{
		GError* e = NULL;
		gchar* _tmp7_;
		gchar* _tmp8_;
		GError* _tmp9_;
		const gchar* _tmp10_;
		gchar* _tmp11_;
		gchar* _tmp12_;
		GError* _tmp13_;
		GError* _tmp14_;
		e = _inner_error0_;
		_inner_error0_ = NULL;
		_tmp7_ = g_file_get_path (file);
		_tmp8_ = _tmp7_;
		_tmp9_ = e;
		_tmp10_ = _tmp9_->message;
		_tmp11_ = g_strdup_printf ("Can't open file %s:\n%s", _tmp8_, _tmp10_);
		_tmp12_ = _tmp11_;
		_tmp13_ = g_error_new_literal (TUBA_OOPSIE, TUBA_OOPSIE_USER, _tmp12_);
		_tmp14_ = _tmp13_;
		_g_free0 (_tmp12_);
		_g_free0 (_tmp8_);
		_inner_error0_ = _tmp14_;
		_g_error_free0 (e);
		goto __finally0;
	}
	__finally0:
	if (G_UNLIKELY (_inner_error0_ != NULL)) {
		g_propagate_error (error, _inner_error0_);
		_g_free0 (t_mime);
		t_contents = (g_free (t_contents), NULL);
		_g_free0 (_vala_mime);
		_g_bytes_unref0 (_vala_buffer);
		return;
	}
	_tmp15_ = t_contents;
	_tmp15__length1 = t_contents_length1;
	_tmp16_ = (_tmp15_ != NULL) ? _vala_array_dup17 (_tmp15_, _tmp15__length1) : _tmp15_;
	_tmp16__length1 = _tmp15__length1;
	_tmp17_ = g_bytes_new_take (_tmp16_, _tmp16__length1);
	_g_bytes_unref0 (_vala_buffer);
	_vala_buffer = _tmp17_;
	_tmp18_ = t_mime;
	_tmp19_ = g_strdup (_tmp18_);
	_g_free0 (_vala_mime);
	_vala_mime = _tmp19_;
	_g_free0 (t_mime);
	t_contents = (g_free (t_contents), NULL);
	if (mime) {
		*mime = _vala_mime;
	} else {
		_g_free0 (_vala_mime);
	}
	if (buffer) {
		*buffer = _vala_buffer;
	} else {
		_g_bytes_unref0 (_vala_buffer);
	}
}

static TubaAPIAccount*
tuba_dialogs_profile_edit_get_profile (TubaDialogsProfileEdit* self)
{
	TubaAPIAccount* result;
	TubaAPIAccount* _tmp0_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp0_ = self->priv->_profile;
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_profile_edit_set_profile (TubaDialogsProfileEdit* self,
                                       TubaAPIAccount* value)
{
	TubaAPIAccount* _tmp0_;
	g_return_if_fail (self != NULL);
	_tmp0_ = _g_object_ref0 (value);
	_g_object_unref0 (self->priv->_profile);
	self->priv->_profile = _tmp0_;
}

static inline gpointer
tuba_dialogs_profile_edit_field_get_instance_private (TubaDialogsProfileEditField* self)
{
	return G_STRUCT_MEMBER_P (self, TubaDialogsProfileEditField_private_offset);
}

static void
_tuba_dialogs_profile_edit_field_update_valid_style_gtk_editable_changed (GtkEditable* _sender,
                                                                          gpointer self)
{
	tuba_dialogs_profile_edit_field_update_valid_style ((TubaDialogsProfileEditField*) self);
}

TubaDialogsProfileEditField*
tuba_dialogs_profile_edit_field_construct (GType object_type,
                                           const gchar* t_key,
                                           const gchar* t_value,
                                           gint64 t_max_key_length,
                                           gint64 t_max_value_length)
{
	TubaDialogsProfileEditField * self = NULL;
	gboolean _tmp0_ = FALSE;
	const gchar* _tmp1_ = NULL;
	gchar* _tmp2_;
	gchar* _tmp3_;
	AdwEntryRow* _tmp4_ = NULL;
	AdwEntryRow* _tmp5_;
	const gchar* _tmp6_ = NULL;
	gchar* _tmp7_;
	gchar* _tmp8_;
	AdwEntryRow* _tmp9_ = NULL;
	AdwEntryRow* _tmp10_;
	AdwEntryRow* _tmp11_;
	AdwEntryRow* _tmp12_;
	self = (TubaDialogsProfileEditField*) g_object_new (object_type, NULL);
	self->priv->max_key_length = t_max_key_length;
	self->priv->max_value_length = t_max_value_length;
	if (t_key != NULL) {
		_tmp0_ = TRUE;
	} else {
		_tmp0_ = t_value != NULL;
	}
	adw_expander_row_set_expanded ((AdwExpanderRow*) self, _tmp0_);
	_tmp1_ = t_key;
	if (_tmp1_ == NULL) {
		_tmp1_ = "";
	}
	_tmp2_ = g_strdup (_ ("Label"));
	_tmp3_ = g_strdup (_tmp1_);
	_tmp4_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_entry_row_set_input_purpose (_tmp4_, GTK_INPUT_PURPOSE_FREE_FORM);
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp4_, _tmp2_);
	_g_free0 (_tmp2_);
	gtk_editable_set_text ((GtkEditable*) _tmp4_, _tmp3_);
	_g_free0 (_tmp3_);
	g_object_ref_sink (_tmp4_);
	_g_object_unref0 (self->priv->key_row);
	self->priv->key_row = _tmp4_;
	_tmp5_ = self->priv->key_row;
	g_signal_connect_object ((GtkEditable*) _tmp5_, "changed", (GCallback) _tuba_dialogs_profile_edit_field_update_valid_style_gtk_editable_changed, self, 0);
	_tmp6_ = t_value;
	if (_tmp6_ == NULL) {
		_tmp6_ = "";
	}
	_tmp7_ = g_strdup (_ ("Content"));
	_tmp8_ = g_strdup (_tmp6_);
	_tmp9_ = (AdwEntryRow*) adw_entry_row_new ();
	adw_entry_row_set_input_purpose (_tmp9_, GTK_INPUT_PURPOSE_FREE_FORM);
	adw_preferences_row_set_title ((AdwPreferencesRow*) _tmp9_, _tmp7_);
	_g_free0 (_tmp7_);
	gtk_editable_set_text ((GtkEditable*) _tmp9_, _tmp8_);
	_g_free0 (_tmp8_);
	g_object_ref_sink (_tmp9_);
	_g_object_unref0 (self->priv->value_row);
	self->priv->value_row = _tmp9_;
	_tmp10_ = self->priv->value_row;
	g_signal_connect_object ((GtkEditable*) _tmp10_, "changed", (GCallback) _tuba_dialogs_profile_edit_field_update_valid_style_gtk_editable_changed, self, 0);
	_tmp11_ = self->priv->key_row;
	adw_expander_row_add_row ((AdwExpanderRow*) self, (GtkWidget*) _tmp11_);
	_tmp12_ = self->priv->value_row;
	adw_expander_row_add_row ((AdwExpanderRow*) self, (GtkWidget*) _tmp12_);
	tuba_dialogs_profile_edit_field_update_valid_style (self);
	return self;
}

TubaDialogsProfileEditField*
tuba_dialogs_profile_edit_field_new (const gchar* t_key,
                                     const gchar* t_value,
                                     gint64 t_max_key_length,
                                     gint64 t_max_value_length)
{
	return tuba_dialogs_profile_edit_field_construct (TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, t_key, t_value, t_max_key_length, t_max_value_length);
}

static void
tuba_dialogs_profile_edit_field_update_valid_style (TubaDialogsProfileEditField* self)
{
	gboolean _tmp0_;
	gboolean _tmp1_;
	g_return_if_fail (self != NULL);
	_tmp0_ = tuba_dialogs_profile_edit_field_get_valid (self);
	_tmp1_ = _tmp0_;
	tuba_toggle_css ((GtkWidget*) self, !_tmp1_, "error");
}

const gchar*
tuba_dialogs_profile_edit_field_get_key (TubaDialogsProfileEditField* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	AdwEntryRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->key_row;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	result = _tmp0_;
	return result;
}

const gchar*
tuba_dialogs_profile_edit_field_get_value (TubaDialogsProfileEditField* self)
{
	const gchar* result;
	const gchar* _tmp0_ = NULL;
	AdwEntryRow* _tmp1_;
	const gchar* _tmp2_;
	const gchar* _tmp3_;
	g_return_val_if_fail (self != NULL, NULL);
	_tmp1_ = self->priv->value_row;
	_tmp2_ = gtk_editable_get_text ((GtkEditable*) _tmp1_);
	_tmp3_ = _tmp2_;
	_tmp0_ = _tmp3_;
	if (_tmp0_ == NULL) {
		_tmp0_ = "";
	}
	result = _tmp0_;
	return result;
}

gboolean
tuba_dialogs_profile_edit_field_get_valid (TubaDialogsProfileEditField* self)
{
	gboolean result;
	gboolean _tmp0_ = FALSE;
	gboolean _tmp1_ = FALSE;
	gboolean _tmp2_ = FALSE;
	const gchar* _tmp3_;
	const gchar* _tmp4_;
	gint _tmp5_;
	gint _tmp6_;
	g_return_val_if_fail (self != NULL, FALSE);
	_tmp3_ = tuba_dialogs_profile_edit_field_get_key (self);
	_tmp4_ = _tmp3_;
	_tmp5_ = strlen (_tmp4_);
	_tmp6_ = _tmp5_;
	if (_tmp6_ > 0) {
		const gchar* _tmp7_;
		const gchar* _tmp8_;
		gint _tmp9_;
		gint _tmp10_;
		_tmp7_ = tuba_dialogs_profile_edit_field_get_value (self);
		_tmp8_ = _tmp7_;
		_tmp9_ = strlen (_tmp8_);
		_tmp10_ = _tmp9_;
		_tmp2_ = _tmp10_ > 0;
	} else {
		_tmp2_ = FALSE;
	}
	if (_tmp2_) {
		const gchar* _tmp11_;
		const gchar* _tmp12_;
		gint _tmp13_;
		gint _tmp14_;
		_tmp11_ = tuba_dialogs_profile_edit_field_get_key (self);
		_tmp12_ = _tmp11_;
		_tmp13_ = strlen (_tmp12_);
		_tmp14_ = _tmp13_;
		_tmp1_ = ((gint64) _tmp14_) <= self->priv->max_key_length;
	} else {
		_tmp1_ = FALSE;
	}
	if (_tmp1_) {
		const gchar* _tmp15_;
		const gchar* _tmp16_;
		gint _tmp17_;
		gint _tmp18_;
		_tmp15_ = tuba_dialogs_profile_edit_field_get_value (self);
		_tmp16_ = _tmp15_;
		_tmp17_ = strlen (_tmp16_);
		_tmp18_ = _tmp17_;
		_tmp0_ = ((gint64) _tmp18_) <= self->priv->max_value_length;
	} else {
		_tmp0_ = FALSE;
	}
	result = _tmp0_;
	return result;
}

static void
tuba_dialogs_profile_edit_field_class_init (TubaDialogsProfileEditFieldClass * klass,
                                            gpointer klass_data)
{
	tuba_dialogs_profile_edit_field_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsProfileEditField_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_profile_edit_field_get_property;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_profile_edit_field_finalize;
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_PROFILE_EDIT_FIELD_KEY_PROPERTY, tuba_dialogs_profile_edit_field_properties[TUBA_DIALOGS_PROFILE_EDIT_FIELD_KEY_PROPERTY] = g_param_spec_string ("key", "key", "key", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALUE_PROPERTY, tuba_dialogs_profile_edit_field_properties[TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALUE_PROPERTY] = g_param_spec_string ("value", "value", "value", NULL, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
	g_object_class_install_property (G_OBJECT_CLASS (klass), TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALID_PROPERTY, tuba_dialogs_profile_edit_field_properties[TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALID_PROPERTY] = g_param_spec_boolean ("valid", "valid", "valid", FALSE, G_PARAM_STATIC_STRINGS | G_PARAM_READABLE));
}

static void
tuba_dialogs_profile_edit_field_instance_init (TubaDialogsProfileEditField * self,
                                               gpointer klass)
{
	self->priv = tuba_dialogs_profile_edit_field_get_instance_private (self);
}

static void
tuba_dialogs_profile_edit_field_finalize (GObject * obj)
{
	TubaDialogsProfileEditField * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, TubaDialogsProfileEditField);
	g_debug ("ProfileEdit.vala:9: Destroying ProfileEdit.Field");
	_g_object_unref0 (self->priv->key_row);
	_g_object_unref0 (self->priv->value_row);
	G_OBJECT_CLASS (tuba_dialogs_profile_edit_field_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_profile_edit_field_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsProfileEditFieldClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_profile_edit_field_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsProfileEditField), 0, (GInstanceInitFunc) tuba_dialogs_profile_edit_field_instance_init, NULL };
	GType tuba_dialogs_profile_edit_field_type_id;
	tuba_dialogs_profile_edit_field_type_id = g_type_register_static (adw_expander_row_get_type (), "TubaDialogsProfileEditField", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsProfileEditField_private_offset = g_type_add_instance_private (tuba_dialogs_profile_edit_field_type_id, sizeof (TubaDialogsProfileEditFieldPrivate));
	return tuba_dialogs_profile_edit_field_type_id;
}

GType
tuba_dialogs_profile_edit_field_get_type (void)
{
	static GType tuba_dialogs_profile_edit_field_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_profile_edit_field_type_id__once)) {
		GType tuba_dialogs_profile_edit_field_type_id;
		tuba_dialogs_profile_edit_field_type_id = tuba_dialogs_profile_edit_field_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_profile_edit_field_type_id__once, tuba_dialogs_profile_edit_field_type_id);
	}
	return tuba_dialogs_profile_edit_field_type_id__once;
}

static void
_vala_tuba_dialogs_profile_edit_field_get_property (GObject * object,
                                                    guint property_id,
                                                    GValue * value,
                                                    GParamSpec * pspec)
{
	TubaDialogsProfileEditField * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, TubaDialogsProfileEditField);
	switch (property_id) {
		case TUBA_DIALOGS_PROFILE_EDIT_FIELD_KEY_PROPERTY:
		g_value_set_string (value, tuba_dialogs_profile_edit_field_get_key (self));
		break;
		case TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALUE_PROPERTY:
		g_value_set_string (value, tuba_dialogs_profile_edit_field_get_value (self));
		break;
		case TUBA_DIALOGS_PROFILE_EDIT_FIELD_VALID_PROPERTY:
		g_value_set_boolean (value, tuba_dialogs_profile_edit_field_get_valid (self));
		break;
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_tuba_dialogs_profile_edit_on_bio_text_changed_gtk_text_buffer_changed (GtkTextBuffer* _sender,
                                                                        gpointer self)
{
	tuba_dialogs_profile_edit_on_bio_text_changed ((TubaDialogsProfileEdit*) self);
}

static void
_tuba_dialogs_profile_edit_update_style_scheme_g_object_notify (GObject* _sender,
                                                                GParamSpec* pspec,
                                                                gpointer self)
{
	tuba_dialogs_profile_edit_update_style_scheme ((TubaDialogsProfileEdit*) self);
}

static GObject *
tuba_dialogs_profile_edit_constructor (GType type,
                                       guint n_construct_properties,
                                       GObjectConstructParam * construct_properties)
{
	GObject * obj;
	GObjectClass * parent_class;
	TubaDialogsProfileEdit * self;
	GtkFileFilter* _tmp0_;
	GtkFileFilter* _tmp1_;
	GtkFileFilter* _tmp2_;
	GtkSourceView* _tmp3_;
	GtkSourceView* _tmp4_;
	GtkTextBuffer* _tmp5_;
	GtkTextBuffer* _tmp6_;
	AdwStyleManager* _tmp7_;
	SpellingTextBufferAdapter* adapter = NULL;
	GtkSourceView* _tmp8_;
	GtkTextBuffer* _tmp9_;
	GtkTextBuffer* _tmp10_;
	SpellingChecker* _tmp11_;
	SpellingTextBufferAdapter* _tmp12_;
	GtkSourceView* _tmp13_;
	SpellingTextBufferAdapter* _tmp14_;
	GMenuModel* _tmp15_;
	GtkSourceView* _tmp16_;
	SpellingTextBufferAdapter* _tmp17_;
	SpellingTextBufferAdapter* _tmp18_;
	gboolean _tmp19_ = FALSE;
	TubaAccountStore* _tmp20_;
	TubaInstanceAccount* _tmp21_;
	TubaInstanceAccount* _tmp22_;
	GeeArrayList* _tmp23_;
	GeeArrayList* _tmp24_;
	TubaAccountStore* _tmp35_;
	TubaInstanceAccount* _tmp36_;
	TubaInstanceAccount* _tmp37_;
	TubaInstanceAccountInstanceFeatures _tmp38_;
	TubaInstanceAccountInstanceFeatures _tmp39_;
	parent_class = G_OBJECT_CLASS (tuba_dialogs_profile_edit_parent_class);
	obj = parent_class->constructor (type, n_construct_properties, construct_properties);
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEdit);
	_tmp0_ = self->priv->filter;
	gtk_file_filter_add_mime_type (_tmp0_, "image/jpeg");
	_tmp1_ = self->priv->filter;
	gtk_file_filter_add_mime_type (_tmp1_, "image/png");
	_tmp2_ = self->priv->filter;
	gtk_file_filter_add_mime_type (_tmp2_, "image/gif");
	_tmp3_ = self->priv->bio_text_view;
	gtk_widget_remove_css_class ((GtkWidget*) _tmp3_, "view");
	_tmp4_ = self->priv->bio_text_view;
	_tmp5_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp4_);
	_tmp6_ = _tmp5_;
	g_signal_connect_object (_tmp6_, "changed", (GCallback) _tuba_dialogs_profile_edit_on_bio_text_changed_gtk_text_buffer_changed, self, 0);
	_tmp7_ = adw_style_manager_get_default ();
	g_signal_connect_object ((GObject*) _tmp7_, "notify::dark", (GCallback) _tuba_dialogs_profile_edit_update_style_scheme_g_object_notify, self, 0);
	tuba_dialogs_profile_edit_update_style_scheme (self);
	_tmp8_ = self->priv->bio_text_view;
	_tmp9_ = gtk_text_view_get_buffer ((GtkTextView*) _tmp8_);
	_tmp10_ = _tmp9_;
	_tmp11_ = spelling_checker_get_default ();
	_tmp12_ = spelling_text_buffer_adapter_new (G_TYPE_CHECK_INSTANCE_CAST (_tmp10_, gtk_source_buffer_get_type (), GtkSourceBuffer), _tmp11_);
	adapter = _tmp12_;
	_tmp13_ = self->priv->bio_text_view;
	_tmp14_ = adapter;
	_tmp15_ = spelling_text_buffer_adapter_get_menu_model (_tmp14_);
	gtk_text_view_set_extra_menu ((GtkTextView*) _tmp13_, _tmp15_);
	_tmp16_ = self->priv->bio_text_view;
	_tmp17_ = adapter;
	gtk_widget_insert_action_group ((GtkWidget*) _tmp16_, "spelling", (GActionGroup*) _tmp17_);
	_tmp18_ = adapter;
	spelling_text_buffer_adapter_set_enabled (_tmp18_, TRUE);
	_tmp20_ = tuba_accounts;
	_tmp21_ = tuba_account_store_get_active (_tmp20_);
	_tmp22_ = _tmp21_;
	_tmp23_ = tuba_instance_account_get_instance_emojis (_tmp22_);
	_tmp24_ = _tmp23_;
	if (_tmp24_ != NULL) {
		TubaAccountStore* _tmp25_;
		TubaInstanceAccount* _tmp26_;
		TubaInstanceAccount* _tmp27_;
		GeeArrayList* _tmp28_;
		GeeArrayList* _tmp29_;
		gint _tmp30_;
		gint _tmp31_;
		_tmp25_ = tuba_accounts;
		_tmp26_ = tuba_account_store_get_active (_tmp25_);
		_tmp27_ = _tmp26_;
		_tmp28_ = tuba_instance_account_get_instance_emojis (_tmp27_);
		_tmp29_ = _tmp28_;
		_tmp30_ = gee_abstract_collection_get_size ((GeeAbstractCollection*) _tmp29_);
		_tmp31_ = _tmp30_;
		_tmp19_ = _tmp31_ > 0;
	} else {
		_tmp19_ = FALSE;
	}
	if (_tmp19_) {
		GtkMenuButton* _tmp32_;
		AdwExpanderRow* _tmp33_;
		GtkMenuButton* _tmp34_;
		_tmp32_ = self->priv->cepbtn;
		gtk_widget_set_visible ((GtkWidget*) _tmp32_, TRUE);
		_tmp33_ = self->priv->bio_row;
		_tmp34_ = self->priv->cepbtn;
		g_object_bind_property_with_closures ((GObject*) _tmp33_, "expanded", (GObject*) _tmp34_, "sensitive", G_BINDING_SYNC_CREATE, (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)), (GClosure*) ((NULL == NULL) ? NULL : g_cclosure_new ((GCallback) NULL, NULL, (GClosureNotify) NULL)));
	}
	_tmp35_ = tuba_accounts;
	_tmp36_ = tuba_account_store_get_active (_tmp35_);
	_tmp37_ = _tmp36_;
	_tmp38_ = tuba_instance_account_get_tuba_instance_features (_tmp37_);
	_tmp39_ = _tmp38_;
	if ((_tmp39_ & TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_GOTOSOCIAL) == TUBA_INSTANCE_ACCOUNT_INSTANCE_FEATURES_GOTOSOCIAL) {
		AdwPreferencesGroup* _tmp40_;
		_tmp40_ = self->priv->gotosocial_group;
		gtk_widget_set_visible ((GtkWidget*) _tmp40_, TRUE);
	}
	_g_object_unref0 (adapter);
	return obj;
}

static void
tuba_dialogs_profile_edit_class_init (TubaDialogsProfileEditClass * klass,
                                      gpointer klass_data)
{
	tuba_dialogs_profile_edit_parent_class = g_type_class_peek_parent (klass);
	g_type_class_adjust_private_offset (klass, &TubaDialogsProfileEdit_private_offset);
	G_OBJECT_CLASS (klass)->get_property = _vala_tuba_dialogs_profile_edit_get_property;
	G_OBJECT_CLASS (klass)->set_property = _vala_tuba_dialogs_profile_edit_set_property;
	G_OBJECT_CLASS (klass)->constructor = tuba_dialogs_profile_edit_constructor;
	G_OBJECT_CLASS (klass)->finalize = tuba_dialogs_profile_edit_finalize;
	gtk_widget_class_set_template_from_resource (GTK_WIDGET_CLASS (klass), "/dev/geopjr/Tuba/ui/dialogs/profile_edit.ui");
	tuba_dialogs_profile_edit_signals[TUBA_DIALOGS_PROFILE_EDIT_SAVED_SIGNAL] = g_signal_new ("saved", TUBA_DIALOGS_TYPE_PROFILE_EDIT, G_SIGNAL_RUN_LAST, 0, NULL, NULL, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "name_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, name_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "bio_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, bio_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "bio_text_view", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, bio_text_view));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avi", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, avi));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "background", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, background));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "fields_box", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, fields_box));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "cepbtn", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, cepbtn));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "alt_text_group", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, alt_text_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "avi_alt_text_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, avi_alt_text_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "header_alt_text_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, header_alt_text_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "display_group", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, display_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "featured_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, featured_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "media_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, media_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "media_replies_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, media_replies_row));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "gotosocial_group", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, gotosocial_group));
	gtk_widget_class_bind_template_child_full (GTK_WIDGET_CLASS (klass), "rss_row", FALSE, TubaDialogsProfileEdit_private_offset + G_STRUCT_OFFSET (TubaDialogsProfileEditPrivate, rss_row));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_close", G_CALLBACK(_tuba_dialogs_profile_edit_on_close_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_avi_button_clicked", G_CALLBACK(_tuba_dialogs_profile_edit_on_avi_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_header_button_clicked", G_CALLBACK(_tuba_dialogs_profile_edit_on_header_button_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_save_clicked", G_CALLBACK(_tuba_dialogs_profile_edit_on_save_clicked_gtk_button_clicked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_bio_emoji_picked", G_CALLBACK(_tuba_dialogs_profile_edit_on_bio_emoji_picked_tuba_widgets_custom_emoji_chooser_v2_emoji_picked));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_name_row_changed", G_CALLBACK(_tuba_dialogs_profile_edit_on_name_row_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_avi_alt_text_row_changed", G_CALLBACK(_tuba_dialogs_profile_edit_on_avi_alt_text_row_changed_gtk_editable_changed));
	gtk_widget_class_bind_template_callback_full (GTK_WIDGET_CLASS (klass), "on_header_alt_text_row_changed", G_CALLBACK(_tuba_dialogs_profile_edit_on_header_alt_text_row_changed_gtk_editable_changed));
	g_type_ensure (TUBA_WIDGETS_TYPE_CUSTOM_EMOJI_CHOOSER_V2);
}

static void
tuba_dialogs_profile_edit_instance_init (TubaDialogsProfileEdit * self,
                                         gpointer klass)
{
	gchar* _tmp0_;
	GtkFileFilter* _tmp1_ = NULL;
	GeeArrayList* _tmp2_;
	self->priv = tuba_dialogs_profile_edit_get_instance_private (self);
	_tmp0_ = g_strdup (_ ("All Supported Files"));
	_tmp1_ = gtk_file_filter_new ();
	g_object_set (_tmp1_, "name", _tmp0_, NULL);
	_g_free0 (_tmp0_);
	self->priv->filter = _tmp1_;
	_tmp2_ = gee_array_list_new (TUBA_DIALOGS_PROFILE_EDIT_TYPE_FIELD, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL);
	self->priv->fields = _tmp2_;
	self->priv->add_field_row = NULL;
	gtk_widget_init_template (GTK_WIDGET (self));
}

static void
tuba_dialogs_profile_edit_finalize (GObject * obj)
{
	TubaDialogsProfileEdit * self;
	TubaAPIAccount* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	const gchar* _tmp4_;
	gchar* _tmp5_;
	gchar* _tmp6_;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEdit);
	_tmp0_ = self->priv->_profile;
	_tmp1_ = tuba_api_account_get_handle (_tmp0_);
	_tmp2_ = _tmp1_;
	_tmp3_ = _tmp2_;
	_tmp4_ = string_to_string (_tmp3_);
	_tmp5_ = g_strconcat ("Destroying ProfileEdit for ", _tmp4_, NULL);
	_tmp6_ = _tmp5_;
	g_debug ("ProfileEdit.vala:4: %s", _tmp6_);
	_g_free0 (_tmp6_);
	_g_free0 (_tmp3_);
	_g_object_unref0 (self->priv->filter);
	_g_object_unref0 (self->priv->_profile);
	_g_object_unref0 (self->priv->fields);
	_g_object_unref0 (self->priv->add_field_row);
	_g_object_unref0 (self->priv->new_avi);
	_g_object_unref0 (self->priv->new_header);
	G_OBJECT_CLASS (tuba_dialogs_profile_edit_parent_class)->finalize (obj);
}

 G_GNUC_NO_INLINE static GType
tuba_dialogs_profile_edit_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (TubaDialogsProfileEditClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) tuba_dialogs_profile_edit_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (TubaDialogsProfileEdit), 0, (GInstanceInitFunc) tuba_dialogs_profile_edit_instance_init, NULL };
	GType tuba_dialogs_profile_edit_type_id;
	tuba_dialogs_profile_edit_type_id = g_type_register_static (adw_dialog_get_type (), "TubaDialogsProfileEdit", &g_define_type_info, G_TYPE_FLAG_NONE);
	TubaDialogsProfileEdit_private_offset = g_type_add_instance_private (tuba_dialogs_profile_edit_type_id, sizeof (TubaDialogsProfileEditPrivate));
	return tuba_dialogs_profile_edit_type_id;
}

GType
tuba_dialogs_profile_edit_get_type (void)
{
	static GType tuba_dialogs_profile_edit_type_id__once = 0;
	if (g_once_init_enter_pointer (&tuba_dialogs_profile_edit_type_id__once)) {
		GType tuba_dialogs_profile_edit_type_id;
		tuba_dialogs_profile_edit_type_id = tuba_dialogs_profile_edit_get_type_once ();
		g_once_init_leave_pointer (&tuba_dialogs_profile_edit_type_id__once, tuba_dialogs_profile_edit_type_id);
	}
	return tuba_dialogs_profile_edit_type_id__once;
}

static void
_vala_tuba_dialogs_profile_edit_get_property (GObject * object,
                                              guint property_id,
                                              GValue * value,
                                              GParamSpec * pspec)
{
	TubaDialogsProfileEdit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEdit);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

static void
_vala_tuba_dialogs_profile_edit_set_property (GObject * object,
                                              guint property_id,
                                              const GValue * value,
                                              GParamSpec * pspec)
{
	TubaDialogsProfileEdit * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (object, TUBA_DIALOGS_TYPE_PROFILE_EDIT, TubaDialogsProfileEdit);
	switch (property_id) {
		default:
		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
		break;
	}
}

